blob: 8ca8e7a71c459f33e98fe768ba2e5bbf9733646a [file] [log] [blame]
Prachi Gupta82876632016-11-22 09:52:53 -06001From 7ad7fc3bf87ae43c917dda3d8fc6e81747f7816c Mon Sep 17 00:00:00 2001
2From: Prachi Gupta <pragupta@us.ibm.com>
3Date: Mon, 26 Sep 2016 10:04:58 -0500
4Subject: [PATCH 1/2] processMRW updates for witherspoon
5
6Change-Id: Idf410eedf5214de5c106c5d5fa6503458c17f115
7RTC:143114
8Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30511
9Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
10Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
11Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
12Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
13---
14 src/usr/targeting/common/Targets.pm | 741 ++++++++++++++++-----
15 src/usr/targeting/common/processMrw.pl | 176 +++--
16 .../targeting/common/xmltohb/attribute_types.xml | 2 +-
17 src/usr/targeting/common/xmltohb/target_types.xml | 6 +
18 4 files changed, 685 insertions(+), 240 deletions(-)
19
20diff --git a/src/usr/targeting/common/Targets.pm b/src/usr/targeting/common/Targets.pm
21index 32a789e..fc18675 100644
22--- a/src/usr/targeting/common/Targets.pm
23+++ b/src/usr/targeting/common/Targets.pm
24@@ -28,6 +28,40 @@ use strict;
25 use XML::Simple;
26 use XML::Parser;
27 use Data::Dumper;
28+use feature "state";
29+
30+use constant
31+{
32+ MAX_PROC_PER_NODE => 8,
33+ MAX_CORE_PER_PROC => 24,
34+ MAX_EX_PER_PROC => 12,
35+ MAX_EQ_PER_PROC => 6,
36+ MAX_ABUS_PER_PROC => 3,
37+ MAX_XBUS_PER_PROC => 3,
38+ MAX_MCS_PER_PROC => 4,
39+ MAX_MCA_PER_PROC => 8,
40+ MAX_MCBIST_PER_PROC => 2,
41+ MAX_PEC_PER_PROC => 3, # PEC is same as PBCQ
42+ MAX_PHB_PER_PROC => 6, # PHB is same as PCIE
43+ MAX_MBA_PER_MEMBUF => 2,
44+ MAX_OBUS_PER_PROC => 4,
45+ MAX_PPE_PER_PROC => 51, #Only 21, but they are sparsely populated
46+ MAX_PERV_PER_PROC => 56, #Only 42, but they are sparsely populated
47+ MAX_CAPP_PER_PROC => 2,
48+ MAX_SBE_PER_PROC => 1,
49+ MAX_NV_PER_PROC => 1, # FW only for GARD purposes
50+ MAX_MI_PER_PROC => 4,
51+ PERVASIVE_PARENT_CORE_OFFSET => 32,
52+ PERVASIVE_PARENT_EQ_OFFSET => 16,
53+ PERVASIVE_PARENT_XBUS_OFFSET => 6,
54+ PERVASIVE_PARENT_OBUS_OFFSET => 9,
55+ PERVASIVE_PARENT_MCBIST_OFFSET => 7,
56+ PERVASIVE_PARENT_MCS_OFFSET => 7,
57+ PERVASIVE_PARENT_MCA_OFFSET => 7,
58+ PERVASIVE_PARENT_PEC_OFFSET => 13,
59+ PERVASIVE_PARENT_PHB_OFFSET => 13,
60+ PERVASIVE_PARENT_NV_OFFSET => 5,
61+};
62
63 sub new
64 {
65@@ -152,11 +186,19 @@ sub printTarget
66 my $target = shift;
67
68 my $target_ptr = $self->getTarget($target);
69+
70+ if ($target eq "")
71+ {
72+ return;
73+ }
74+
75 print $fh "<targetInstance>\n";
76 my $target_id = $self->getAttribute($target, "PHYS_PATH");
77 $target_id = substr($target_id, 9);
78 $target_id =~ s/\///g;
79 $target_id =~ s/\-//g;
80+
81+
82 print $fh "\t<id>" . $target_id . "</id>\n";
83 print $fh "\t<type>" . $self->getTargetType($target) . "</type>\n";
84
85@@ -179,35 +221,142 @@ sub printAttribute
86 # TODO RTC: TBD
87 # temporary until we converge attribute types
88 my %filter;
89- $filter{MRW_TYPE} = 1;
90- $filter{INSTANCE_PATH} = 1;
91- $filter{SYSTEM_NAME} = 1;
92- $filter{BUS_TYPE} = 1;
93- $filter{DIRECTION} = 1;
94- $filter{ENABLE_CAPI} = 1;
95- $filter{PCIE_CONFIG_NUM} = 1;
96- $filter{PCIE_LANE_MASK} = 1;
97- $filter{PCIE_LANE_SET} = 1;
98- $filter{PCIE_NUM_LANES} = 1;
99- $filter{PHB_NUM} = 1;
100- $filter{IOP_NUM} = 1;
101- $filter{LOCATION_CODE} = 1;
102- $filter{MCS_NUM} = 1;
103- $filter{SCHEMATIC_INTERFACE} = 1;
104- $filter{ENTITY_ID} = 1;
105- $filter{CLASS} = 1;
106- $filter{MODEL} = 1;
107- $filter{TYPE} = 1;
108- $filter{CDM_POLICIES} = 1;
109- $filter{CDM_POLICIES_BITMASK} = 1;
110- $filter{ENTITY_ID_LOOKUP} = 1;
111- $filter{ENTITY_INSTANCE} = 1;
112- $filter{MBA_NUM} = 1;
113- $filter{IPMI_NAME} = 1;
114- $filter{INSTANCE_ID} = 1;
115- $filter{IO_CONFIG_SELECT} = 1;
116- $filter{FRU_NAME} = 1;
117-
118+ $filter{MRW_TYPE} = 1;
119+ $filter{SYSTEM_NAME} = 1;
120+ $filter{BUS_TYPE} = 1;
121+ $filter{DIRECTION} = 1;
122+ $filter{ENABLE_CAPI} = 1;
123+ $filter{PCIE_CONFIG_NUM} = 1;
124+ $filter{PCIE_LANE_MASK} = 1;
125+ $filter{PCIE_LANE_SET} = 1;
126+ $filter{PCIE_NUM_LANES} = 1;
127+ $filter{PHB_NUM} = 1;
128+ $filter{IOP_NUM} = 1;
129+ $filter{LOCATION_CODE} = 1;
130+ $filter{LOCATION_CODE_TYPE} = 1;
131+ $filter{MCS_NUM} = 1;
132+ $filter{SCHEMATIC_INTERFACE} = 1;
133+ $filter{ENTITY_ID} = 1;
134+ $filter{CLASS} = 1;
135+ $filter{MODEL} = 1;
136+ $filter{TYPE} = 1;
137+ $filter{CDM_POLICIES} = 1;
138+ $filter{CDM_POLICIES_BITMASK} = 1;
139+ $filter{ENTITY_ID_LOOKUP} = 1;
140+ $filter{ENTITY_INSTANCE} = 1;
141+ $filter{MBA_NUM} = 1;
142+ $filter{IPMI_NAME} = 1;
143+ $filter{INSTANCE_ID} = 1;
144+ $filter{INSTANCE_PATH} = 1;
145+ $filter{IO_CONFIG_SELECT} = 1;
146+ $filter{FRU_NAME} = 1;
147+ $filter{TPM_BACKUP_INFO} = 1;
148+ $filter{TPM_PRIMARY_INFO} = 1;
149+ $filter{ALL_MCS_IN_INTERLEAVING_GROUP} = 1;
150+ $filter{AVERAGE_IPL_TIME} = 1;
151+ $filter{CHECK_SCRIPT} = 1;
152+ $filter{DMI_DFE_OVERRIDE} = 1;
153+ $filter{FREQ_A} = 1;
154+ $filter{FREQ_NEST_HFT} = 1;
155+ $filter{FREQ_PB} = 1;
156+ $filter{FREQ_PB_HFT} = 1;
157+ $filter{FREQ_PCIE} = 1;
158+ $filter{FREQ_X} = 1;
159+ $filter{FREQ_X_HFT} = 1;
160+ $filter{LED_ON_DEFAULT_GPIO_VALUE} = 1;
161+ $filter{LED_STRATEGY} = 1;
162+ $filter{MSS_MCA_HASH_MODE} = 1;
163+ $filter{MRW_ENHANCED_GROUPING_NO_MIRRORING} = 1;
164+ $filter{MRW_MEM_MIRRORING_ALLOWED} = 1;
165+ $filter{MRW_MEM_MIRRORING_ENABLE_DEFAULT} = 1;
166+ $filter{MRW_MEM_POWER_CONTROL_USAGE} = 1;
167+ $filter{MRW_VMEM_REGULATOR_MEMORY_POWER_LIMIT_PER_DIMM} = 1;
168+ $filter{MRW_VMEM_REGULATOR_MEMORY_POWER_LIMIT_PER_DIMM_DDR4} = 1;
169+ $filter{MRW_VMEM_REGULATOR_POWER_LIMIT_PER_DIMM_ADJ_ENABLE} = 1;
170+ $filter{MSS_VOLT_VDDR_OFFSET_DISABLE} = 1;
171+ $filter{OCC_LOAD_TIMEOUT} = 1;
172+ $filter{OCC_RESET_TIMEOUT} = 1;
173+ $filter{PCIE_DEFAULT_HDDW_SLOT_COUNT} = 1;
174+ $filter{PCIE_MIN_HDDW_SLOT_COUNT} = 1;
175+ $filter{PCIE_MAX_HDDW_SLOT_COUNT} = 1;
176+ $filter{REDUNDANT_FSPS} = 1;
177+ $filter{SYSTEM_MTM} = 1;
178+ $filter{PM_EXTERNAL_VRM_STEPSIZE} = 1;
179+ $filter{PM_EXTERNAL_VRM_STEPDELAY} = 1;
180+ $filter{PM_SPIPSS_FREQUENCY} = 1;
181+ $filter{PM_SYSTEM_IVRMS_ENABLED} = 1;
182+ $filter{NUMERIC_POD_TYPE_TEST} = 1;
183+ $filter{CARD_TYPE} = 1;
184+ $filter{PROC_PCIE_DSMP_CAPABLE} = 1;
185+ $filter{PROC_PCIE_IOP_CONFIG} = 1;
186+ $filter{PROC_PCIE_IOP_G2_PLL_CONTROL0} = 1;
187+ $filter{PROC_PCIE_IOP_G3_PLL_CONTROL0} = 1;
188+ $filter{PROC_PCIE_IOP_PCS_CONTROL0} = 1;
189+ $filter{PROC_PCIE_IOP_PCS_CONTROL1} = 1;
190+ $filter{PROC_PCIE_IOP_PLL_GLOBAL_CONTROL0} = 1;
191+ $filter{PROC_PCIE_IOP_PLL_GLOBAL_CONTROL1} = 1;
192+ $filter{PROC_PCIE_IOP_REVERSAL} = 1;
193+ $filter{PROC_PCIE_IOP_REVERSAL_BIFURCATED} = 1;
194+ $filter{PROC_PCIE_IOP_REVERSAL_NON_BIFURCATED} = 1;
195+ $filter{PROC_PCIE_IOP_RX_PEAK} = 1;
196+ $filter{PROC_PCIE_IOP_RX_SDL} = 1;
197+ $filter{PROC_PCIE_IOP_RX_VGA_CONTROL2} = 1;
198+ $filter{PROC_PCIE_IOP_TX_BWLOSS1} = 1;
199+ $filter{PROC_PCIE_IOP_TX_FFE_GEN1} = 1;
200+ $filter{PROC_PCIE_IOP_TX_FFE_GEN2} = 1;
201+ $filter{PROC_PCIE_IOP_TX_FIFO_OFFSET} = 1;
202+ $filter{PROC_PCIE_IOP_TX_RCVRDETCNTL} = 1;
203+ $filter{PROC_PCIE_IOP_ZCAL_CONTROL} = 1;
204+ $filter{NPU_MMIO_BAR_SIZE} = 1;
205+ $filter{NPU_MMIO_BAR_BASE_ADDR} = 1;
206+ $filter{PROC_PCIE_REFCLOCK_ENABLE} = 1;
207+ $filter{PSI_HB_ESP_ADDR} = 1;
208+ $filter{TPM_INFO} = 1;
209+ $filter{STANDBY_PLUGGABLE} = 1;
210+ $filter{CPM_INFLECTION_POINTS} = 1;
211+ $filter{PROC_FABRIC_X_ATTACHED_CHIP_CNFG} = 1;
212+ $filter{PROC_PCIE_HOTPLUG_DISABLE_ACTIONS} = 1;
213+ $filter{SYSTEM_RESCLK_VALUE} = 1;
214+ $filter{HWAS_STATE} = 1;
215+ $filter{PROC_MIRROR_SIZES} = 1;
216+ $filter{PROC_FABRIC_X_ADDR_DIS} = 1;
217+ $filter{PROC_PCIE_HOTPLUG_ENABLE_ACTIONS} = 1;
218+ $filter{PROC_FABRIC_A_ATTACHED_LINK_ID} = 1;
219+ $filter{PROC_MEM_BASES} = 1;
220+ $filter{UNIT_TEST_MCA_MEMORY_SIZES} = 1;
221+ $filter{SYSTEM_RESCLK_L3_VALUE} = 1;
222+ $filter{PROC_CHTM_BAR_SIZES} = 1;
223+ $filter{SYSTEM_RESCLK_FREQ_REGIONS} = 1;
224+ $filter{PROC_MIRROR_SIZES_ACK} = 1;
225+ $filter{PROC_FABRIC_X_ATTACHED_LINK_ID} = 1;
226+ $filter{PROC_FABRIC_A_ATTACHED_LINK_ID} = 1;
227+ $filter{PROC_FABRIC_A_ATTACHED_CHIP_ID} = 1;
228+ $filter{PROC_MEM_SIZES} = 1;
229+ $filter{PROC_FABRIC_OPTICS_CONFIG_MODE} = 1;
230+ $filter{PROC_PCIE_LANE_EQUALIZATION} = 1;
231+ $filter{HOT_PLUG_POWER_CONTROLLER_INFO} = 1;
232+ $filter{PROC_MEM_BASES_ACK} = 1;
233+ $filter{PROC_FABRIC_A_ATTACHED_CHIP_CNFG} = 1;
234+ $filter{CHTM_TRACE_TYPE} = 1;
235+ $filter{PROC_PCIE_NOT_F_LINK} = 1;
236+ $filter{PROC_FABRIC_X_ATTACHED_CHIP_ID} = 1;
237+ $filter{PROC_FABRIC_A_ADDR_DIS} = 1;
238+ $filter{MSS_MCS_GROUP_32} = 1;
239+ $filter{PROC_MIRROR_BASES_ACK} = 1;
240+ $filter{DELETE_AFFINITY_PATH} = 1;
241+ $filter{PROC_MIRROR_BASES} = 1;
242+ $filter{PROC_FABRIC_A_LINK_DELAY} = 1;
243+ $filter{PROC_MEM_SIZES_ACK} = 1;
244+ $filter{SYSTEM_RESCLK_FREQ_REGION_INDEX} = 1;
245+ $filter{PROC_FABRIC_X_LINK_DELAY} = 1;
246+ $filter{PROC_CHTM_BAR_BASE_ADDR} = 1;
247+ $filter{TOD_CPU_DATA} = 1;
248+ $filter{MSS_VOLT} = 1;
249+ $filter{EFF_READ_DBI} = 1;
250+ $filter{RU_TYPE} = 1;
251+ $filter{STANDBY_PLUGGABLE} = 1;
252+ $filter{MANUFACTURER} = 1;
253+ $filter{HWAS_STATE_CHANGED_SUBSCRIPTION_MASK} = 1;
254 if ($filter{$attribute} == 1)
255 {
256 return;
257@@ -313,6 +462,7 @@ sub buildHierarchy
258 {
259 $baseptr = $self->{xml}->{'targetInstances'}->{'targetInstance'};
260 }
261+
262 if ($target eq "")
263 {
264 ## find system target
265@@ -453,189 +603,441 @@ sub buildHierarchy
266 ## HOSTBOOT expected hierarchy: sys/node/proc/<unit>
267 ## sys/node/proc/mcs/membuf/<unit>
268 ## sys/node/proc/mcs/membuf/mba/dimm
269+## This function also sets the common attributes for all the targets
270+## Common attributes include:
271+## - FAPI_NAME
272+## - PHYS_PATH
273+## - AFFINITY_PATH
274+## - ORDINAL_ID
275+## - HUID
276
277 sub buildAffinity
278 {
279 my $self = shift;
280- my $node = -1;
281- my $tpm = -1;
282- my $proc = -1;
283- my $node_phys = "";
284- my $node_aff = "";
285- my $core_num = 0;
286+ my $node = -1;
287+ my $proc = -1;
288+ my $tpm = -1;
289+ my $sys_phys = "";
290+ my $node_phys = "";
291+ my $node_aff = "";
292+ my $sys_pos = -1;
293+ my $mcbist = -1;
294+
295 $self->{membuf_inst_num}=0;
296+
297 foreach my $target (sort keys %{ $self->{data}->{TARGETS} })
298 {
299 my $target_ptr = $self->{data}->{TARGETS}{$target};
300 my $type = $self->getType($target);
301 my $type_id = $self->getEnumValue("TYPE", $type);
302+ my $pos = $self->{data}->{TARGETS}{$target}{TARGET}{position};
303+ $sys_pos = $pos if ($type eq "SYS");
304+
305 if ($type_id eq "") { $type_id = 0; }
306
307 if ($type eq "SYS")
308 {
309 $proc = -1;
310 $node = -1;
311-
312 $self->{targeting}{SYS}[0]{KEY} = $target;
313- $self->setAttribute($target, "AFFINITY_PATH",
314- "affinity:".$self->{TOP_LEVEL});
315- $self->setAttribute($target, "PHYS_PATH",
316- "physical:".$self->{TOP_LEVEL});
317- $self->setAttribute($target, "ENTITY_INSTANCE","0");
318+
319+ #SYS target has PHYS_PATH and AFFINITY_PATH defined in the XML
320+ #Also, there is no HUID for SYS
321+ $self->setAttribute($target,"FAPI_NAME",getFapiName($type));
322+ $self->setAttribute($target,"FAPI_POS", $pos);
323+ $self->setAttribute($target,"ORDINAL_ID", $pos);
324+ $sys_phys = $self->getAttribute($target, "PHYS_PATH");
325+ $sys_phys = substr($sys_phys, 9);
326 }
327 elsif ($type eq "NODE")
328 {
329- $core_num = 0;
330- $proc = -1;
331- $self->{dimm_tpos} = 0;
332- $self->{membuf_inst_num}=0;
333+ $proc = -1;
334+ $self->{membuf_inst_num} = 0;
335 $node++;
336- $node_phys = "physical:".$self->{TOP_LEVEL}."/node-$node";
337- $node_aff = "affinity:".$self->{TOP_LEVEL}."/node-$node";
338+
339+ $node_phys = "physical:".$sys_phys."/node-$node";
340+ $node_aff = "affinity:".$sys_phys."/node-$node";
341+
342 $self->{targeting}{SYS}[0]{NODES}[$node]{KEY} = $target;
343- $self->setAttribute($target, "AFFINITY_PATH",
344- "affinity:".$self->{TOP_LEVEL}."/node-$node");
345- $self->setAttribute($target, "PHYS_PATH",
346- "physical:".$self->{TOP_LEVEL}."/node-$node");
347- $self->setHuid($target, 0, $node);
348- $self->setAttribute($target, "ENTITY_INSTANCE",$node);
349+
350+ $self->setHuid($target, $sys_pos, $node);
351+ $self->setAttribute($target, "FAPI_NAME",getFapiName($type));
352+ $self->setAttribute($target, "FAPI_POS", $pos);
353+ $self->setAttribute($target, "PHYS_PATH", $node_phys);
354+ $self->setAttribute($target, "AFFINITY_PATH", $node_aff);
355+ $self->setAttribute($target, "ORDINAL_ID", $pos);
356 }
357 elsif ($type eq "TPM")
358 {
359 $tpm++;
360+
361 $self->{targeting}{SYS}[0]{NODES}[$node]{TPMS}[$tpm]{KEY} = $target;
362- $self->setAttribute($target, "AFFINITY_PATH",
363- "affinity:".$self->{TOP_LEVEL}.
364- "/node-$node/tpm-$tpm");
365- $self->setAttribute($target, "PHYS_PATH",
366- "physical:".$self->{TOP_LEVEL}.
367- "/node-$node/tpm-$tpm");
368- $self->setHuid($target, 0, $tpm);
369- $self->setAttribute($target, "ENTITY_INSTANCE",$tpm);
370+
371+ my $tpm_phys = $node_phys . "/tpm-$tpm";
372+ my $tpm_aff = $node_aff . "/tpm-$tpm";
373+
374+
375+ $self->setHuid($target, $sys_pos, $tpm);
376+ $self->setAttribute($target, "FAPI_NAME",getFapiName($type));
377+ $self->setAttribute($target, "FAPI_POS", $pos);
378+ $self->setAttribute($target, "PHYS_PATH", $tpm_phys);
379+ $self->setAttribute($target, "AFFINITY_PATH", $tpm_aff);
380+ $self->setAttribute($target, "ORDINAL_ID", $pos);
381+ }
382+ elsif ($type eq "MCS")
383+ {
384+ $self->setAttribute($target, "VPD_REC_NUM", 0);
385+ $self->setAttribute($target, "MEMVPD_POS",
386+ $self->getAttribute($target, "CHIP_UNIT"));
387+ }
388+ elsif ($type eq "MCA")
389+ {
390+ my $ddrs = $self->findConnections($target,"DDR4","");
391+ $self->processDimms($ddrs, $sys_pos, $node_phys, $node, $proc);
392 }
393 elsif ($type eq "PROC")
394 {
395 $proc++;
396- my $num_mcs = 0;
397- ### count number of MCSs
398- foreach my $unit (@{ $self->{data}->{TARGETS}{$target}{CHILDREN} })
399- {
400- my $unit_type = $self->getType($unit);
401- if ($unit_type eq "MCS")
402- {
403- $num_mcs++;
404- }
405- }
406- if ($num_mcs > $self->{MAX_MCS})
407- {
408- $self->{MAX_MCS} = $num_mcs;
409- }
410+
411 $self->{NUM_PROCS_PER_NODE} = $proc + 1;
412+
413 $self->{targeting}->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{KEY} =
414- $target;
415-
416- $self->setHuid($target, 0, $node);
417- my $socket = $self->getTargetParent(
418- $self->getTargetParent($target));
419- my $parent_affinity = "affinity:".$self->{TOP_LEVEL}
420- ."/node-$node/proc-$proc";
421- my $parent_physical = "physical:".$self->{TOP_LEVEL}
422- ."/node-$node/proc-$proc";
423- $self->setAttribute($target, "AFFINITY_PATH", $parent_affinity);
424- $self->setAttribute($target, "PHYS_PATH", $parent_physical);
425- $self->setAttribute($target, "POSITION", $proc);
426- $self->setAttribute($target, "ENTITY_INSTANCE",$proc);
427+ $target;
428+
429+ my $socket=$self->getTargetParent($self->getTargetParent($target));
430+ my $parent_affinity = $node_aff . "/proc-$proc";
431+ my $parent_physical = $node_phys . "/proc-$proc";
432+
433+ my $fapi_name = getFapiName($type, $node, $proc);
434+
435+ $self->setHuid($target, $sys_pos, $node);
436+ $self->setAttribute($target, "FAPI_NAME", $fapi_name);
437+ $self->setAttribute($target, "PHYS_PATH", $parent_physical);
438+ $self->setAttribute($target, "AFFINITY_PATH", $parent_affinity);
439+ $self->setAttribute($target, "ORDINAL_ID", $pos);
440+ $self->setAttribute($target, "POSITION", $pos);
441+
442 $self->setAttribute($target, "FABRIC_GROUP_ID",
443 $self->getAttribute($socket,"FABRIC_GROUP_ID"));
444 $self->setAttribute($target, "FABRIC_CHIP_ID",
445 $self->getAttribute($socket,"FABRIC_CHIP_ID"));
446-
447 $self->setAttribute($target, "VPD_REC_NUM", $proc);
448
449+ $self->iterateOverChiplets($target, $sys_pos, $node, $proc);
450+ }
451+ }
452+}
453
454- foreach my $unit (@{ $self->{data}->{TARGETS}{$target}{CHILDREN} })
455- {
456- my $unit_ptr = $self->getTarget($unit);
457- my $unit_type = $self->getType($unit);
458- my $unit_type_id = $self->getEnumValue("TYPE", $unit_type);
459- if ( $unit_type_id eq "" || $unit_type eq "FSI"
460- || $unit_type eq "MCS")
461- {
462- $unit_type_id = 0;
463- }
464
465- ## don't want non-hostboot targets
466- if ($unit_type_id > 0)
467- {
468+sub iterateOverChiplets
469+{
470+ my $self = shift;
471+ my $target = shift;
472+ my $sys = shift;
473+ my $node = shift;
474+ my $proc = shift;
475+ my $tgt_ptr = $self->getTarget($target);
476+ my $tgt_type = $self->getType($target);
477
478- push(@{$self->{targeting}
479- ->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{$unit_type}},
480- { 'KEY' => $unit });
481- my $affinity_path =
482- $parent_affinity . "/"
483- . $self->getTarget($unit)->{TARGET}->{instance_name};
484- my $physical_path =
485- $parent_physical . "/"
486- . $self->getTarget($unit)->{TARGET}->{instance_name};
487- $self->setAttribute($unit, "AFFINITY_PATH",$affinity_path);
488- $self->setAttribute($unit, "PHYS_PATH", $physical_path);
489- $self->setHuid($unit, 0, $node);
490- if ($unit_type eq "OCC")
491- {
492- $self->setAttribute($unit, "ENTITY_INSTANCE",$proc);
493- }
494- ## export core
495- if ($unit_type eq "EX")
496- {
497- my $core_unit_num = $self->getAttribute($unit,
498- "CHIP_UNIT");
499-
500- my $core_unit =
501- $self->{data}->{TARGETS}{$unit}{CHILDREN}[0];
502- push(
503- @{
504- $self->{targeting}
505- ->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{CORE}
506- },
507- { 'KEY' => $core_unit }
508- );
509- my $core_affinity_path =
510- $affinity_path . "/"
511- . $self->getTarget($core_unit)->{TARGET}
512- ->{instance_name};
513- my $core_physical_path =
514- $physical_path . "/"
515- . $self->getTarget($core_unit)->{TARGET}
516- ->{instance_name};
517- $self->setAttribute($core_unit, "AFFINITY_PATH",
518- $core_affinity_path);
519- $self->setAttribute($core_unit, "PHYS_PATH",
520- $core_physical_path);
521- $self->setAttribute($core_unit, "CHIP_UNIT",
522- $core_unit_num);
523- $self->setHuid($core_unit, 0, $node);
524- $self->setAttribute($core_unit, "ENTITY_INSTANCE",
525- $core_num);
526- $core_num++;
527- }
528- }
529- elsif ($unit_type eq "MCS")
530- {
531- $self->processMcs($unit, $node, $proc, $parent_affinity,
532- $parent_physical, $node_phys);
533+ my $target_children = $self->getTargetChildren($target);
534+ my $prev_target = "PROC";
535
536- }
537+ if ($target_children eq "")
538+ {
539+ return "";
540+ }
541+ else
542+ {
543+ foreach my $child (@{ $self->getTargetChildren($target) })
544+ {
545+ my $unit_ptr = $self->getTarget($child);
546+ my $unit_type = $self->getType($child);
547+ #System XML has some sensor target as hidden children
548+ #of targets. We don't care for sensors in this function
549+ #So, we can avoid them with this conditional
550+ if ($unit_type ne "NA" && $unit_type ne "FSI" &&
551+ $unit_type ne "PCI")
552+ {
553+ #set common attrs for child
554+ $self->setCommonAttrForChiplet($child, $sys, $node, $proc);
555+ $self->iterateOverChiplets($child, $sys, $node, $proc);
556 }
557 }
558 }
559 }
560
561+sub setCommonAttrForChiplet
562+{
563+ my $self = shift;
564+ my $target = shift;
565+ my $sys = shift;
566+ my $node = shift;
567+ my $proc = shift;
568+
569+ my $tgt_ptr = $self->getTarget($target);
570+ my $tgt_type = $self->getType($target);
571+
572+ push(@{$self->{targeting}
573+ ->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{$tgt_type}},
574+ { 'KEY' => $target });
575+
576+ #This is a static variable. Persists over time
577+ #everything that is a grand_children of proc
578+ state %grand_children;
579+ if (not %grand_children)
580+ {
581+ $grand_children{"EX"} = 1;
582+ $grand_children{"CORE"} = 1;
583+ $grand_children{"MCS"} = 1;
584+ $grand_children{"MCA"} = 1;
585+ }
586+
587+ my $pos = $self->getAttribute($target, "CHIP_UNIT");
588+ my $unit_pos = $pos;
589+
590+ #HB expects chiplets' positions in AFFINITY_PATH to be relative to the
591+ #parent, serverwiz outputs it unique/absolute.
592+ #Since, in P9, each of the chiplets only have
593+ #up to two children (each eq has 2 ex, each ex has 2 cores, each mcbist has
594+ #two mcs, etc), we can simply calculate this by (absolute_Pos%2)
595+ #CHIP_UNIT is absolute position
596+ if ($grand_children{$tgt_type} eq 1)
597+ {
598+ $unit_pos = $pos%2;
599+ }
600+
601+ my $parent_affinity = $self->getAttribute(
602+ $self->getTargetParent($target),"AFFINITY_PATH");
603+ my $parent_physical = $self->getAttribute(
604+ $self->getTargetParent($target),"PHYS_PATH");
605+
606+ my $affinity_path = $parent_affinity . "/" . lc $tgt_type ."-". $unit_pos;
607+ my $physical_path = $parent_physical . "/" . lc $tgt_type ."-". $unit_pos;
608+
609+ my $fapi_name = getFapiName($tgt_type, $node, $proc, $pos);
610+
611+ $self->{huid_idx}->{$tgt_type} = $pos;
612+ $self->setHuid($target, $sys, $node);
613+ $self->setAttribute($target, "FAPI_NAME", $fapi_name);
614+ $self->setAttribute($target, "PHYS_PATH", $physical_path);
615+ $self->setAttribute($target, "AFFINITY_PATH", $affinity_path);
616+ $self->setAttribute($target, "ORDINAL_ID", $pos);
617+ $self->setAttribute($target, "FAPI_POS", $pos);
618+ $self->setAttribute($target, "REL_POS", $pos);
619+
620+ my $pervasive_parent= getPervasiveForUnit("$tgt_type$pos");
621+ if ($pervasive_parent ne "")
622+ {
623+ my $perv_parent_val =
624+ "physical:sys-$sys/node-$node/proc-$proc/perv-$pervasive_parent";
625+ $self->setAttribute($target, "PARENT_PERVASIVE", $perv_parent_val);
626+ }
627+}
628+
629+sub getFapiName
630+{
631+ my $target = shift;
632+ my $node = shift;
633+ my $chipPos = shift;
634+ my $chipletPos = shift;
635+
636+ if ($target eq "")
637+ {
638+ die "getFapiName: ERROR: Please specify a taget name\n";
639+ }
640+
641+ #This is a static variable. Persists over time
642+ state %nonFapiTargets;
643+ if (not %nonFapiTargets)
644+ {
645+ $nonFapiTargets{"NODE"} = "NA";
646+ $nonFapiTargets{"TPM"} = "NA";
647+ $nonFapiTargets{"NVBUS"} = "NA";
648+ $nonFapiTargets{"OCC"} = "NA";
649+ }
650+
651+ if ($nonFapiTargets{$target} eq "NA")
652+ {
653+ return $nonFapiTargets{$target};
654+ }
655+ elsif ($target eq "SYS")
656+ {
657+ return "k0";
658+ }
659+ elsif ($target eq "PROC" || $target eq "DIMM")
660+ {
661+ if ($node eq "" || $chipPos eq "")
662+ {
663+ die "getFapiName: ERROR: Must specify node and chipPos for $target
664+ current node: $node, chipPos: $chipPos\n";
665+ }
666+
667+ my $chip_name = ($target eq "PROC") ? "pu" : "dimm";
668+
669+ my $fapi_name = sprintf("%s:k0:n%d:s0:p%02d",$chip_name,$node,$chipPos);
670+ return $fapi_name;
671+ }
672+ else
673+ {
674+ if ($node eq "" || $chipPos eq "" || $chipletPos eq "")
675+ {
676+ die "getFapiName: ERROR: Must specify node, chipPos,
677+ chipletPos for $target. Current node: $node, chipPos: $chipPos
678+ chipletPos: $chipletPos\n";
679+ }
680+
681+ $target = lc $target;
682+ my $fapi_name = sprintf("pu.$target:k0:n%d:s0:p%02d:c%d",
683+ $node, $chipPos, $chipletPos);
684+ return $fapi_name;
685+ }
686+}
687+
688+sub getPervasiveForUnit
689+{
690+ # Input should be of the form <type><chip unit>, example: "core0"
691+ my ($unit) = @_;
692+
693+ # The mapping is a static variable that is preserved across new calls to
694+ # the function to speed up the mapping performance
695+ state %unitToPervasive;
696+
697+ if ( not %unitToPervasive )
698+ {
699+ for my $core (0..MAX_CORE_PER_PROC-1)
700+ {
701+ $unitToPervasive{"CORE$core"} = PERVASIVE_PARENT_CORE_OFFSET+$core;
702+ }
703+ for my $eq (0..MAX_EQ_PER_PROC-1)
704+ {
705+ $unitToPervasive{"EQ$eq"} = PERVASIVE_PARENT_EQ_OFFSET + $eq;
706+ }
707+ for my $xbus (0..MAX_XBUS_PER_PROC-1)
708+ {
709+ $unitToPervasive{"XBUS$xbus"} = PERVASIVE_PARENT_XBUS_OFFSET;
710+ }
711+ for my $obus (0..MAX_OBUS_PER_PROC-1)
712+ {
713+ $unitToPervasive{"OBUS$obus"} = PERVASIVE_PARENT_OBUS_OFFSET+$obus;
714+ }
715+ for my $capp (0..MAX_CAPP_PER_PROC-1)
716+ {
717+ $unitToPervasive{"CAPP$capp"} = 2 * ($capp+1);
718+ }
719+ for my $mcbist (0..MAX_MCBIST_PER_PROC-1)
720+ {
721+ $unitToPervasive{"MCBIST$mcbist"} =
722+ PERVASIVE_PARENT_MCBIST_OFFSET + $mcbist;
723+ }
724+ for my $mcs (0..MAX_MCS_PER_PROC-1)
725+ {
726+ $unitToPervasive{"MCS$mcs"} =
727+ PERVASIVE_PARENT_MCS_OFFSET + ($mcs > 1);
728+ }
729+ for my $mca (0..MAX_MCA_PER_PROC-1)
730+ {
731+ $unitToPervasive{"MCA$mca"} =
732+ PERVASIVE_PARENT_MCA_OFFSET + ($mca > 3);
733+ }
734+ for my $pec (0..MAX_PEC_PER_PROC-1)
735+ {
736+ $unitToPervasive{"PEC$pec"} =
737+ PERVASIVE_PARENT_PEC_OFFSET + $pec;
738+ }
739+ for my $phb (0..MAX_PHB_PER_PROC-1)
740+ {
741+ $unitToPervasive{"PHB$phb"} =
742+ PERVASIVE_PARENT_PHB_OFFSET + ($phb>0) + ($phb>2);
743+ }
744+ for my $nv (0..MAX_NV_PER_PROC-1)
745+ {
746+ $unitToPervasive{"NV$nv"} = PERVASIVE_PARENT_NV_OFFSET;
747+ }
748+ }
749+
750+ my $pervasive = "";
751+ if(exists $unitToPervasive{$unit})
752+ {
753+ $pervasive = $unitToPervasive{$unit};
754+ }
755+
756+ return $pervasive
757+}
758+sub processDimms
759+{
760+ my $self = shift;
761+ my $ddrs = shift;
762+ my $sys = shift;
763+ my $node_phys = shift;
764+ my $node = shift;
765+ my $proc = shift;
766+
767+ if ($ddrs ne "")
768+ {
769+ #There should be 2 Connections
770+ #Each MCA has 2 ddr channels
771+ foreach my $dimms (@{$ddrs->{CONN}})
772+ {
773+ my $ddr = $dimms->{SOURCE};
774+ my $port_num = $self->getAttribute($ddr,"MBA_PORT");
775+ my $dimm_num = $self->getAttribute($ddr,"MBA_DIMM");
776+ my $dimm=$dimms->{DEST_PARENT};
777+
778+ #proc->mcbist->mcs->mca->ddr
779+ my $mca_target = $self->getTargetParent($ddr);
780+ my $mcs_target = $self->getTargetParent($mca_target);
781+ my $mcbist_target = $self->getTargetParent($mcs_target);
782+ my $proc_target = $self->getTargetParent($mcbist_target);
783+ my $dimm_connector_tgt = $self->getTargetParent($dimm);
784+
785+ my $mca = $self->getAttribute($mca_target, "CHIP_UNIT");
786+ my $mcs = $self->getAttribute($mcs_target, "CHIP_UNIT");
787+ my $mcbist = $self->getAttribute($mcbist_target, "CHIP_UNIT");
788+ my $dimm_pos= $self->getAttribute($dimm_connector_tgt, "POSITION");
789+
790+ $dimm_pos = ($dimm_pos*2) + $port_num;
791+
792+ $self->setAttribute($dimm, "AFFINITY_PATH",
793+ $self->getAttribute($mcbist_target, "AFFINITY_PATH")
794+ . "/mcs-$mcs/mca-$mca/dimm-$port_num"
795+ );
796+
797+ $self->setAttribute($dimm, "PHYS_PATH",
798+ $node_phys . "/dimm-" . $dimm_pos);
799+
800+ my $type = $self->getType($dimm);
801+
802+ $self->setAttribute($dimm,"FAPI_NAME",
803+ getFapiName($type, $node, $dimm_pos));
804+
805+ $self->setAttribute($dimm, "FAPI_POS", $dimm_pos);
806+ $self->setAttribute($dimm, "ORDINAL_ID",$dimm_pos);
807+ $self->setAttribute($dimm, "POSITION", $dimm_pos);
808+ $self->setAttribute($dimm, "VPD_REC_NUM", $dimm_pos);
809+
810+ $self->{huid_idx}->{$type} = $dimm_pos;
811+ $self->setHuid($dimm, $sys, $node);
812+
813+ $self->{targeting}
814+ ->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{MCBISTS}[$mcbist]
815+ {MCSS}[$mcs]{MCAS}[$mca]{DIMMS}[$dimm_pos]{KEY}
816+ = $dimm;
817+ }
818+
819+ }
820+
821+}
822 sub processMcs
823 {
824+#@TODO RTC:163874
825+#Most of the nimmbus functionality is already in incorporated in other
826+#functions. Leaving this in as we may need this code for centaur/cumulus.
827+=begin
828 my $self = shift;
829 my $unit = shift;
830 my $node = shift;
831 my $proc = shift;
832+ my $mcbist = shift;
833 my $parent_affinity = shift;
834 my $parent_physical = shift;
835 my $node_phys = shift;
836@@ -646,12 +1048,12 @@ sub processMcs
837 $self->setAttribute($unit, "PHYS_PATH", $parent_physical . "/mcs-$mcs");
838 $self->setAttribute($unit, "MCS_NUM", $mcs);
839 $self->setHuid($unit, 0, $node);
840- $self->{targeting}->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{MCSS}[$mcs]{KEY} =
841- $unit;
842+ $self->{targeting}{SYS}[0]{NODES}[$node]{MCBISTS}{$mcbist}{MCSS}[$mcs]{KEY}
843+ = $unit;
844
845- $self->setAttribute($unit, "EI_BUS_TX_LANE_INVERT","0");
846- $self->setAttribute($unit, "EI_BUS_TX_MSBSWAP","0");
847- $self->setAttribute($unit, "DMI_REFCLOCK_SWIZZLE","0");
848+# $self->setAttribute($unit, "EI_BUS_TX_LANE_INVERT","0");
849+# $self->setAttribute($unit, "EI_BUS_TX_MSBSWAP","0");
850+# $self->setAttribute($unit, "DMI_REFCLOCK_SWIZZLE","0");
851
852 ## Find connected membufs
853 my $membuf_dmi = $self->{data}->{TARGETS}{$unit}{CONNECTION}{DEST}[0];
854@@ -719,7 +1121,8 @@ sub processMcs
855 $self->setHuid($child, 0, $node);
856 }
857
858- if ($self->getType($child) eq "MBA")
859+
860+ if ($self->getType($child) eq "MCA")
861 {
862 my $mba = $self->getAttribute($child,"MBA_NUM");
863 $self->setAttribute($child, "AFFINITY_PATH",
864@@ -732,9 +1135,10 @@ sub processMcs
865 {MBAS}[$mba]{KEY} = $child;
866
867 ## Trace the DDR busses to find connected DIMM
868- my $ddrs = $self->findConnections($child,"DDR3","");
869+ my $ddrs = $self->findConnections($child,"DDR4","");
870 if ($ddrs ne "")
871 {
872+
873 my $affinitypos=0;
874 foreach my $dimms (@{$ddrs->{CONN}})
875 {
876@@ -771,6 +1175,7 @@ sub processMcs
877 }
878 }
879 }
880+=cut
881 }
882
883 sub setFsiAttributes
884@@ -808,7 +1213,6 @@ sub setFsiAttributes
885 $self->setAttribute($target, "ALTFSI_MASTER_PORT", $fsi_port);
886 }
887
888- #my $phys_path = $targetObj->getAttribute($parentTarget, "PHYS_PATH");
889 $self->setAttributeField($target, "FSI_OPTION_FLAGS","flipPort",
890 $flip_port);
891 $self->setAttributeField($target, "FSI_OPTION_FLAGS","reserved", "0");
892@@ -928,10 +1332,10 @@ sub findConnections
893 my $target = shift;
894 my $bus_type = shift;
895 my $end_type = shift;
896-
897 my %connections;
898 my $num=0;
899 my $target_children = $self->getTargetChildren($target);
900+
901 if ($target_children eq "")
902 {
903 return "";
904@@ -949,6 +1353,7 @@ sub findConnections
905 my $type = $self->getMrwType($dest_parent);
906 my $dest_type = $self->getType($dest_parent);
907 my $dest_class = $self->getAttribute($dest_parent,"CLASS");
908+
909 if ($type eq "NA")
910 {
911 $type = $dest_type;
912@@ -1184,6 +1589,8 @@ sub setAttributeField
913 my $value = shift;
914 $self->{data}->{TARGETS}->{$target}->{ATTRIBUTES}->{$attribute}->{default}
915 ->{field}->{$field}->{value} = $value;
916+
917+ $self->log($target, "Setting Attribute: $attribute ($field) =$value");
918 }
919 ## returns complex attribute value
920 sub getAttributeField
921diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl
922index 6086371..f898500 100644
923--- a/src/usr/targeting/common/processMrw.pl
924+++ b/src/usr/targeting/common/processMrw.pl
925@@ -107,10 +107,6 @@ foreach my $target (sort keys %{ $targetObj->getAllTargets() })
926 {
927 processMembuf($targetObj, $target);
928 }
929- elsif ($type eq "FSP")
930- {
931- processBmc($targetObj, $target);
932- }
933 elsif ($type eq "APSS")
934 {
935 processApss($targetObj, $target);
936@@ -119,7 +115,6 @@ foreach my $target (sort keys %{ $targetObj->getAllTargets() })
937 processIpmiSensors($targetObj,$target);
938 }
939
940-
941 ## check topology
942 foreach my $n (keys %{$targetObj->{TOPOLOGY}}) {
943 foreach my $p (keys %{$targetObj->{TOPOLOGY}->{$n}}) {
944@@ -386,48 +381,29 @@ sub convertNegativeNumbers
945 $targetObj->setAttribute($target,$attribute,$new_offset)
946 }
947
948-sub processBmc
949-{
950- my $targetObj = shift;
951- my $target = shift;
952- my $i2cs=$targetObj->findConnections($target,"I2C","PROC");
953- if ($i2cs ne "")
954- {
955- foreach my $i2c (@{$i2cs->{CONN}})
956- {
957- my $addr=$targetObj->getBusAttribute(
958- $i2c->{SOURCE},$i2c->{BUS_NUM},"I2C_ADDRESS");
959- $targetObj->setAttribute(
960- $i2c->{DEST_PARENT},"I2C_SLAVE_ADDRESS",$addr);
961- }
962- }
963- my $lpcs=$targetObj->findConnections($target,"LPC","PROC");
964- if ($lpcs ne "")
965- {
966- my $lpc=$lpcs->{CONN}->[0];
967- $targetObj->setMasterProc($lpc->{DEST_PARENT});
968- }
969-}
970-
971-
972 sub parseBitwise
973 {
974 my $targetObj = shift;
975 my $target = shift;
976 my $attribute = shift;
977-
978 my $mask = 0;
979- foreach my $e (keys %{ $targetObj->getEnumHash($attribute) }) {
980- my $field = $targetObj->getAttributeField(
981- $target,$attribute."_BITMASK",$e);
982- my $val=hex($targetObj->getEnumValue($attribute,$e));
983- if ($field eq "true")
984+
985+ #if CDM_POLICIES_BITMASK is not a bad attribute, aka if it is defined
986+ if (!$targetObj->isBadAttribute($target, $attribute."_BITMASK"))
987+ {
988+ foreach my $e (keys %{ $targetObj->getEnumHash($attribute)})
989 {
990- $mask=$mask | $val;
991+ my $field = $targetObj->getAttributeField(
992+ $target,$attribute."_BITMASK",$e);
993+ my $val=hex($targetObj->getEnumValue($attribute,$e));
994+ if ($field eq "true")
995+ {
996+ $mask=$mask | $val;
997+ }
998 }
999+ $targetObj->setAttribute($target,$attribute,$mask);
1000 }
1001- $targetObj->setAttribute($target,$attribute,$mask);
1002- }
1003+}
1004 #--------------------------------------------------
1005 ## Processor
1006 ##
1007@@ -455,7 +431,10 @@ sub processProcessor
1008 foreach my $attr (sort (keys
1009 %{ $targetObj->getTarget($module_target)->{TARGET}->{attribute} }))
1010 {
1011- $targetObj->copyAttribute($module_target,$target,$attr);
1012+ if (($attr ne "TYPE") && ($attr ne "PHYS_PATH"))
1013+ {
1014+ $targetObj->copyAttribute($module_target,$target,$attr);
1015+ }
1016 }
1017
1018 ## Copy PCIE attributes from socket
1019@@ -473,11 +452,22 @@ sub processProcessor
1020 }
1021 }
1022
1023+ $targetObj->log($target,"Finding master proc");
1024+ my $lpcs=$targetObj->findConnections($target,"LPC","FSP");
1025+ if ($lpcs ne "")
1026+ {
1027+ $targetObj->log ($target, "Setting master proc to $target");
1028+ $targetObj->setMasterProc($target);
1029+ }
1030+
1031 $targetObj->log($target, "Processing PROC");
1032 foreach my $child (@{ $targetObj->getTargetChildren($target) })
1033 {
1034- $targetObj->log($target, "Processing PROC child: $child");
1035 my $child_type = $targetObj->getType($child);
1036+
1037+ $targetObj->log($target,
1038+ "Processing PROC child: $child Type: $child_type");
1039+
1040 if ($child_type eq "NA" || $child_type eq "FSI")
1041 {
1042 $child_type = $targetObj->getMrwType($child);
1043@@ -498,12 +488,13 @@ sub processProcessor
1044 {
1045 foreach my $pci_child (@{ $targetObj->getTargetChildren($child) })
1046 {
1047- processPcie($targetObj, $pci_child, $target);
1048+ #@TODO RTC:161404
1049+ #processPcie($targetObj, $pci_child, $target);
1050 }
1051 }
1052- elsif ($child_type eq "MCS")
1053+ elsif ($child_type eq "MCBIST")
1054 {
1055- processMcs($targetObj, $child, $target);
1056+ processMcbist($targetObj, $child, $target);
1057 }
1058 elsif ($child_type eq "OCC")
1059 {
1060@@ -589,10 +580,14 @@ sub processI2cSpeeds
1061 $i2c->{SOURCE},"I2C_ENGINE"));
1062 my $bus_speed=$targetObj->getBusAttribute(
1063 $i2c->{SOURCE},$i2c->{BUS_NUM},"I2C_SPEED");
1064+
1065+ #@todo RTC:164224 > currently the bus_speed fields are empty in the xml
1066+=begin
1067 if ($bus_speed eq "" || $bus_speed==0) {
1068 print "ERROR: I2C bus speed not defined for $i2c->{SOURCE}\n";
1069 $targetObj->myExit(3);
1070 }
1071+=cut
1072 ## choose lowest bus speed
1073 if ($bus_speeds[$engine][$port] eq "" ||
1074 $bus_speeds[$engine][$port]==0 ||
1075@@ -640,7 +635,7 @@ sub setupBars
1076 "NVIDIA_NPU_PRIVILEGED_ADDR","NVIDIA_NPU_USER_REG_ADDR",
1077 "NVIDIA_PHY0_REG_ADDR","NVIDIA_PHY1_REG_ADDR",
1078 "XIVE_CONTROLLER_BAR_ADDR","XIVE_PRESENTATION_BAR_ADDR",
1079- "PSI_HB_ESP_ADDR","NX_RNG_ADDR");
1080+ "NX_RNG_ADDR");
1081
1082 # Attribute only valid in naples-based systems
1083 if (!$targetObj->isBadAttribute($target,"NPU_MMIO_BAR_BASE_ADDR") ) {
1084@@ -689,26 +684,71 @@ sub processMcs
1085 my $targetObj = shift;
1086 my $target = shift;
1087 my $parentTarget = shift;
1088+ my $group = shift;
1089+ my $proc = shift;
1090+
1091+#@TODO RTC:163874 -- maybe needed for centaur support
1092+
1093+
1094+# my ($base,$group_offset,$proc_offset,$offset) = split(/,/,
1095+# $targetObj->getAttribute($target,"IBSCOM_MCS_BASE_ADDR"));
1096+# my $i_base = Math::BigInt->new($base);
1097+# my $i_node_offset = Math::BigInt->new($group_offset);
1098+# my $i_proc_offset = Math::BigInt->new($proc_offset);
1099+# my $i_offset = Math::BigInt->new($offset);
1100+
1101+# my $mcs = $targetObj->getAttribute($target, "MCS_NUM");
1102+# #Note: Hex convert method avoids overflow on 32bit machines
1103+# my $mcsStr=sprintf("0x%016s",substr((
1104+# $i_base+$i_node_offset*$group+
1105+# $i_proc_offset*$proc+$i_offset*$mcs)->as_hex(),2));
1106+# $targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr);
1107+}
1108+
1109+
1110+## MCBIST
1111+sub processMcbist
1112+{
1113+ my $targetObj = shift;
1114+ my $target = shift;
1115+ my $parentTarget = shift;
1116
1117 my $group = $targetObj->getAttribute($parentTarget, "FABRIC_GROUP_ID");
1118 my $proc = $targetObj->getAttribute($parentTarget, "FABRIC_CHIP_ID");
1119+#@TODO RTC:163874 -- maybe needed for centaur support
1120+# my ($base,$group_offset,$proc_offset,$offset) = split(/,/,
1121+# $targetObj->getAttribute($target,"IBSCOM_MCS_BASE_ADDR"));
1122+# my $i_base = Math::BigInt->new($base);
1123+# my $i_node_offset = Math::BigInt->new($group_offset);
1124+# my $i_proc_offset = Math::BigInt->new($proc_offset);
1125+# my $i_offset = Math::BigInt->new($offset);
1126
1127- my ($base,$group_offset,$proc_offset,$offset) = split(/,/,
1128- $targetObj->getAttribute($target,"IBSCOM_MCS_BASE_ADDR"));
1129- my $i_base = Math::BigInt->new($base);
1130- my $i_node_offset = Math::BigInt->new($group_offset);
1131- my $i_proc_offset = Math::BigInt->new($proc_offset);
1132- my $i_offset = Math::BigInt->new($offset);
1133-
1134- my $mcs = $targetObj->getAttribute($target, "MCS_NUM");
1135- #Note: Hex convert method avoids overflow on 32bit machines
1136- my $mcsStr=sprintf("0x%016s",substr((
1137- $i_base+$i_node_offset*$group+
1138- $i_proc_offset*$proc+$i_offset*$mcs)->as_hex(),2));
1139- $targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr);
1140-}
1141
1142+ foreach my $child (@{ $targetObj->getTargetChildren($target) })
1143+ {
1144+ my $child_type = $targetObj->getType($child);
1145+
1146+ $targetObj->log($target,
1147+ "Processing MCBIST child: $child Type: $child_type");
1148
1149+ if ($child_type eq "NA" || $child_type eq "FSI")
1150+ {
1151+ $child_type = $targetObj->getMrwType($child);
1152+ }
1153+ if ($child_type eq "MCS")
1154+ {
1155+ processMcs($targetObj, $child, $target, $group, $proc);
1156+ }
1157+ }
1158+
1159+#@TODO RTC:163874 -- maybe needed for centaur support
1160+# my $mcs = $targetObj->getAttribute($target, "MCS_NUM");
1161+# #Note: Hex convert method avoids overflow on 32bit machines
1162+# my $mcsStr=sprintf("0x%016s",substr((
1163+# $i_base+$i_node_offset*$group+
1164+# $i_proc_offset*$proc+$i_offset*$mcs)->as_hex(),2));
1165+# $targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr);
1166+}
1167 #--------------------------------------------------
1168 ## XBUS
1169 ##
1170@@ -1091,8 +1131,6 @@ sub processMembufVpdAssociation
1171 foreach my $group_assoc (@{$group_assocs->{CONN}}) {
1172 my $mb_target = $group_assoc->{DEST_PARENT};
1173 my $group_target = $targetObj->getTargetParent($mb_target);
1174- setEepromAttributes($targetObj,
1175- "EEPROM_VPD_PRIMARY_INFO",$group_target,$vpd);
1176 $targetObj->setAttribute($group_target,
1177 "VPD_REC_NUM",$targetObj->{vpd_num});
1178 }
1179@@ -1107,7 +1145,7 @@ sub processMembufVpdAssociation
1180 ## Finds I2C connections to DIMM and creates EEPROM attributes
1181 ## FYI: I had to handle DMI busses in framework because they
1182 ## define affinity path
1183-
1184+#@TODO RTC:163874 -- centaur support
1185 sub processMembuf
1186 {
1187 my $targetObj = shift;
1188@@ -1188,7 +1226,8 @@ sub processMembuf
1189 "MRW_MEM_SENSOR_CACHE_ADDR_MAP","0x".join("",@addr_map));
1190
1191 ## Update bus speeds
1192- processI2cSpeeds($targetObj,$target);
1193+ #@TODO RTC:163874 -- centaur support
1194+ #processI2cSpeeds($targetObj,$target);
1195
1196 ## Do MBA port mapping
1197 my %mba_port_map;
1198@@ -1307,11 +1346,9 @@ sub errorCheck
1199 ## also error checking after processing is complete vs during
1200 ## processing is easier
1201 my %attribute_checks = (
1202- SYS => ['SYSTEM_NAME','OPAL_MODEL'],
1203- PROC_MASTER => ['I2C_SLAVE_ADDRESS'],
1204- PROC => ['FSI_MASTER_CHIP','I2C_SLAVE_ADDRESS'],
1205- MEMBUF => [ 'PHYS_PATH', 'EI_BUS_TX_MSBSWAP', 'FSI_MASTER_PORT|0xFF' ],
1206- DIMM => ['EEPROM_VPD_PRIMARY_INFO/devAddr'],
1207+ SYS => ['SYSTEM_NAME'],#'OPAL_MODEL'],
1208+ PROC => ['FSI_MASTER_CHIP', 'EEPROM_VPD_PRIMARY_INFO/devAddr'],
1209+ MEMBUF => [ 'PHYS_PATH', 'EI_BUS_TX_MSBSWAP', 'FSI_MASTER_PORT|0xFF' ],
1210 );
1211 my %error_msg = (
1212 'EEPROM_VPD_PRIMARY_INFO/devAddr' =>
1213@@ -1321,14 +1358,9 @@ sub errorCheck
1214 'EI_BUS_TX_MSBSWAP' =>
1215 'DMI connection is missing to this membuf from processor',
1216 'PHYS_PATH' =>'DMI connection is missing to this membuf from processor',
1217- 'I2C_SLAVE_ADDRESS' =>'I2C connection is missing from BMC to processor',
1218 );
1219
1220 my @errors;
1221- if ($targetObj->getMasterProc() eq $target)
1222- {
1223- $type = "PROC_MASTER";
1224- }
1225 foreach my $attr (@{ $attribute_checks{$type} })
1226 {
1227 my ($a, $v) = split(/\|/, $attr);
1228diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
1229index b98d4e2..8f61774 100644
1230--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
1231+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
1232@@ -16333,7 +16333,7 @@ Measured in GB</description>
1233 <name>PD_AND_STR</name>
1234 <value>3</value>
1235 </enumerator>
1236- <default>NONE</default>
1237+ <default>OFF</default>
1238 </enumerationType>
1239
1240 <attribute>
1241diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
1242index 573a428..315fb65 100755
1243--- a/src/usr/targeting/common/xmltohb/target_types.xml
1244+++ b/src/usr/targeting/common/xmltohb/target_types.xml
1245@@ -527,6 +527,11 @@
1246 </targetType>
1247
1248 <targetType>
1249+ <id>lcard-dimm-ddr4</id>
1250+ <parent>lcard-dimm</parent>
1251+</targetType>
1252+
1253+<targetType>
1254 <id>occ</id>
1255 <parent>unit</parent>
1256 <attribute>
1257@@ -930,6 +935,7 @@
1258 <attribute><id>MRW_DDR4_VDDR_MAX_LIMIT_EFF_CONFIG</id></attribute>
1259 <attribute><id>HDAT_HBRT_NUM_SECTIONS</id></attribute>
1260 <attribute><id>HDAT_HBRT_SECTION_SIZE</id></attribute>
1261+ <attribute><id>VPD_REC_NUM</id></attribute>
1262 </targetType>
1263
1264 <!-- chip-tpm-cectpm -->
1265--
12661.8.2.2
1267