Skip to content

Commit 25a9857

Browse files
committed
Merge pull request #13 from rjknight/master
Update Targets.pm and target_types_mrw.xml
2 parents a7f9f3d + 04f15f3 commit 25a9857

File tree

5 files changed

+1531
-584
lines changed

5 files changed

+1531
-584
lines changed

scripts/Targets.pm

+3-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ sub new
5555
'4' => '7',
5656
'5' => '6'
5757
}
58-
# TODO RTC: TBD
58+
# TODO RTC:132549
5959
# DMI_FSI_MAP is a lookup table for DMI channel to FSI and ref clock.
6060
# It is processor specific and needs to be pulled from a
6161
# processor attribute instead of being hardcoded
@@ -190,18 +190,14 @@ sub printAttribute
190190
$filter{MODEL} = 1;
191191
$filter{TYPE} = 1;
192192
$filter{CDM_POLICIES} = 1;
193-
$filter{ALL_MCS_IN_INTERLEAVING_GROUP} = 1;
194-
$filter{MSS_INTERLEAVE_ENABLE} = 1;
195193
$filter{CDM_POLICIES_BITMASK} = 1;
196194
$filter{ENTITY_ID_LOOKUP} = 1;
197195
$filter{ENTITY_INSTANCE} = 1;
198196
$filter{MBA_NUM} = 1;
199-
$filter{IPMI_INSTANCE} = 1;
200-
$filter{FRU_NAME} = 1;
197+
$filter{IPMI_NAME} = 1;
201198
$filter{INSTANCE_ID} = 1;
202-
#$filter{ADC_CHANNEL_SENSOR_NUMBERS} = 1;
203199
$filter{IO_CONFIG_SELECT} = 1;
204-
#$filter{FRU_ID} = 1;
200+
$filter{FRU_NAME} = 1;
205201

206202
if ($filter{$attribute} == 1)
207203
{
@@ -590,8 +586,6 @@ sub processMcs
590586
$parent_affinity . "/mcs-$mcs/membuf-$membufnum");
591587
$self->setAttribute($membuf, "PHYS_PATH",
592588
$node_phys . "/membuf-$membufnum");
593-
# $self->setAttribute($membuf, "VPD_REC_NUM",
594-
# $self->getAttribute($membuf, "POSITION"));
595589

596590
## copy DMI bus attributes to membuf
597591
$self->setAttribute($unit, "EI_BUS_TX_LANE_INVERT",

scripts/processMrw.pl

+95-58
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,18 @@
7777
$targetObj->loadXML($serverwiz_file);
7878

7979

80+
my $str=sprintf(
81+
" %30s | %10s | %6s | %4s | %9s | %4s | %4s | %4s | %10s | %s\n",
82+
"Sensor Name","FRU Name","Ent ID","Type","Evt Type","ID","Inst","FRU",
83+
"HUID","Target");
8084

81-
my $str=sprintf(" %30s | %10s | %6s | %4s | %4s | %4s | %4s | %s\n",
82-
"Sensor Name","FRU Name","Ent ID","Type","ID","Inst","FRU","Target");
8385
$targetObj->writeReport($str);
84-
$str=sprintf(" %30s | %10s | %6s | %4s | %4s | %4s | %4s | %s\n",
85-
"------------------------------","----------",
86-
"------","----","----","----","----","----------");
86+
my $str=sprintf(
87+
" %30s | %10s | %6s | %4s | %9s | %4s | %4s | %4s | %10s | %s\n",
88+
"------------------------------","----------",
89+
"------","----","---------","----","----","----","----------",
90+
"----------");
91+
8792
$targetObj->writeReport($str);
8893
#--------------------------------------------------
8994
## loop through all targets and do stuff
@@ -202,6 +207,11 @@ sub processIpmiSensors {
202207
{
203208
$fru_id=$targetObj->getAttribute($target,"FRU_ID");
204209
}
210+
my $huid="";
211+
if (!$targetObj->isBadAttribute($target,"HUID"))
212+
{
213+
$huid=$targetObj->getAttribute($target,"HUID");
214+
}
205215
my @sensors;
206216

207217
foreach my $child (@{$targetObj->getTargetChildren($target)})
@@ -216,6 +226,9 @@ sub processIpmiSensors {
216226
getAttribute($child,"IPMI_SENSOR_NAME_SUFFIX");
217227
my $sensor_id=$targetObj->
218228
getAttribute($child,"IPMI_SENSOR_ID");
229+
my $sensor_evt=$targetObj->
230+
getAttribute($child,"IPMI_SENSOR_READING_TYPE");
231+
219232

220233
$name_suffix=~s/\n//g;
221234
$name_suffix=~s/\s+//g;
@@ -229,15 +242,17 @@ sub processIpmiSensors {
229242
my $s=sprintf("0x%02X%02X,0x%02X",
230243
oct($sensor_type),oct($entity_id),oct($sensor_id));
231244
push(@sensors,$s);
232-
my $sensor_id_str = "Err";
245+
my $sensor_id_str = "";
233246
if ($sensor_id ne "")
234247
{
235248
$sensor_id_str = sprintf("0x%02X",oct($sensor_id));
236249
}
237250
my $str=sprintf(
238-
" %30s | %10s | 0x%02X | 0x%02X | %4s | %4d | %4d | %s\n",
239-
$sensor_name,$name,oct($entity_id),oct($sensor_type),
240-
$sensor_id_str,$instance,$fru_id,$target);
251+
" %30s | %10s | 0x%02X | 0x%02X | 0x%02x |" .
252+
" %4s | %4d | %4d | %10s | %s\n",
253+
$sensor_name,$name,oct($entity_id),oct($sensor_type),
254+
oct($sensor_evt), $sensor_id_str,$instance,$fru_id,
255+
$huid,$target);
241256
$targetObj->writeReport($str);
242257
}
243258
}
@@ -273,6 +288,8 @@ sub processApss {
273288
getAttribute($child,"IPMI_SENSOR_NAME_SUFFIX");
274289
my $sensor_id=$targetObj->
275290
getAttribute($child,"IPMI_SENSOR_ID");
291+
my $sensor_evt=$targetObj->
292+
getAttribute($child,"IPMI_SENSOR_READING_TYPE");
276293
my $channel = $targetObj->
277294
getAttribute($child,"ADC_CHANNEL_ASSIGNMENT");
278295
my $channel_id = $targetObj->
@@ -288,7 +305,7 @@ sub processApss {
288305
$name=~s/\s+//g;
289306
$name=~s/\t+//g;
290307

291-
my $sensor_id_str = "Err";
308+
my $sensor_id_str = "";
292309
if ($sensor_id ne "")
293310
{
294311
$sensor_id_str = sprintf("0x%02X",oct($sensor_id));
@@ -301,14 +318,13 @@ sub processApss {
301318
$channel_offsets[$channel] = $channel_offset;
302319
$channel_gains[$channel] = $channel_gain;
303320
}
304-
else
305-
{
306-
$sensor_id_str="N/A";
307-
}
308321
my $str=sprintf(
309-
" %30s | %10s | 0x%02X | 0x%02X | %4s | %4d | %4d | %s\n",
322+
" %30s | %10s | 0x%02X | 0x%02X | 0x%02x |" .
323+
" %4s | %4d | %4d | %10s | %s\n",
310324
$name,"",oct($entity_id),oct($sensor_type),
311-
$sensor_id_str,$channel,"",$systemTarget);
325+
oct($sensor_evt),$sensor_id_str,$channel,"","",
326+
$systemTarget);
327+
312328
$targetObj->writeReport($str);
313329
}
314330
}
@@ -422,7 +438,6 @@ sub processProcessor
422438
my $target = shift;
423439

424440
#########################
425-
## Copy PCIE attributes from socket
426441
## In serverwiz, processor instances are not unique
427442
## because plugged into socket
428443
## so processor instance unique attributes are socket level.
@@ -431,6 +446,12 @@ sub processProcessor
431446
$targetObj->getTargetParent($targetObj->getTargetParent($target));
432447
$targetObj->copyAttribute($socket_target,$target,"LOCATION_CODE");
433448

449+
## Module attibutes are inherited into the proc target
450+
my $module_target =
451+
$targetObj->getTargetParent($target);
452+
$targetObj->copyAttribute($module_target,$target,"LOCATION_CODE");
453+
454+
## Copy PCIE attributes from socket
434455
foreach my $attr (sort (keys
435456
%{ $targetObj->getTarget($socket_target)->{TARGET}->{attribute} }))
436457
{
@@ -439,6 +460,14 @@ sub processProcessor
439460
$targetObj->copyAttribute($socket_target,$target,$attr);
440461
}
441462
}
463+
464+
## Copy all attributes from module
465+
foreach my $attr (sort (keys
466+
%{ $targetObj->getTarget($module_target)->{TARGET}->{attribute} }))
467+
{
468+
$targetObj->copyAttribute($module_target,$target,$attr);
469+
}
470+
442471
$targetObj->log($target, "Processing PROC");
443472
foreach my $child (@{ $targetObj->getTargetChildren($target) })
444473
{
@@ -508,7 +537,7 @@ sub processProcessor
508537
else
509538
{
510539
$targetObj->setAttribute($target, "PROC_MASTER_TYPE",
511-
"MASTER_CANDIDATE");
540+
"NOT_MASTER");
512541
}
513542
## Update bus speeds
514543
processI2cSpeeds($targetObj,$target);
@@ -588,6 +617,11 @@ sub setupBars
588617
"INTP_BASE_ADDR","PHB_BASE_ADDRS","PCI_BASE_ADDRS_32",
589618
"PCI_BASE_ADDRS_64","RNG_BASE_ADDR","IBSCOM_PROC_BASE_ADDR");
590619

620+
# Attribute only valid in naples-based systems
621+
if (!$targetObj->isBadAttribute($target,"NPU_MMIO_BAR_BASE_ADDR") ) {
622+
push(@bars,"NPU_MMIO_BAR_BASE_ADDR");
623+
}
624+
591625
foreach my $bar (@bars)
592626
{
593627
my ($num,$base,$node_offset,$proc_offset,$offset) = split(/,/,
@@ -606,8 +640,10 @@ sub setupBars
606640
{
607641
for (my $i=0;$i<$num;$i++)
608642
{
643+
#Note: Hex convert method avoids overflow on 32bit machine
609644
my $b=sprintf("0x%016s",substr((
610-
$i_base+$i_node_offset*$node+$i_proc_offset*$proc+$i_offset*$i)->as_hex(),2)); #Note: Hex convert method avoids overflow on 32bit machines.
645+
$i_base+$i_node_offset*$node+
646+
$i_proc_offset*$proc+$i_offset*$i)->as_hex(),2));
611647
my $sep=",";
612648
if ($i==$num-1)
613649
{
@@ -640,8 +676,10 @@ sub processMcs
640676
my $i_offset = Math::BigInt->new($offset);
641677

642678
my $mcs = $targetObj->getAttribute($target, "MCS_NUM");
679+
#Note: Hex convert method avoids overflow on 32bit machines
643680
my $mcsStr=sprintf("0x%016s",substr((
644-
$i_base+$i_node_offset*$node+$i_proc_offset*$proc+$i_offset*$mcs)->as_hex(),2)); #Note: Hex convert method avoids overflow on 32bit machines.
681+
$i_base+$i_node_offset*$node+
682+
$i_proc_offset*$proc+$i_offset*$mcs)->as_hex(),2));
645683
$targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr);
646684
}
647685

@@ -657,23 +695,23 @@ sub processXbus
657695
my $target = shift;
658696

659697
my $found_xbus = 0;
660-
698+
661699
my $xbus_child_conn = $targetObj->getFirstConnectionDestination($target);
662700
if ($xbus_child_conn ne "")
663701
{
664-
## set attributes for both directions
702+
## set attributes for both directions
665703
$targetObj->setAttribute($xbus_child_conn, "PEER_TARGET",
666-
$targetObj->getAttribute($target, "PHYS_PATH"));
704+
$targetObj->getAttribute($target, "PHYS_PATH"));
667705
$targetObj->setAttribute($target, "PEER_TARGET",
668-
$targetObj->getAttribute($xbus_child_conn, "PHYS_PATH"));
706+
$targetObj->getAttribute($xbus_child_conn, "PHYS_PATH"));
669707

670708
$targetObj->setAttribute($xbus_child_conn, "PEER_TARGET",
671-
$targetObj->getAttribute($target, "PHYS_PATH"));
709+
$targetObj->getAttribute($target, "PHYS_PATH"));
672710
$targetObj->setAttribute($target, "PEER_TARGET",
673-
$targetObj->getAttribute($xbus_child_conn, "PHYS_PATH"));
711+
$targetObj->getAttribute($xbus_child_conn, "PHYS_PATH"));
674712

675713
$found_xbus = 1;
676-
}
714+
}
677715

678716
}
679717

@@ -697,8 +735,6 @@ sub processAbus
697735
{
698736
$targetObj->setAttribute($target, "EI_BUS_TX_MSBSWAP","0");
699737
}
700-
# $targetObj->setAttribute($target, "PEER_TARGET","");
701-
702738
my $abus_child_conn = $targetObj->getFirstConnectionDestination($target);
703739
if ($abus_child_conn ne "")
704740
{
@@ -828,23 +864,23 @@ sub processPcie
828864
$iop_swap{0}{1}{'11'}=$t[7];
829865

830866
$iop_swap{1}{0}{'00'}=$t[8];
831-
$iop_swap{1}{0}{'01'}=$t[9];
832-
$iop_swap{1}{0}{'10'}=$t[10];
867+
$iop_swap{1}{0}{'10'}=$t[9];
868+
$iop_swap{1}{0}{'01'}=$t[10];
833869
$iop_swap{1}{0}{'11'}=$t[11];
834870
$iop_swap{1}{1}{'00'}=$t[12];
835871
$iop_swap{1}{1}{'10'}=$t[13];
836872
$iop_swap{1}{1}{'01'}=$t[14];
837873
$iop_swap{1}{1}{'11'}=$t[15];
838874

839-
$iop_swap{2}{0}{'00'}=$t[8];
840-
$iop_swap{2}{0}{'01'}=$t[9];
841-
$iop_swap{2}{0}{'10'}=$t[10];
842-
$iop_swap{2}{0}{'11'}=$t[11];
843-
$iop_swap{2}{1}{'00'}=$t[12];
844-
$iop_swap{2}{1}{'10'}=$t[13];
845-
$iop_swap{2}{1}{'01'}=$t[14];
846-
$iop_swap{2}{1}{'11'}=$t[15];
847875

876+
$iop_swap{2}{0}{'00'}=$t[16];
877+
$iop_swap{2}{0}{'01'}=$t[17];
878+
$iop_swap{2}{0}{'10'}=$t[18];
879+
$iop_swap{2}{0}{'11'}=$t[19];
880+
$iop_swap{2}{1}{'00'}=$t[20];
881+
$iop_swap{2}{1}{'10'}=$t[21];
882+
$iop_swap{2}{1}{'01'}=$t[22];
883+
$iop_swap{2}{1}{'11'}=$t[23];
848884

849885
my @lane_eq;
850886
my $NUM_PHBS=4;
@@ -940,30 +976,33 @@ sub processPcie
940976
die "PCIE config for $iop,$iop_lane_swap[$iop],$lane_rev not found\n";
941977
}
942978
}
943-
my $lane_swap_attr0 = sprintf("%s,%s,%s",$iop_lane_swap[0],
944-
$iop_lane_swap[1],$iop_lane_swap[2]);
945-
my $lane_swap_attr1 = sprintf("%s,0,%s,0,%s,0",$iop_lane_swap[0],
946-
$iop_lane_swap[1],$iop_lane_swap[2]);
979+
980+
my $lane_rev_attr0 = sprintf("%s,%s,%s",
981+
oct($iop_swap_lu[0]),
982+
oct($iop_swap_lu[1]),
983+
oct($iop_swap_lu[2]));
984+
my $lane_rev_attr1 = sprintf("%s,0,%s,0,%s,0",
985+
oct($iop_swap_lu[0]),
986+
oct($iop_swap_lu[1]),
987+
oct($iop_swap_lu[2]));
947988

948989
$targetObj->setAttribute($parentTarget, "PROC_PCIE_IOP_SWAP",
949-
$lane_swap_attr0);
990+
$lane_rev_attr0);
950991
$targetObj->setAttribute($parentTarget, "PROC_PCIE_IOP_SWAP_NON_BIFURCATED",
951-
$lane_swap_attr1);
992+
$lane_rev_attr1);
952993
$targetObj->setAttribute($parentTarget, "PROC_PCIE_IOP_SWAP_BIFURCATED",
953994
"0,0,0,0");
954-
955-
my $lane_rev_attr = sprintf("%s,0,%s,0,%s,0",
956-
oct($iop_swap_lu[0]),oct($iop_swap_lu[1]),oct($iop_swap_lu[2]));
957-
958995
$targetObj->setAttribute($parentTarget, "PROC_PCIE_IOP_REVERSAL",
959-
$lane_rev_attr);
996+
"0,0,0,0");
960997
$targetObj->setAttribute($parentTarget,
961-
"PROC_PCIE_IOP_REVERSAL_NON_BIFURCATED",$lane_rev_attr);
998+
"PROC_PCIE_IOP_REVERSAL_NON_BIFURCATED","0,0,0,0");
962999
$targetObj->setAttribute($parentTarget, "PROC_PCIE_IOP_REVERSAL_BIFURCATED",
9631000
"0,0,0,0");
9641001

965-
my $is_slot_attr = sprintf("%s,%s,%s,%s",
966-
$is_slot[0][0], $is_slot[0][1], $is_slot[1][0], $is_slot[1][1], $is_slot[2][0], $is_slot[2][1]);
1002+
my $is_slot_attr = sprintf("%s,%s,%s,%s,%s,%s",
1003+
$is_slot[0][0], $is_slot[0][1],
1004+
$is_slot[1][0], $is_slot[1][1],
1005+
$is_slot[2][0], $is_slot[2][1]);
9671006
$targetObj->setAttribute($parentTarget, "PROC_PCIE_IS_SLOT", $is_slot_attr);
9681007

9691008
## don't support DSMP
@@ -1012,7 +1051,6 @@ sub processMembufVpdAssociation
10121051
my $membuf_target = $membuf_assoc->{DEST_PARENT};
10131052
setEepromAttributes($targetObj,
10141053
"EEPROM_VPD_PRIMARY_INFO",$membuf_target,$vpd);
1015-
10161054
my $index = $targetObj->getBusAttribute($membuf_assoc->{SOURCE},
10171055
$membuf_assoc->{BUS_NUM}, "ISDIMM_MBVPD_INDEX");
10181056
$targetObj->setAttribute(
@@ -1032,7 +1070,6 @@ sub processMembufVpdAssociation
10321070
"EEPROM_VPD_PRIMARY_INFO",$node_target,$vpd);
10331071
$targetObj->setAttribute($node_target,
10341072
"VPD_REC_NUM",$targetObj->{vpd_num});
1035-
print ">>> $node_target,$targetObj->{vpd_num}\n";
10361073
}
10371074
}
10381075
$targetObj->{vpd_num}++;
@@ -1113,7 +1150,6 @@ sub processMembuf
11131150
setEepromAttributes($targetObj,
11141151
"EEPROM_VPD_PRIMARY_INFO",$dimm_target,
11151152
$dimm);
1116-
11171153
my $field=getI2cMapField($targetObj,$dimm_target,$dimm);
11181154
my $map = $dimm_portmap{$dimm_target};
11191155
if ($map eq "") {
@@ -1123,7 +1159,7 @@ sub processMembuf
11231159
$addr_map[$map] = $field;
11241160
}
11251161
}
1126-
$targetObj->setAttribute($targetObj->{targeting}->{SYS}[0]->{KEY},
1162+
$targetObj->setAttribute($target,
11271163
"MRW_MEM_SENSOR_CACHE_ADDR_MAP","0x".join("",@addr_map));
11281164

11291165
## Update bus speeds
@@ -1309,7 +1345,8 @@ sub errorCheck
13091345
}
13101346
else
13111347
{
1312-
$abus_error = sprintf("proc not connected to proc via Abus or Xbus (Target=%s)",$child);
1348+
$abus_error = sprintf(
1349+
"proc not connected to proc via Abus or Xbus (Target=%s)",$child);
13131350
}
13141351
}
13151352
}

0 commit comments

Comments
 (0)