From bbee47025c110746b8bd4291d283ed2fba3fc7e1 Mon Sep 17 00:00:00 2001 From: Prachi Gupta Date: Mon, 21 May 2018 14:17:20 -0500 Subject: Fixup all the voltage rail's ID attribute for both proc and cent HWSV uses the following voltage rail ID attributes to determine the right FSP_DEVICE_PATH (i2c path) and calls the power api to set the voltages for each of the rails correctly. Since, all the IDs were 0, we were setting only proc0/membuf0's voltages correctly. Everyone else was getting standby voltage. This change looks at the vrm connectors in the system xml and use their position as the voltage rail IDs as they are unique per node, which is what HWSV is expecting. The rails are: VDD_ID/VCS_ID/VDN_ID/VDDR_ID/VPP_ID/etc. Change-Id: Ib23eaa43045fa77137c5ce5e477d007bf0c757dc CQ:SW428817 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59140 Reviewed-by: ILYA SMIRNOV Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Roland Veloz Reviewed-by: Daniel M. Crowell --- src/usr/targeting/common/processMrw.pl | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'src/usr') diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl index a30c80c41..0f28c8ff5 100755 --- a/src/usr/targeting/common/processMrw.pl +++ b/src/usr/targeting/common/processMrw.pl @@ -1138,8 +1138,80 @@ sub processProcessor $targetObj->setAttribute($target, "PROC_MEM_TO_USE", ( $targetObj->getAttribute($target, "FABRIC_GROUP_ID") << 3)); + processPowerRails ($targetObj, $target); } +sub processPowerRails +{ + my $targetObj = shift; + my $target = shift; + + #Example of how system xml is getting parsed into data structures here + #and eventually into the attribute + # + #System XML has this: + # + # vrm3-connector-22/vrm-type3-10/35219-3-8/IR35219_special.vout-0 => fcdimm-connector-69/fcdimm-14/membuf-0/MemIO + # POWER + # no + # vrm3-connector-22/vrm-type3-10/35219-3-8/ + # IR35219_special.vout-0 + # fcdimm-connector-69/fcdimm-14/membuf-0/ + # MemIO + # + # CLASS + # BUS + # + # + # + #each of the connection comes up like this (this is $rail variable) + # 'BUS_NUM' => 0, + # 'DEST_PARENT' => '/sys/node-4/calliope-1/fcdimm-connector-69/fcdimm-14/membuf-0', + # 'DEST' => '/sys/node-4/calliope-1/fcdimm-connector-69/fcdimm-14/membuf-0/MemIO', + # 'SOURCE_PARENT' => '/sys/node-4/calliope-1/vrm3-connector-22/vrm-type3-10/35219-3-8', + # 'SOURCE' => '/sys/node-4/calliope-1/vrm3-connector-22/vrm-type3-10/35219-3-8/IR35219_special.vout-0' + # + #So, for 'SOURCE' target, we walk up the hierarchy till we get to + #vrm3-connector-22 as that is the first target in the hierarchy that + #is unique per instance of a given volate rail. We get vrm connector's + #POSITION and set it as the ID for that rail. + # + #The 'DEST' target also has an attribute called "RAIL_NAME" that we can use + #to figure out which rail we are working with. But, for rails that are + #common between proc and centaur have "Cent" or "Mem" as a prefix. + # + my $rails=$targetObj->findDestConnections($target,"POWER",""); + if ($rails ne "") + { + foreach my $rail (@{$rails->{CONN}}) + { + my $rail_dest = $rail->{DEST}; + my $rail_src = $rail->{SOURCE}; + my $rail_name = $targetObj->getAttribute($rail_dest, "RAIL_NAME"); + #Need to get the connector's position and set the ID to that + #As it is unique for every new connection in the MRW + my $rail_connector = $targetObj->getTargetParent( #VRM connector + ($targetObj->getTargetParent #VRM type + ($targetObj->getTargetParent($rail_src)))); + + + my $position = $targetObj->getAttribute($rail_connector,"POSITION"); + my $rail_attr_id = + ($targetObj->getAttribute($target, "TYPE") eq "PROC") ? + "NEST_" : ""; + + #The rails that are common between proc and centaur have a "Cent" + #prefix in the system xml. We don't care for "Cent" in our attribute + #as it is scoped to the right target. But, for VIO, we decided to + #use MemIO rather than CentIO. The attribute is named as VIO_ID. + $rail_name =~ s/Cent//g; + $rail_name =~ s/Mem/V/g; + $rail_attr_id .= $rail_name . "_ID"; + + $targetObj->setAttribute($target, $rail_attr_id, $position); + } + } +} sub processI2cSpeeds { @@ -2223,6 +2295,8 @@ sub processMembuf my $dimmconn=$targetObj->getTargetParent($dimm); } } + + processPowerRails($targetObj, $target); } sub getI2cMapField -- cgit v1.2.1