Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 1 | From 8f139eab659dc681e24a8c414dac00607a090fa0 Mon Sep 17 00:00:00 2001 |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 2 | From: Matt Ploetz <maploetz@us.ibm.com> |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 3 | Date: Mon, 16 Feb 2015 13:15:43 -0600 |
| 4 | Subject: [PATCH] New Serverwiz2 patches |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 5 | |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 6 | Change-Id: I4ba05d89e9ca0ef3298c0f9d503f349782632d89 |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 7 | --- |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 8 | src/build/mkrules/dist.targets.mk | 3 +- |
| 9 | src/usr/targeting/common/Targets.pm | 24 ++--- |
| 10 | src/usr/targeting/common/processMrw.pl | 171 ++++++++++++++------------------- |
| 11 | 3 files changed, 88 insertions(+), 110 deletions(-) |
| 12 | mode change 100644 => 100755 src/usr/targeting/common/Targets.pm |
| 13 | mode change 100644 => 100755 src/usr/targeting/common/processMrw.pl |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 14 | |
| 15 | diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 16 | index ca28150..4b541ce 100644 |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 17 | --- a/src/build/mkrules/dist.targets.mk |
| 18 | +++ b/src/build/mkrules/dist.targets.mk |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 19 | @@ -74,7 +74,8 @@ COPY_FILES = \ |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 20 | src/usr/hwpf/hwp/initfiles/sample.initfile:tools \ |
| 21 | src/build/buildpnor/buildSbePart.pl:openpower \ |
| 22 | src/build/buildpnor/buildpnor.pl:openpower \ |
| 23 | - src/usr/targeting/common/genHwsvMrwXml.pl:openpower \ |
| 24 | + src/usr/targeting/common/processMrw.pl:openpower \ |
| 25 | + src/usr/targeting/common/Targets.pm:openpower \ |
| 26 | src/usr/targeting/common/xmltohb/mergexml.sh:openpower \ |
| 27 | src/usr/targeting/common/xmltohb/attribute_types.xml:openpower \ |
| 28 | src/usr/targeting/common/xmltohb/attribute_types_hb.xml:openpower \ |
| 29 | diff --git a/src/usr/targeting/common/Targets.pm b/src/usr/targeting/common/Targets.pm |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 30 | old mode 100644 |
| 31 | new mode 100755 |
| 32 | index d4c2bfa..53568cf |
| 33 | --- a/src/usr/targeting/common/Targets.pm |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 34 | +++ b/src/usr/targeting/common/Targets.pm |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 35 | @@ -194,6 +194,7 @@ sub printAttribute |
| 36 | $filter{MBA_NUM} = 1; |
| 37 | $filter{IPMI_INSTANCE} = 1; |
| 38 | $filter{INSTANCE_ID} = 1; |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 39 | + $filter{ADC_CHANNEL_SENSOR_NUMBERS} = 1; |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 40 | |
| 41 | if ($filter{$attribute} == 1) |
| 42 | { |
| 43 | @@ -286,7 +287,7 @@ sub buildHierarchy |
| 44 | $self->{data}->{INSTANCE_PATH} = $old_path . "/" . $target; |
| 45 | |
| 46 | ## copy attributes |
| 47 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 48 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 49 | foreach my $attribute (keys %{ $target_xml->{attribute} }) |
| 50 | { |
| 51 | my $value = $target_xml->{attribute}->{$attribute}->{default}; |
| 52 | @@ -317,7 +318,7 @@ sub buildHierarchy |
| 53 | $self->setAttribute($key, $attribute, $value); |
| 54 | } |
| 55 | } |
| 56 | - ## global attributes overwrite local |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 57 | + ## global attributes overwrite local |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 58 | foreach my $prop (keys %{$self->{xml}->{globalSetting}->{$key}->{property}}) |
| 59 | { |
| 60 | my $val=$self->{xml}->{globalSetting}->{$key}->{property}-> |
| 61 | @@ -400,7 +401,7 @@ sub buildAffinity |
| 62 | { |
| 63 | $proc = -1; |
| 64 | $node = -1; |
| 65 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 66 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 67 | $self->{targeting}{SYS}[0]{KEY} = $target; |
| 68 | $self->setAttribute($target, "AFFINITY_PATH", "affinity:sys-0"); |
| 69 | $self->setAttribute($target, "PHYS_PATH", "physical:sys-0"); |
| 70 | @@ -443,7 +444,7 @@ sub buildAffinity |
| 71 | $self->{NUM_PROCS_PER_NODE} = $proc + 1; |
| 72 | $self->{targeting}->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{KEY} = |
| 73 | $target; |
| 74 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 75 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 76 | $self->setHuid($target, 0, $node); |
| 77 | my $socket = $self->getTargetParent( |
| 78 | $self->getTargetParent($target)); |
| 79 | @@ -475,7 +476,7 @@ sub buildAffinity |
| 80 | ## don't want non-hostboot targets |
| 81 | if ($unit_type_id > 0) |
| 82 | { |
| 83 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 84 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 85 | push(@{$self->{targeting} |
| 86 | ->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{$unit_type}}, |
| 87 | { 'KEY' => $unit }); |
| 88 | @@ -490,7 +491,7 @@ sub buildAffinity |
| 89 | $self->setHuid($unit, 0, $node); |
| 90 | if ($unit_type eq "OCC") |
| 91 | { |
| 92 | - $self->setAttribute($unit, "ENTITY_INSTANCE",$proc); |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 93 | + $self->setAttribute($unit, "ENTITY_INSTANCE",$proc); |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 94 | } |
| 95 | ## export core |
| 96 | if ($unit_type eq "EX") |
| 97 | @@ -610,9 +611,9 @@ sub processMcs |
| 98 | $self->{targeting} |
| 99 | ->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{MCSS}[$mcs] {MEMBUFS}[0]{KEY} = |
| 100 | $membuf; |
| 101 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 102 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 103 | $self->setAttribute($membuf, "ENTITY_INSTANCE", |
| 104 | - $self->{membuf_inst_num}); |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 105 | + $self->{membuf_inst_num}); |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 106 | $self->{membuf_inst_num}++; |
| 107 | ## get the mbas |
| 108 | foreach my $child (@{ $self->{data}->{TARGETS}{$membuf}{CHILDREN} }) |
| 109 | @@ -629,7 +630,7 @@ sub processMcs |
| 110 | $node_phys . "/membuf-$membufnum/l4-0"); |
| 111 | $self->setHuid($child, 0, $node); |
| 112 | } |
| 113 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 114 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 115 | if ($self->getType($child) eq "MBA") |
| 116 | { |
| 117 | my $mba = $self->getAttribute($child,"MBA_NUM"); |
| 118 | @@ -671,10 +672,9 @@ sub processMcs |
| 119 | $self->setHuid($dimm, 0, $node); |
| 120 | $self->{targeting} |
| 121 | ->{SYS}[0]{NODES}[$node]{PROCS}[$proc] {MCSS}[$mcs] |
| 122 | - {MEMBUFS}[0]{MBAS}[$mba]{DIMMS}[$affinitypos]{KEY} |
| 123 | - = $dimm; |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 124 | + {MEMBUFS}[0]{MBAS}[$mba] {DIMMS}[$affinitypos]{KEY} = $dimm; |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 125 | $self->setAttribute($dimm, "ENTITY_INSTANCE", |
| 126 | - $self->{dimm_tpos}); |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 127 | + $self->{dimm_tpos}); |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 128 | $self->{dimm_tpos}++; |
| 129 | $affinitypos++; |
| 130 | } |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 131 | diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 132 | old mode 100644 |
| 133 | new mode 100755 |
| 134 | index 18107df..1fb292f |
| 135 | --- a/src/usr/targeting/common/processMrw.pl |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 136 | +++ b/src/usr/targeting/common/processMrw.pl |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 137 | @@ -84,7 +84,7 @@ foreach my $target (sort keys %{ $targetObj->getAllTargets() }) |
| 138 | if ($type eq "SYS") |
| 139 | { |
| 140 | processSystem($targetObj, $target); |
| 141 | - } |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 142 | + } |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 143 | elsif ($type eq "PROC") |
| 144 | { |
| 145 | processProcessor($targetObj, $target); |
| 146 | @@ -141,7 +141,7 @@ if ($report) |
| 147 | { |
| 148 | my $report_file = $xmldir . "/" . $targetObj->getSystemName() . ".rpt"; |
| 149 | open(SUM,">$report_file") || die "Unable to create: $report_file\n"; |
| 150 | - my $ref = $targetObj->{targeting}->{SYS}[0]{NODES}[0]{PROCS}; |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 151 | + my $ref = $targetObj->{targeting}->{SYS}[0]{NODES}[0]{PROCS}; |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 152 | foreach my $proc (@{$ref}) |
| 153 | { |
| 154 | foreach my $mcs (@{$proc->{MCSS}}) |
| 155 | @@ -149,7 +149,7 @@ if ($report) |
| 156 | my $mcs_target = $mcs->{KEY}; |
| 157 | my $membuf=$mcs->{MEMBUFS}[0]; |
| 158 | my $membuf_target = $membuf->{KEY}; |
| 159 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 160 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 161 | my $sch = $targetObj->getAttribute($mcs_target, |
| 162 | "SCHEMATIC_INTERFACE"); |
| 163 | my $aff = $targetObj->getAttribute($mcs_target,"AFFINITY_PATH"); |
| 164 | @@ -158,7 +158,7 @@ if ($report) |
| 165 | if ($membuf_target ne "") { |
| 166 | foreach my $mba (@{$membuf->{MBAS}}) { |
| 167 | my $mba_target = $mba->{KEY}; |
| 168 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 169 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 170 | $huid = $targetObj->getAttribute($mba_target,"HUID"); |
| 171 | $aff = $targetObj->getAttribute($mcs_target, |
| 172 | "AFFINITY_PATH"); |
| 173 | @@ -177,7 +177,7 @@ if ($report) |
| 174 | my $sens = $targetObj->getAttribute($dimm_target, |
| 175 | "IPMI_SENSORS"); |
| 176 | my @s = split(/\,/,$sens); |
| 177 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 178 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 179 | print SUM "\t\t$huid | $dimm_target". |
| 180 | " | $aff | $p | $d | $i2c | ". |
| 181 | "$s[0],$s[1] | $s[2],$s[3]\n"; |
| 182 | @@ -194,82 +194,6 @@ if ($report) |
| 183 | ## Processing subroutines |
| 184 | |
| 185 | #-------------------------------------------------- |
| 186 | -## SDRs |
| 187 | -## |
| 188 | - |
| 189 | -sub processSdr |
| 190 | -{ |
| 191 | - my $targetObj = shift; |
| 192 | - my $target = shift; |
| 193 | - my $sdrObj = shift; |
| 194 | - |
| 195 | - my @ipmi_sensors; |
| 196 | - my %id_lu; |
| 197 | - |
| 198 | - if ($targetObj->isBadAttribute($target,"ENTITY_ID_LOOKUP")==1) |
| 199 | - { |
| 200 | - return; |
| 201 | - } |
| 202 | - my $entity_id_lookup = $targetObj->getAttribute($target,"ENTITY_ID_LOOKUP"); |
| 203 | - if ($entity_id_lookup ne "") { |
| 204 | - my $pos=0; |
| 205 | - if ($targetObj->isBadAttribute($target,"IPMI_INSTANCE")==1) |
| 206 | - { |
| 207 | - $pos = $targetObj->getAttribute($target,"ENTITY_INSTANCE"); |
| 208 | - } |
| 209 | - else |
| 210 | - { |
| 211 | - $pos = $targetObj->getAttribute($target,"IPMI_INSTANCE"); |
| 212 | - } |
| 213 | - print "$entity_id_lookup,$pos\n"; |
| 214 | - my @ids = split(/,/,$entity_id_lookup); |
| 215 | - foreach my $i (@ids) |
| 216 | - { |
| 217 | - my $i_int = oct($i); |
| 218 | - if ($i_int>0) |
| 219 | - { |
| 220 | - $id_lu{$i_int}=1; |
| 221 | - } |
| 222 | - } |
| 223 | - foreach my $s (@{$sdrObj->{data}}) |
| 224 | - { |
| 225 | - my $sdr_entity_id = oct($s->{entity_id}); |
| 226 | - if ($s->{name}=~/Core/) { |
| 227 | - $sdr_entity_id=208; |
| 228 | - } |
| 229 | - if ($id_lu{$sdr_entity_id}>0) |
| 230 | - { |
| 231 | - my $sensor_id=$s->{sensor_id}; |
| 232 | - my $instance_id=oct($s->{entity_instance}); |
| 233 | - my $sensor_type=oct($s->{sensor_type}); |
| 234 | - if ($instance_id==$pos) |
| 235 | - { |
| 236 | - print "IMPORTING: $target; pos=$pos; entity_id=". |
| 237 | - "$sdr_entity_id; ". |
| 238 | - "sensor_id=$sensor_id; sensor_type=$sensor_type\n"; |
| 239 | - my $eid=sprintf("0x%02x%02x",$sensor_type,$sdr_entity_id); |
| 240 | - my $sid=sprintf("0x%02x",$s->{sensor_id}); |
| 241 | - push(@ipmi_sensors,$eid.",".$sid); |
| 242 | - $id_lu{$sdr_entity_id}++; |
| 243 | - } |
| 244 | - } |
| 245 | - } |
| 246 | - foreach my $k (keys(%id_lu)) { |
| 247 | - if ($id_lu{$k}==1) |
| 248 | - { |
| 249 | - print "WARNING: $target; pos=$pos; entity_id=$k; ". |
| 250 | - "not imported\n"; |
| 251 | - #$targetObj->myExit(3); |
| 252 | - } |
| 253 | - } |
| 254 | - for (my $i=@ipmi_sensors;$i<16;$i++) |
| 255 | - { |
| 256 | - push(@ipmi_sensors,"0xFFFF,0xFF"); |
| 257 | - } |
| 258 | - my $ipmi = join(',',@ipmi_sensors); |
| 259 | - $targetObj->setAttribute($target,"IPMI_SENSORS",$ipmi); |
| 260 | - } |
| 261 | -} |
| 262 | |
| 263 | #-------------------------------------------------- |
| 264 | ## System |
| 265 | @@ -347,7 +271,7 @@ sub processProcessor |
| 266 | $targetObj->getTargetParent($targetObj->getTargetParent($target)); |
| 267 | $targetObj->copyAttribute($socket_target,$target,"LOCATION_CODE"); |
| 268 | $targetObj->copyAttribute($socket_target,$target,"FRU_ID"); |
| 269 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 270 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 271 | |
| 272 | foreach my $attr (sort (keys |
| 273 | %{ $targetObj->getTarget($socket_target)->{TARGET}->{attribute} })) |
| 274 | @@ -529,7 +453,7 @@ sub setupBars |
| 275 | my $b=sprintf("0x%016X", |
| 276 | $i_base+$i_node_offset*$node+$i_proc_offset*$proc+$i_offset*$i); |
| 277 | my $sep=","; |
| 278 | - if ($i==$num-1) |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 279 | + if ($i==$num-1) |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 280 | { |
| 281 | $sep=""; |
| 282 | } |
| 283 | @@ -560,7 +484,7 @@ sub processMcs |
| 284 | my $i_offset = Math::BigInt->new($offset); |
| 285 | |
| 286 | my $mcs = $targetObj->getAttribute($target, "MCS_NUM"); |
| 287 | - my $mcsStr=sprintf("0x%016X", |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 288 | + my $mcsStr=sprintf("0x%016X", |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 289 | $i_base+$i_node_offset*$node+$i_proc_offset*$proc+$i_offset*$mcs); |
| 290 | $targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr); |
| 291 | } |
| 292 | @@ -577,7 +501,7 @@ sub processXbus |
| 293 | my $target = shift; |
| 294 | |
| 295 | # $targetObj->setAttribute($target, "PEER_TARGET",""); |
| 296 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 297 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | #-------------------------------------------------- |
| 301 | @@ -595,7 +519,7 @@ sub processAbus |
| 302 | $targetObj->setAttribute($target, "EI_BUS_TX_LANE_INVERT","0"); |
| 303 | $targetObj->setAttribute($target, "EI_BUS_TX_MSBSWAP","0"); |
| 304 | # $targetObj->setAttribute($target, "PEER_TARGET",""); |
| 305 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 306 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 307 | my $abus_child_conn = $targetObj->getFirstConnectionDestination($target); |
| 308 | if ($abus_child_conn ne "") |
| 309 | { |
| 310 | @@ -785,14 +709,12 @@ sub processPcie |
| 311 | { |
| 312 | for (my $lane=0;$lane<16;$lane++) |
| 313 | { |
| 314 | - $equalization[$phb_num][$lane]=$eqs[$e+1].",". |
| 315 | - $eqs[$e+2]; |
| 316 | - } |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 317 | + $equalization[$phb_num][$lane]=$eqs[$e+1].",".$eqs[$e+2]; |
| 318 | + } |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 319 | } |
| 320 | else |
| 321 | { |
| 322 | - $equalization[$phb_num][$eqs[$e]] = $eqs[$e+1].",". |
| 323 | - $eqs[$e+2]; |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 324 | + $equalization[$phb_num][$eqs[$e]] = $eqs[$e+1].",".$eqs[$e+2]; |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 325 | } |
| 326 | } |
| 327 | substr($phb_config, $phb_num, 1, "1"); |
| 328 | @@ -886,7 +808,7 @@ sub processMembufVpdAssociation |
| 329 | { |
| 330 | my $targetObj = shift; |
| 331 | my $target = shift; |
| 332 | - |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 333 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 334 | my $vpds=$targetObj->findConnections($target,"I2C","VPD"); |
| 335 | if ($vpds ne "" ) { |
| 336 | my $vpd = $vpds->{CONN}->[0]; |
| 337 | @@ -899,7 +821,7 @@ sub processMembufVpdAssociation |
| 338 | setEepromAttributes($targetObj, |
| 339 | "EEPROM_VPD_PRIMARY_INFO",$membuf_target,$vpd); |
| 340 | setEepromAttributes($targetObj, |
| 341 | - "EEPROM_VPD_FRU_INFO",$membuf_target,$vpd,"0++"); |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 342 | + "EEPROM_VPD_FRU_INFO",$membuf_target,$vpd,"0++"); |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 343 | my $index = $targetObj->getBusAttribute($membuf_assoc->{SOURCE}, |
| 344 | $membuf_assoc->{BUS_NUM}, "ISDIMM_MBVPD_INDEX"); |
| 345 | $targetObj->setAttribute( |
| 346 | @@ -920,8 +842,8 @@ sub processMembuf |
| 347 | { |
| 348 | my $targetObj = shift; |
| 349 | my $target = shift; |
| 350 | - if ($targetObj->isBadAttribute($target, "PHYS_PATH", "")) |
| 351 | - { |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 352 | + if ($targetObj->isBadAttribute($target, "PHYS_PATH", "")) |
| 353 | + { |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 354 | ##dmi is probably not connected. will get caught in error checking |
| 355 | return; |
| 356 | } |
| 357 | @@ -949,7 +871,33 @@ sub processMembuf |
| 358 | } |
| 359 | } |
| 360 | } |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 361 | + ## find port mapping |
| 362 | + my %dimm_portmap; |
| 363 | + foreach my $child (@{$targetObj->getTargetChildren($target)}) |
| 364 | + { |
| 365 | + if ($targetObj->getType($child) eq "MBA") |
| 366 | + { |
| 367 | + my $mba_num = $targetObj->getAttribute($child,"MBA_NUM"); |
| 368 | + my $dimms=$targetObj->findConnections($child,"DDR3",""); |
| 369 | + if ($dimms ne "") |
| 370 | + { |
| 371 | + foreach my $dimm (@{$dimms->{CONN}}) |
| 372 | + { |
| 373 | + my $port_num = $targetObj->getAttribute( |
| 374 | + $dimm->{SOURCE},"MBA_PORT"); |
| 375 | + my $dimm_num = $targetObj->getAttribute( |
| 376 | + $dimm->{SOURCE},"MBA_DIMM"); |
| 377 | + |
| 378 | + my $map = oct("0b".$mba_num.$port_num.$dimm_num); |
| 379 | + $dimm_portmap{$dimm->{DEST_PARENT}} = $map; |
| 380 | + } |
| 381 | + } |
| 382 | + } |
| 383 | + } |
| 384 | + |
| 385 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 386 | ## Process MEMBUF to DIMM I2C connections |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 387 | + my @addr_map=('0','0','0','0','0','0','0','0'); |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 388 | my $dimms=$targetObj->findConnections($target,"I2C","SPD"); |
| 389 | if ($dimms ne "") { |
| 390 | foreach my $dimm (@{$dimms->{CONN}}) { |
| 391 | @@ -960,8 +908,19 @@ sub processMembuf |
| 392 | setEepromAttributes($targetObj, |
| 393 | "EEPROM_VPD_FRU_INFO",$dimm_target, |
| 394 | $dimm,"0++"); |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 395 | + |
| 396 | + my $field=getI2cMapField($targetObj,$dimm_target,$dimm); |
| 397 | + my $map = $dimm_portmap{$dimm_target}; |
| 398 | + if ($map eq "") { |
| 399 | + print "ERROR: $dimm_target doesn't map to a dimm/port\n"; |
| 400 | + $targetObj->myExit(3); |
| 401 | + } |
| 402 | + $addr_map[$map] = $field; |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 403 | } |
| 404 | } |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 405 | + $targetObj->setAttribute($targetObj->{targeting}->{SYS}[0]->{KEY}, |
| 406 | + "MRW_MEM_SENSOR_CACHE_ADDR_MAP","0x".join("",@addr_map)); |
| 407 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 408 | ## Update bus speeds |
| 409 | processI2cSpeeds($targetObj,$target); |
| 410 | |
| 411 | @@ -973,7 +932,7 @@ sub processMembuf |
| 412 | foreach my $ddr (@{$ddrs->{CONN}}) { |
| 413 | my $mba=$ddr->{SOURCE}; |
| 414 | my $dimm=$ddr->{DEST_PARENT}; |
| 415 | - my ($dimmnum,$port)=split(//,sprintf("%02b\n",$portmap{$mba})); |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 416 | + my ($dimmnum,$port)=split(//,sprintf("%02b\n",$portmap{$mba})); |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 417 | $targetObj->setAttribute($dimm, "MBA_DIMM",$dimmnum); |
| 418 | $targetObj->setAttribute($dimm, "MBA_PORT",$port); |
| 419 | $portmap{$mba}++; |
| 420 | @@ -984,6 +943,24 @@ sub processMembuf |
| 421 | } |
| 422 | } |
| 423 | |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 424 | +sub getI2cMapField |
| 425 | +{ |
| 426 | + my $targetObj = shift; |
| 427 | + my $target = shift; |
| 428 | + my $conn_target = shift; |
| 429 | + |
| 430 | + |
| 431 | + my $port = $targetObj->getAttribute($conn_target->{SOURCE}, "I2C_PORT"); |
| 432 | + my $engine = $targetObj->getAttribute($conn_target->{SOURCE}, "I2C_ENGINE"); |
| 433 | + my $addr = $targetObj->getBusAttribute($conn_target->{SOURCE}, |
| 434 | + $conn_target->{BUS_NUM}, "I2C_ADDRESS"); |
| 435 | + |
| 436 | + my $bits=sprintf("%08b",hex($addr)); |
| 437 | + my $field=sprintf("%d%3s",oct($port),substr($bits,4,3)); |
| 438 | + my $hexfield = sprintf("%X",oct("0b$field")); |
| 439 | + return $hexfield; |
| 440 | +} |
| 441 | + |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 442 | |
| 443 | sub setEepromAttributes |
| 444 | { |
| 445 | @@ -1036,7 +1013,7 @@ sub setGpioAttributes |
| 446 | my $engine = $targetObj->getAttribute($conn_target->{SOURCE}, "I2C_ENGINE"); |
| 447 | my $addr = $targetObj->getBusAttribute($conn_target->{SOURCE}, |
| 448 | $conn_target->{BUS_NUM}, "I2C_ADDRESS"); |
| 449 | - my $path = $targetObj->getAttribute($conn_target->{SOURCE_PARENT}, |
Matt Ploetz | 940dcf6 | 2015-02-13 13:52:56 -0600 | [diff] [blame] | 450 | + my $path = $targetObj->getAttribute($conn_target->{SOURCE_PARENT}, |
Matt Ploetz | 60a36b2 | 2015-02-16 17:00:32 -0600 | [diff] [blame] | 451 | "PHYS_PATH"); |
| 452 | |
| 453 | |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 454 | -- |
| 455 | 1.8.2.2 |
| 456 | |