diff options
author | Chen Du <duchen@us.ibm.com> | 2019-03-18 12:20:59 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-05-15 11:42:12 -0500 |
commit | bda479bb756377e5237ef8be451ad5db6073a11f (patch) | |
tree | 574fe70be6adca064d5c4976fc953ff5292bbb0e /src | |
parent | ca47ced07c4c49f25c3302d37871cdd14d1e4f7b (diff) | |
download | talos-hostboot-bda479bb756377e5237ef8be451ad5db6073a11f.tar.gz talos-hostboot-bda479bb756377e5237ef8be451ad5db6073a11f.zip |
MRW parsing updates for Axone+UB
Task 1: Deal with axone processor and its subunits
Code handles CHIPLET_ID correctly for new types OMI, OMIC, MCC
along with the OMIC_PARENT path. Code also removes any
instances of OMI with OMIC parent because we only want to
display OMI with MCC parent.
Change-Id: I101c6f5935ea2bb25ec47d7ae732f472bb0d0e39
RTC:172971
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73681
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matthew Raybuck <matthew.raybuck@ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/targeting/common/Targets.pm | 35 | ||||
-rwxr-xr-x | src/usr/targeting/common/processMrw.pl | 133 |
2 files changed, 166 insertions, 2 deletions
diff --git a/src/usr/targeting/common/Targets.pm b/src/usr/targeting/common/Targets.pm index aa1e07f7d..ffedb048f 100644 --- a/src/usr/targeting/common/Targets.pm +++ b/src/usr/targeting/common/Targets.pm @@ -223,9 +223,17 @@ sub printTarget return; } + my $target_TYPE = $self->getAttribute($target, "TYPE"); + + # Only allow OMI types with MCC parent + # OMIC_PARENT only exists on an OMI target with MCC parent + if ($target_TYPE eq "OMI" && !defined($target_ptr->{ATTRIBUTES}->{"OMIC_PARENT"}->{default})) + { + return; + } + print $fh "<targetInstance>\n"; my $target_id = $self->getAttribute($target, "PHYS_PATH"); - my $target_TYPE = $self->getAttribute($target, "TYPE"); $target_id = substr($target_id, 9); $target_id =~ s/\///g; $target_id =~ s/\-//g; @@ -643,6 +651,8 @@ sub buildAffinity my $tpm = -1; my $ucd = -1; my $bmc = -1; + my $mcc = -1; + my $omi = -1; my $sys_phys = ""; my $node_phys = ""; my $node_aff = ""; @@ -776,6 +786,29 @@ sub buildAffinity $self->deleteAttribute($target, "POSITION"); $self->deleteAttribute($target, "FRU_ID"); } + elsif ($type eq "MCC") + { + $mcc++; + + my $proc_num = ($mcc / 8) % 2; + my $mc_num = ($mcc / 4) % 2; + my $mi_num = ($mcc / 2) % 2; + my $mcc_num = ($mcc / 1) % 2; + my $mcc_aff = $node_aff . "/proc-$proc_num/mc-$mc_num/mi-$mi_num/mcc-$mcc_num"; + $self->setAttribute($target, "AFFINITY_PATH", $mcc_aff); + } + elsif ($type eq "OMI") + { + $omi++; + + my $proc_num = ($omi / 16) % 2; + my $mc_num = ($omi / 8) % 2; + my $mi_num = ($omi / 4) % 2; + my $mcc_num = ($omi / 2) % 2; + my $omi_num = ($omi / 1) % 2; + my $omi_aff = $node_aff . "/proc-$proc_num/mc-$mc_num/mi-$mi_num/mcc-$mcc_num/omi-$omi_num"; + $self->setAttribute($target, "AFFINITY_PATH", $omi_aff); + } elsif ($type eq "BMC") { $bmc++; diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl index 341574246..a507dc1a8 100755 --- a/src/usr/targeting/common/processMrw.pl +++ b/src/usr/targeting/common/processMrw.pl @@ -44,9 +44,44 @@ my $debug = 0; my $report = 0; my $sdr_file = ""; my $build = "hb"; -my $system_config = ""; +my $system_config = ""; my $output_filename = ""; +# Map for omi to omic parent +# OMI | OMIC +# -------------- +# 1 | 2 +# 2 | 1 +# 3 | 1 +# 4 | 0 +# 5 | 0 +# 6 | 0 +# 7 | 1 +# 8 | 2 +# 9 | 2 +# 10 | 1 +# 11 | 1 +# 12 | 0 +# 13 | 0 +# 14 | 0 +# 15 | 1 +my %omi_map = (4 => "physical:sys-0/node-0/proc-0/mc-0/omic-0", + 5 => "physical:sys-0/node-0/proc-0/mc-0/omic-0", + 6 => "physical:sys-0/node-0/proc-0/mc-0/omic-0", + 7 => "physical:sys-0/node-0/proc-0/mc-0/omic-1", + 2 => "physical:sys-0/node-0/proc-0/mc-0/omic-1", + 3 => "physical:sys-0/node-0/proc-0/mc-0/omic-1", + 0 => "physical:sys-0/node-0/proc-0/mc-0/omic-2", + 1 => "physical:sys-0/node-0/proc-0/mc-0/omic-2", + 12 => "physical:sys-0/node-0/proc-0/mc-1/omic-0", + 13 => "physical:sys-0/node-0/proc-0/mc-1/omic-0", + 14 => "physical:sys-0/node-0/proc-0/mc-1/omic-0", + 15 => "physical:sys-0/node-0/proc-0/mc-1/omic-1", + 10 => "physical:sys-0/node-0/proc-0/mc-1/omic-1", + 11 => "physical:sys-0/node-0/proc-0/mc-1/omic-1", + 8 => "physical:sys-0/node-0/proc-0/mc-1/omic-2", + 9 => "physical:sys-0/node-0/proc-0/mc-1/omic-2"); + # TODO RTC:170860 - Remove this after dimm connector defines VDDR_ID my $num_voltage_rails_per_proc = 1; @@ -1656,6 +1691,10 @@ sub processMc { processMi($targetObj, $child); } + elsif ($child_type eq "OMIC") + { + processOmic($targetObj, $child); + } } { @@ -1669,8 +1708,96 @@ sub processMc } } +#-------------------------------------------------- +## MCC +## +## +sub processMcc +{ + my $targetObj = shift; + my $target = shift; + + foreach my $child (@{ $targetObj->getTargetChildren($target) }) + { + my $child_type = $targetObj->getType($child); + + $targetObj->log($target, + "Processing MCC child: $child Type: $child_type"); + + if ($child_type eq "OMI") + { + processOmi($targetObj, $child); + } + } + + { + use integer; + # There are a total of four MCC units on an MC unit. So, to + # determine which MC an MCC belongs to, the CHIP_UNIT of the MCC can + # be divided by the number of units per MC to arrive at the correct + # offset to add to the pervasive MCC parent offset. + my $numberOfMccPerMc = 4; + my $chip_unit = $targetObj->getAttribute($target, "CHIP_UNIT"); + + my $value = sprintf("0x%x", + Targets::PERVASIVE_PARENT_MI_OFFSET + + ($chip_unit / $numberOfMccPerMc)); + + $targetObj->setAttribute( $target, "CHIPLET_ID", $value); + } +} #-------------------------------------------------- +## OMI +## +## +sub processOmi +{ + my $targetObj = shift; + my $target = shift; + + use integer; + # There are a total of eight OMI units on an MC unit. So, to + # determine which MC an OMI belongs to, the CHIP_UNIT of the OMI can + # be divided by the number of units per MC to arrive at the correct + # offset to add to the pervasive OMI parent offset. + my $numberOfOmiPerMc = 8; + my $chip_unit = $targetObj->getAttribute($target, "CHIP_UNIT"); + + my $value = sprintf("0x%x", + Targets::PERVASIVE_PARENT_MI_OFFSET + + ($chip_unit / $numberOfOmiPerMc)); + + $targetObj->setAttribute( $target, "CHIPLET_ID", $value); + + $value = $omi_map{$chip_unit}; + $targetObj->setAttribute( $target, "OMIC_PARENT", $value); +} + +#-------------------------------------------------- +## OMIC +## +## +sub processOmic +{ + my $targetObj = shift; + my $target = shift; + + use integer; + # There are a total of three OMIC units on an MC unit. So, to + # determine which MC an OMIC belongs to, the CHIP_UNIT of the OMIC can + # be divided by the number of units per MC to arrive at the correct + # offset to add to the pervasive OMIC parent offset. + my $numberOfOmicPerMc = 3; + my $chip_unit = $targetObj->getAttribute($target, "CHIP_UNIT"); + + my $value = sprintf("0x%x", + Targets::PERVASIVE_PARENT_MI_OFFSET + + ($chip_unit / $numberOfOmicPerMc)); + + $targetObj->setAttribute( $target, "CHIPLET_ID", $value); +} +#-------------------------------------------------- ## MI ## ## @@ -1690,6 +1817,10 @@ sub processMi { processDmi($targetObj, $child); } + elsif ($child_type eq "MCC") + { + processMcc($targetObj, $child); + } } { |