diff options
author | Bill Schwartz <whs@us.ibm.com> | 2015-11-18 14:01:33 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-03-24 10:27:41 -0400 |
commit | b19c61f81dacb5088180946c5f415909965dd1fa (patch) | |
tree | dc5d723cfba93998f68c0e85de11d05ab07b8b3c /src | |
parent | 16ff4c0894f726ea97362536af36a413b1f255cd (diff) | |
download | blackbird-hostboot-b19c61f81dacb5088180946c5f415909965dd1fa.tar.gz blackbird-hostboot-b19c61f81dacb5088180946c5f415909965dd1fa.zip |
Changes related to packaging of memory vpd on Nimbus - part 1
Lower level vpd and targeting plumbing changes for Nimbus direct memory
Change-Id: I6ac97404f5ef7432d14192945f9a1e258ed66dd3
RTC: 128112
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/711
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
31 files changed, 2477 insertions, 263 deletions
diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk index 0256f55e6..8eb31011a 100644 --- a/src/build/mkrules/dist.targets.mk +++ b/src/build/mkrules/dist.targets.mk @@ -65,6 +65,7 @@ COPY_FILES = \ img/dimmspd.dat:vpo \ img/procmvpd.dat:vpo \ img/cvpd.dat:vpo \ + img/dvpd.dat:vpo \ obj/genfiles/fapiAttrInfo.csv:vpo \ obj/genfiles/fapiAttrEnumInfo.csv:vpo \ obj/genfiles/targAttrInfo.csv:vpo \ @@ -193,6 +194,7 @@ simics.tar_CONTENTS = \ img/procmvpd_ven.dat \ img/procmvpd_p9n.dat \ img/cvpd.dat \ + img/dvpd.dat \ #@TODO RTC:142088 # obj/genfiles/fapiAttrInfo.csv \ obj/genfiles/fapiAttrEnumInfo.csv \ diff --git a/src/build/simics/hb-pnor-vpd-preload.pl b/src/build/simics/hb-pnor-vpd-preload.pl index bf1832942..25a1c5a24 100755 --- a/src/build/simics/hb-pnor-vpd-preload.pl +++ b/src/build/simics/hb-pnor-vpd-preload.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2015 +# Contributors Listed Below - COPYRIGHT 2012,2016 # [+] International Business Machines Corp. # # @@ -30,9 +30,11 @@ my $DEBUG = 0; my $numProcs; my $numCentPerProc; +my $numMcsPerProc = 8; +my $procChipType; my $dataPath = "."; my $outputPath = "."; -my $machine = "NIMBUS"; +my $machine; my $procConfig = "uninit"; my $centConfig = "uninit"; my $maxProcs = 8; @@ -48,17 +50,19 @@ my $emptySPD; ($emptySPDfh, $emptySPD) = tempfile(); # Create temp file for CVPD -my $emptyCVPDfh; -my $emptyCVPD; -($emptyCVPDfh, $emptyCVPD) = tempfile(); +my $emptyMemVPDfh; +my $emptyMemVPD; +($emptyMemVPDfh, $emptyMemVPD) = tempfile(); my $mvpdFile = "procmvpd.dat"; my $mvpdFile_ven = "procmvpd_ven.dat"; my $mvpdFile_p9n = "procmvpd_p9n.dat"; my $cvpdFile = "cvpd.dat"; +my $dvpdFile = "dvpd.dat"; +my $memVpdFile = $cvpdFile; my $spdFile = "dimmspd.dat"; my $sysMVPD = "sysmvpd.dat"; -my $sysCVPD = "syscvpd.dat"; +my $sysMemVPD = "sysmemvpd.dat"; my $sysSPD = "sysspd.dat"; @@ -88,6 +92,12 @@ while( $ARGV = shift ) $numCentPerProc = shift; debugMsg( "Num Centaurs Per Proc: $numCentPerProc" ); } + elsif( $ARGV =~ m/--procChipType/ || + $ARGV =~ m/-pct/ ) + { + $procChipType = shift; + debugMsg( "Proc Chip Type: $procChipType" ); + } elsif( $ARGV =~ m/--dataPath/ || $ARGV =~ m/-dp/ ) { @@ -161,7 +171,7 @@ if($machine eq "HABANERO") exit 0; } -getCentaurConfig(); +getMemoryConfig(); createMVPDData(); createCVPDData(); createSPDData(); @@ -180,6 +190,7 @@ exit 0; sub usage { print "Usage: $0 --numProcs <value> [--numCentPerProc <value>]\n"; + print " [--procChipType <value>]\n"; print " [--dataPath <path> ] [-m | --machine <value>]\n"; print " [-mp | --maxProcs <value>]\n"; print " [-fp | --forceProc <value ] [-fc | -forceCent <value>]\n"; @@ -194,6 +205,7 @@ sub usage print " behind each processor. Must always\n"; print " contain info for 8 Centaurs\n"; print " --numCentPerProc\n"; + print " -pct --procChipType Processor Chip Type, ie p9n\n"; print " -m --machine Text machine to build data for.\n"; print " Default: MURANO\n"; print " -dp --dataPath Path to VPD data files.\n"; @@ -286,11 +298,7 @@ sub createMVPDData { $sourceFile = "$dataPath/$mvpdFile_ven"; } - elsif( $machine eq "NIMBUS") - { - $sourceFile = "$dataPath/$mvpdFile_p9n"; - } - elsif( $machine eq "ZZTOP") + elsif( $procChipType eq "p9n") { $sourceFile = "$dataPath/$mvpdFile_p9n"; } @@ -327,63 +335,64 @@ sub createMVPDData #==================================================================== sub createCVPDData { - print "Creating CVPD Data...\n"; + print "Creating Mem VPD Data...\n"; my $cmd; my $result; my $sourceFile; - my $sysCVPDFile = "$outputPath/$sysCVPD"; - my $sysCVPDFileECC = $sysCVPDFile . ".ecc"; + my $sysMemVPDFile = "$outputPath/$sysMemVPD"; + my $sysMemVPDFileECC = $sysMemVPDFile . ".ecc"; - if( -e $sysCVPDFile ) + if( -e $sysMemVPDFile ) { # Cleanup any existing files - system( "rm -rf $sysCVPDFile" ); + system( "rm -rf $sysMemVPDFile" ); } #Centaurs are populated based on populated Processors and special #MCS plugging rules. We can look at $procConfig and $maxProcs #to determine processor config. Centaur plugging is contained - #in $mcsArray, populated by getCentaurConfig() + #in $mcsArray, populated by getMemoryConfig() + #For direct access memory, $mcsArray has which MCSs are present - # Create empty CVPD data chunk - $cmd = " echo \"000FFF: 00\" \| xxd -r \> $emptyCVPD"; - system( $cmd ) == 0 or die "Creating $emptyCVPD failed!"; + # Create empty Mem VPD data chunk + $cmd = " echo \"000FFF: 00\" \| xxd -r \> $emptyMemVPD"; + system( $cmd ) == 0 or die "Creating $emptyMemVPD failed!"; for( my $proc = 0; $proc < $maxProcs; $proc++ ) { - for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ ) + for( my $mcs = 0; $mcs < $MAX_MCS; $mcs++ ) { - if( ($mcsArray[$cent] == 1) && + if( ($mcsArray[$mcs] == 1) && substr($procConfig,$proc,1) =~ /1/ ) { - debugMsg( "$machine( $proc, $cent): Real File" ); + debugMsg( "$machine( $proc, $mcs): Real File" ); # Use the real data to the full image - $sourceFile = "$dataPath/$cvpdFile"; + $sourceFile = "$dataPath/$memVpdFile"; } else { - debugMsg( "$machine( $proc, $cent): Empty file" ); - # No Centaur, use empty data chunk - $sourceFile = $emptyCVPD; + debugMsg( "$machine( $proc, $mcs): Empty file" ); + # No Centaur/MCS, use empty data chunk + $sourceFile = $emptyMemVPD; } - $result = `dd if=$sourceFile of=$sysCVPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`; + $result = `dd if=$sourceFile of=$sysMemVPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`; if( $? ) { - die "Error building CVPD file! proc=$proc cent=$cent\n"; + die "Error building Mem VPD file! proc=$proc cent=$mcs\n"; } } } - if( -e $sysCVPDFile ) + if( -e $sysMemVPDFile ) { - system( "chmod 775 $sysCVPDFile" ); - system( "ecc --inject $sysCVPDFile --output $sysCVPDFileECC --p8" ); - system( "chmod 775 $sysCVPDFileECC" ); + system( "chmod 775 $sysMemVPDFile" ); + system( "ecc --inject $sysMemVPDFile --output $sysMemVPDFileECC --p8" ); + system( "chmod 775 $sysMemVPDFileECC" ); } - debugMsg( "CVPD Done." ); + debugMsg( "Mem VPD Done." ); } @@ -412,20 +421,20 @@ sub createSPDData for( my $proc = 0; $proc < $maxProcs; $proc++ ) { - for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ ) + for( my $mcs = 0; $mcs < $MAX_MCS; $mcs++ ) { for( my $dimm = 0; $dimm < $MAX_DIMMS_PER_CENT; $dimm++ ) { - if( ($mcsArray[$cent] == 1) && - substr($procConfig,$proc,1) =~ /1/ ) + if( ($mcsArray[$mcs] == 1) && + substr($procConfig,$proc,1) =~ /1/ ) { - debugMsg( "$machine( $proc, $cent, $dimm ): Real File" ); + debugMsg( "$machine( $proc, $mcs, $dimm ): Real File" ); # Use the real data to the full image $sourceFile = "$dataPath/$spdFile"; } else { - debugMsg( "$machine( $proc, $cent, $dimm ): Empty file" ); + debugMsg( "$machine( $proc, $mcs, $dimm ): Empty file" ); # No dimm, use empty data chunk $sourceFile = $emptySPD; } @@ -433,7 +442,7 @@ sub createSPDData $result = `dd if=$sourceFile of=$sysSPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`; if( $? ) { - die "Error building SPD file! $proc $cent $dimm\n"; + die "Error building SPD file! $proc $mcs $dimm\n"; } } } @@ -450,9 +459,16 @@ sub createSPDData } -sub getCentaurConfig +sub getMemoryConfig { - debugMsg( "getCentaurConfig $machine" ); + debugMsg( "getMemoryConfig $machine" ); + + #Select direct memory vpd file or Centaur vpd file + if( $procChipType eq "p9n") + { + $memVpdFile = $dvpdFile; + $numMcsPerProc = 4; + } #First check if explicit Centaur Plugging rules were provided if( $centConfig !~ m/uninit/ ) @@ -522,15 +538,14 @@ sub getCentaurConfig } } } - elsif( $machine eq "NIMBUS") - { - #as there are no centaurs within a NIMBUS machine NO configuration - #for centaur chips is required - } - elsif( $machine eq "ZZTOP") + elsif( $procChipType eq "p9n") { - #as there are no centaurs within a NIMBUS machine NO configuration - #for centaur chips is required + #There are no centaurs within a NIMBUS machine, but need to set + #up the mcs array. + if( $mcs < $numMcsPerProc) + { + $mcsArray[$mcs] = 1; + } } else { @@ -539,7 +554,7 @@ sub getCentaurConfig } } - debugMsg( "@mcsArray" ); + debugMsg( "mcsArray=@mcsArray" ); } diff --git a/src/build/simics/hb-pnor-vpd-preload.py b/src/build/simics/hb-pnor-vpd-preload.py index c11d795e6..49d97e2a2 100755 --- a/src/build/simics/hb-pnor-vpd-preload.py +++ b/src/build/simics/hb-pnor-vpd-preload.py @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2015 +# Contributors Listed Below - COPYRIGHT 2012,2016 # [+] International Business Machines Corp. # # @@ -32,9 +32,18 @@ import shlex toolLoc = os.environ.get("HB_TOOLPATH"); thisSys = os.environ.get("HB_MACHINE").upper(); numProcs = os.environ.get( "NUM_PROCS"); -#@TODO RTC 128112 -numCentaurPerProc = "0"; # os.environ.get( "GFW_P9_%s_CENTAURS_PER_PROC" % thisSys ); -cmd = toolLoc + "/hb-pnor-vpd-preload.pl --numProcs " + numProcs + " --numCentPerProc " + numCentaurPerProc + " --machine " + thisSys + " --dataPath " + toolLoc +numCentaurPerProcParm = ""; +numCentaurPerProc = "0"; +if os.environ.has_key( "GFW_P9_%s_CENTAURS_PER_PROC" % thisSys ): + numCentaurPerProc=os.environ.get( "GFW_P9_%s_CENTAURS_PER_PROC" % thisSys ); + numCentaurPerProcParm=" --numCentPerProc " + numCentaurPerProc; +pass +procChipTypeParm = ""; +if os.environ.has_key('HB_PROC_CHIP_TYPE'): + procChipType = os.environ.get('HB_PROC_CHIP_TYPE'); + procChipTypeParm=" --procChipType " + procChipType; +pass +cmd = toolLoc + "/hb-pnor-vpd-preload.pl --numProcs " + numProcs + numCentaurPerProcParm + procChipTypeParm + " --machine " + thisSys + " --dataPath " + toolLoc print "Generate PNOR VPD for " + numProcs + " processor(s), and " + numCentaurPerProc + " Centaur(s) per Processor."; args = shlex.split( cmd ); subprocess.call( args ); diff --git a/src/build/simics/standalone.simics b/src/build/simics/standalone.simics index bd8d4fdb3..a078563e5 100755 --- a/src/build/simics/standalone.simics +++ b/src/build/simics/standalone.simics @@ -5,11 +5,16 @@ ($hb_masterproc).proc_fsi2host_mbox->responder_enable=1 # Preload VPD in PNOR +# Pass processor chip type. All proc chip types should be the same. + if (get-object-list p9_proc) { + $procChipType=(get-object-list p9_proc)[0]->chip_type + python "os.environ['HB_PROC_CHIP_TYPE'] = \""+$procChipType+"\"" + } try { run-python-file (lookup-file hbfw/hb-pnor-vpd-preload.py) ($hb_pnor).sfc_master_mem.load-file ./sysmvpd.dat.ecc 0x1C5000 ($hb_pnor).sfc_master_mem.load-file ./sysspd.dat.ecc 0x17D000 - ($hb_pnor).sfc_master_mem.load-file ./syscvpd.dat.ecc 0x255000 + ($hb_pnor).sfc_master_mem.load-file ./sysmemvpd.dat.ecc 0x255000 } except { echo "ERROR: Failed to preload VPD into PNOR." } #Write the PNOR MMIO addr into Scratch 2, 0x283A diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index e30595e40..06195f326 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -54,8 +54,8 @@ namespace DeviceFW PRESENT, FSI, SPD, - MVPD, - CVPD, + MVPD, // Module (processor) VPD + CVPD, // Centaur (memory buffer) VPD SCAN, EEPROM, GPIO, @@ -65,6 +65,7 @@ namespace DeviceFW TPM, SIO, AHB_SIO, + DVPD, // Direct access memory VPD LAST_ACCESS_TYPE, }; @@ -192,6 +193,28 @@ namespace DeviceFW static_cast<uint64_t>(( i_location )) /** + * Construct the device addressing parameters for the DVPD (Direct access + * memory VPD) device ops. + * @param[in] i_record - The enumeration of the DVPD record to access. + * @param[in] i_keyword - The enumeration of the DVPD keyword, located + * within the i_record Record to access. + */ + #define DEVICE_DVPD_ADDRESS( i_record, i_keyword )\ + DEVICE_DVPD_FORCE_ADDRESS( i_record, i_keyword, VPD::AUTOSELECT ) + + /** + * Construct the device addressing parameters for the DVPD device ops. + * @param[in] i_record - The enumeration of the DVPD record to access. + * @param[in] i_keyword - The enumeration of the DVPD keyword, located + * within the i_record Record to access. + * @param[in] i_location - The location of the data (PNOR/SEEPROM) + see vpd_if.H + */ + #define DEVICE_DVPD_FORCE_ADDRESS( i_record, i_keyword, i_location )\ + DeviceFW::DVPD, static_cast<uint64_t>(( i_record )),\ + static_cast<uint64_t>(( i_keyword )),\ + static_cast<uint64_t>(( i_location )) + /** * Construct the device addressing parameters for the SCAN device ops. * @param[in] i_ring - The ring address to scan * @param[in] i_ringlen - The length of the ring to scan in bits diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H index 7c11d8643..4e6f51cd9 100644 --- a/src/include/usr/hwas/common/deconfigGard.H +++ b/src/include/usr/hwas/common/deconfigGard.H @@ -118,8 +118,11 @@ public: // set by call_mss_getecid() in dmi_training.c DECONFIGURED_BY_MEMORY_CONFIG, // BASE | 0x03 - // set by presentByAssoc() when a MCS has no MEMBUFs - DECONFIGURED_BY_NO_CHILD_MEMBUF, // BASE | 0x04 + // set by presentByAssoc() when a MCS has no MEMBUFs or MCAs + DECONFIGURED_BY_NO_CHILD_MEMBUF_OR_MCA, // BASE | 0x04 + // TODO RTC 149367 Remove deprecated enumeration once hwsv is not using + DECONFIGURED_BY_NO_CHILD_MEMBUF = //Deprecated + DECONFIGURED_BY_NO_CHILD_MEMBUF_OR_MCA, // set by deconfigureAssocProc() in hwas/common/deconfigGard.C DECONFIGURED_BY_BUS_DECONFIG, // BASE | 0x05 @@ -145,8 +148,11 @@ public: // set by presentByAssoc() when a MEMBUF has no MBAs DECONFIGURED_BY_NO_CHILD_MBA, // BASE | 0x0C - // set by presentByAssoc() when a DIMM has no MBA - DECONFIGURED_BY_NO_PARENT_MBA, // BASE | 0x0D + // set by presentByAssoc() when a DIMM has no MBA or MCA + DECONFIGURED_BY_NO_PARENT_MBA_OR_MCA, // BASE | 0x0D + // TODO RTC 149367 Remove deprecated enumeration once hwsv is not using + DECONFIGURED_BY_NO_PARENT_MBA = //Deprecated + DECONFIGURED_BY_NO_PARENT_MBA_OR_MCA, CONFIGURED_BY_RESOURCE_RECOVERY, // BASE | 0x0E diff --git a/src/include/usr/hwas/common/hwas.H b/src/include/usr/hwas/common/hwas.H index 7c5a4202a..2a6d59ed9 100644 --- a/src/include/usr/hwas/common/hwas.H +++ b/src/include/usr/hwas/common/hwas.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -152,7 +152,7 @@ typedef std::vector<TargetInfo> TargetInfoVector; * @brief Invokes presentByAssoc * * Called by discoverTargets(). This function queries the system and populates - * a vector of structs representing functional MCS, MEMBUFS, DIMMS. + * a vector of structs representing functional MCS, MEMBUFS, MBAs, MCAs,DIMMS. * This vector is then passed to presentByAssoc() which systematically adds * targets to another vector to be deconfigured based on their related targets * Upon completion of presentByAssoc(), this function iterates @@ -162,15 +162,19 @@ typedef std::vector<TargetInfo> TargetInfoVector; void invokePresentByAssoc(); /** - * @brief Algorithm to check if a MCS has a MEMBUF, a MEMBUF has a MCS and DIMM, - * and a DIMM has a MEMBUF. + * @brief Algorithm to validate the memory target structure. + * + * For non direct memory, check if a MCS has a MEMBUF, a MEMBUF has a MBA, + * and the MBA has a DIMM. + * + * For direct memory, check if a MCS has a MCA, and a MCA has a DIMM. * * The vector o_funcTargets is sorted by affinity path to allow a single pass * with some backtracking to check every scenario more efficiently. * These checks are needed because of scenarios where targets are non-present * and their related targets are not marked as deconfigured * - * @param[in/out] io_funcTargets A vector of functional MCS, MEMBUFS, DIMMS + * @param[in/out] io_funcTargets A vector of functional memory targets * @param[out] o_targToDeconfig A vector of targets to deconfigure, done * this way to allow unit tests */ diff --git a/src/include/usr/hwas/common/hwas_reasoncodes.H b/src/include/usr/hwas/common/hwas_reasoncodes.H index 48e10a699..cceede164 100644 --- a/src/include/usr/hwas/common/hwas_reasoncodes.H +++ b/src/include/usr/hwas/common/hwas_reasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -53,6 +53,7 @@ namespace HWAS RC_SYSAVAIL_NO_MEMBUFS_FUNC = HWAS_COMP_ID | 0x09, RC_RESOURCE_RECOVERED = HWAS_COMP_ID | 0x0A, RC_SYSAVAIL_MISSING_CRITICAL_RESOURCE = HWAS_COMP_ID | 0x0B, + RC_SYSAVAIL_NO_MCAS_FUNC = HWAS_COMP_ID | 0x0C, }; }; diff --git a/src/include/usr/vpd/dvpdenums.H b/src/include/usr/vpd/dvpdenums.H new file mode 100644 index 000000000..5f7e99832 --- /dev/null +++ b/src/include/usr/vpd/dvpdenums.H @@ -0,0 +1,140 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/vpd/dvpdenums.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __DVPDENUMS_H +#define __DVPDENUMS_H + +#include <vpd/ipvpdenums.H> + +namespace DVPD +{ + +//TODO RTC 144519 Replace with list of direct memory records and keywords +// from memory team. + /** + * @brief Enumeration for the DVPD Records that contain + * the keyword enumerations below. + */ + enum dvpdRecord + { + DVPD_FIRST_RECORD = 0x00, + VEIR = DVPD_FIRST_RECORD, + VER0 = 0x01, + MER0 = 0x02, + VSPD = 0x03, + VINI = 0x04, + OPFR = 0x05, + VNDR = 0x06, + SPDX = 0x07, + // Last Record + DVPD_LAST_RECORD, + DVPD_TEST_RECORD, // Test purposes ONLY! + + //Start common IPVPD enums + DVPD_INVALID_RECORD = IPVPD::INVALID_RECORD, + }; + + /** + * @brief Enumerations for DVPD keywords that can be + * accessed in the DVPD. + */ + enum dvpdKeyword + { + DVPD_FIRST_KEYWORD = 0x00, + pdI = DVPD_FIRST_KEYWORD, + PF = 0x01, + MT = 0x02, + MR = 0x03, + pdA = 0x04, + EL = 0x05, + LM = 0x06, + MW = 0x07, + MV = 0x08, + AM = 0x09, + VZ = 0x0a, + pdD = 0x0b, + MX = 0x0c, + DW = 0x0d, + PN = 0x0e, + SN = 0x0f, + DR = 0x10, + CE = 0x11, + FN = 0x12, + CC = 0x13, + HE = 0x14, + CT = 0x15, + HW = 0x16, + VD = 0x17, + VN = 0x18, + VP = 0x19, + VS = 0x1a, + M0 = 0x1b, + M1 = 0x1c, + M2 = 0x1d, + M3 = 0x1e, + M4 = 0x1f, + M5 = 0x20, + M6 = 0x21, + M7 = 0x22, + M8 = 0x23, + T1 = 0x24, + T2 = 0x25, + T4 = 0x26, + T5 = 0x27, + T6 = 0x28, + T8 = 0x29, + Q0 = 0x2a, + Q1 = 0x2b, + Q2 = 0x2c, + Q3 = 0x2d, + Q4 = 0x2e, + Q5 = 0x2f, + Q6 = 0x30, + Q7 = 0x31, + Q8 = 0x32, + K0 = 0x33, + K1 = 0x34, + K2 = 0x35, + K3 = 0x36, + K4 = 0x37, + K5 = 0x38, + K6 = 0x39, + K7 = 0x3a, + K8 = 0x3b, + MM = 0x3c, + SS = 0x3d, + ET = 0x3e, + + // Last Keyword + DVPD_LAST_KEYWORD, + DVPD_TEST_KEYWORD, // Test purposes ONLY! + + //Start common IPVPD enums + FULL_RECORD = IPVPD::FULL_RECORD, + DVPD_INVALID_KEYWORD = IPVPD::INVALID_KEYWORD, + }; + +}; // end DVPD + +#endif diff --git a/src/include/usr/vpd/vpdreasoncodes.H b/src/include/usr/vpd/vpdreasoncodes.H index 9692a4a78..ca1f34872 100644 --- a/src/include/usr/vpd/vpdreasoncodes.H +++ b/src/include/usr/vpd/vpdreasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -65,6 +65,9 @@ enum vpdModuleId // PVPD VPD_PVPD_PRESENCEDETECT = 0x50, + // DVPD + VPD_DVPD_PRESENCEDETECT = 0x58, + // DIMM SPD VPD_SPD_GET_KEYWORD_VALUE = 0x61, VPD_SPD_GET_VALUE = 0x62, diff --git a/src/usr/fsi/fsipres.C b/src/usr/fsi/fsipres.C index b092c0973..038e952b3 100644 --- a/src/usr/fsi/fsipres.C +++ b/src/usr/fsi/fsipres.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -272,7 +272,7 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType, bool cvpd_present = false; bool check_for_cvpd = true; -#ifdef CONFIG_CVPD_READ_FROM_HW +#ifdef CONFIG_MEMVPD_READ_FROM_HW check_for_cvpd = fsi_present; #endif @@ -282,7 +282,7 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType, } -#if defined(CONFIG_CVPD_READ_FROM_HW) && defined(CONFIG_CVPD_READ_FROM_PNOR) +#if defined(CONFIG_MEMVPD_READ_FROM_HW) && defined(CONFIG_MEMVPD_READ_FROM_PNOR) if( cvpd_present ) { // Check if the VPD data in the PNOR matches the SEEPROM diff --git a/src/usr/hwas/HBconfig b/src/usr/hwas/HBconfig index 071c78e45..f20bab8d1 100644 --- a/src/usr/hwas/HBconfig +++ b/src/usr/hwas/HBconfig @@ -10,7 +10,7 @@ config NO_GARD_SUPPORT config HOST_HCDB_SUPPORT default n - depends on CVPD_READ_FROM_HW || MVPD_READ_FROM_HW || DJVPD_READ_FROM_HW + depends on MEMVPD_READ_FROM_HW || MVPD_READ_FROM_HW || DJVPD_READ_FROM_HW help Hostboot will detect hardware changes diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index 25a43bc47..064563a1b 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -215,7 +215,7 @@ errlHndl_t discoverTargets() // Assumptions and actions: // CLASS_SYS (exactly 1) - mark as present - // CLASS_ENC, TYPE_PROC, TYPE_MEMBUF, TYPE_DIMM + // CLASS_ENC, TYPE_PROC, TYPE_MCS, TYPE_MEMBUF, TYPE_DIMM // (ALL require hardware query) - call platPresenceDetect // \->children: CLASS_* (NONE require hardware query) - mark as present do @@ -236,8 +236,10 @@ errlHndl_t discoverTargets() PredicateCTM predEnc(CLASS_ENC); PredicateCTM predChip(CLASS_CHIP); PredicateCTM predDimm(CLASS_LOGICAL_CARD, TYPE_DIMM); + PredicateCTM predMcs(CLASS_UNIT, TYPE_MCS); PredicatePostfixExpr checkExpr; - checkExpr.push(&predChip).push(&predDimm).Or().push(&predEnc).Or(); + checkExpr.push(&predChip).push(&predDimm).Or().push(&predEnc).Or(). + push(&predMcs).Or(); TargetHandleList pCheckPres; targetService().getAssociated( pCheckPres, pSys, @@ -456,8 +458,9 @@ errlHndl_t discoverTargets() } #endif - // call invokePresentByAssoc() to obtain functional MCS's, MEMBUFs, and - // DIMM's, call algorithm function presentByAssoc() to determine + // call invokePresentByAssoc() to obtain functional MCSs, MEMBUFs, and + // DIMMs for non-direct memory or MCSs, MCAs, and DIMMs for direct + // memory. Call algorithm function presentByAssoc() to determine // targets that need to be deconfigured invokePresentByAssoc(); @@ -1416,7 +1419,8 @@ errlHndl_t checkMinimumHardware(const TARGETING::ConstTargetHandle_t i_nodeOrSys HWAS_DBG( "checkMinimumHardware: %d functional dimms", l_dimms.size()); -// @todo RTC:142535 Add DIMM targets to MRW targeting script +// @todo RTC:149770 Once ZZ supports DIMMs, add DIMMs back in min hdw check. +// It works for stand alone. #if (0) if (l_dimms.empty()) { @@ -1468,69 +1472,140 @@ errlHndl_t checkMinimumHardware(const TARGETING::ConstTargetHandle_t i_nodeOrSys errlCommit(l_errl, HWAS_COMP_ID); // errl is now NULL } // if no dimms +#endif + // There needs to be either functional MCS/MCAs (NIMBUS) or MCS/MBAs + // (CUMULUS). Check for MCAs first. + PredicateCTM l_mca(CLASS_UNIT, TYPE_MCA); + + TargetHandleList l_presMcaTargetList; + PredicatePostfixExpr l_checkExprPresMca; + l_checkExprPresMca.push(&l_mca).push(&l_present).And(); + targetService().getAssociated( l_presMcaTargetList, pTop, + TargetService::CHILD, TargetService::ALL, + &l_checkExprPresMca); + // If any MCAs are present, then some must be functional + if (!l_presMcaTargetList.empty()) + { + TargetHandleList l_funcMcaTargetList; + PredicatePostfixExpr l_checkExprPresMca; + l_checkExprPresMca.push(&l_mca).push(&l_functional).And(); + targetService().getAssociated( l_funcMcaTargetList, pTop, + TargetService::CHILD, TargetService::ALL, + &l_checkExprPresMca); + + HWAS_DBG( "checkMinimumHardware: %d functional MCAs", + l_funcMcaTargetList.size()); + + if (l_funcMcaTargetList.empty()) + { + HWAS_ERR( "Insufficient hardware to continue IPL" + " (func membufs)"); + if(o_bootable) + { + *o_bootable = false; + break; + } + uint32_t mca_present = l_presMcaTargetList.size(); + + /*@ + * @errortype + * @severity ERRL_SEV_UNRECOVERABLE + * @moduleid MOD_CHECK_MIN_HW + * @reasoncode RC_SYSAVAIL_NO_MCAS_FUNC + * @devdesc checkMinimumHardware found no + * functional membufs + * @custdesc A problem occurred during the IPL of the + * system: Found no functional dimm cards. + * @userdata1[00:31] HUID of node + * @userdata2[00:31] number of present nonfunctional membufs + */ + const uint64_t userdata1 = + (static_cast<uint64_t>(get_huid(pTop)) << 32); + const uint64_t userdata2 = + (static_cast<uint64_t>(mca_present) << 32); + l_errl = hwasError(ERRL_SEV_UNRECOVERABLE, + MOD_CHECK_MIN_HW, + RC_SYSAVAIL_NO_MCAS_FUNC, + userdata1, userdata2); - // check for functional membufs - PredicateCTM l_membuf(CLASS_CHIP, TYPE_MEMBUF); + // call out the procedure to find the deconfigured part. + hwasErrorAddProcedureCallout( l_errl, + EPUB_PRC_FIND_DECONFIGURED_PART, + SRCI_PRIORITY_HIGH ); + + // if we already have an error, link this one to the earlier; + // if not, set the common plid + hwasErrorUpdatePlid( l_errl, l_commonPlid ); + errlCommit(l_errl, HWAS_COMP_ID); + // errl is now NULL + } + } + else // there were no MCAa. There must be functional membufs + { + PredicateCTM l_membuf(CLASS_CHIP, TYPE_MEMBUF); - TargetHandleList l_funcMembufTargetList; - PredicatePostfixExpr l_checkExprFunctionalMembufs; - l_checkExprFunctionalMembufs.push(&l_membuf).push(&l_functional).And(); - targetService().getAssociated( l_funcMembufTargetList, pTop, + TargetHandleList l_funcMembufTargetList; + PredicatePostfixExpr l_checkExprFunctionalMembufs; + l_checkExprFunctionalMembufs.push(&l_membuf). + push(&l_functional).And(); + targetService().getAssociated( l_funcMembufTargetList, pTop, TargetService::CHILD, TargetService::ALL, &l_checkExprFunctionalMembufs); - HWAS_DBG( "checkMinimumHardware: %d functional membufs", - l_funcMembufTargetList.size()); + HWAS_DBG( "checkMinimumHardware: %d functional membufs", + l_funcMembufTargetList.size()); - if (l_funcMembufTargetList.empty()) - { - HWAS_ERR( "Insufficient hardware to continue IPL (func membufs)"); - if(o_bootable) - { - *o_bootable = false; - break; - } - TargetHandleList l_presentMembufTargetList; - PredicatePostfixExpr l_checkExprPresentMembufs; - l_checkExprPresentMembufs.push(&l_membuf).push(&l_present).And(); - targetService().getAssociated( l_presentMembufTargetList, pTop, + if (l_funcMembufTargetList.empty()) + { + HWAS_ERR( "Insufficient hardware to continue IPL" + " (func membufs)"); + if(o_bootable) + { + *o_bootable = false; + break; + } + TargetHandleList l_presentMembufTargetList; + PredicatePostfixExpr l_checkExprPresentMembufs; + l_checkExprPresentMembufs.push(&l_membuf). + push(&l_present).And(); + targetService().getAssociated( l_presentMembufTargetList, pTop, TargetService::CHILD, TargetService::ALL, &l_checkExprPresentMembufs); - uint32_t membufs_present = l_presentMembufTargetList.size(); - - /*@ - * @errortype - * @severity ERRL_SEV_UNRECOVERABLE - * @moduleid MOD_CHECK_MIN_HW - * @reasoncode RC_SYSAVAIL_NO_MEMBUFS_FUNC - * @devdesc checkMinimumHardware found no - * functional membufs - * @custdesc A problem occurred during the IPL of the - * system: Found no functional dimm cards. - * @userdata1[00:31] HUID of node - * @userdata2[00:31] number of present nonfunctional membufs - */ - const uint64_t userdata1 = - (static_cast<uint64_t>(get_huid(pTop)) << 32); - const uint64_t userdata2 = - (static_cast<uint64_t>(membufs_present) << 32); - l_errl = hwasError(ERRL_SEV_UNRECOVERABLE, + uint32_t membufs_present = l_presentMembufTargetList.size(); + + /*@ + * @errortype + * @severity ERRL_SEV_UNRECOVERABLE + * @moduleid MOD_CHECK_MIN_HW + * @reasoncode RC_SYSAVAIL_NO_MEMBUFS_FUNC + * @devdesc checkMinimumHardware found no + * functional membufs + * @custdesc A problem occurred during the IPL of the + * system: Found no functional dimm cards. + * @userdata1[00:31] HUID of node + * @userdata2[00:31] number of present nonfunctional membufs + */ + const uint64_t userdata1 = + (static_cast<uint64_t>(get_huid(pTop)) << 32); + const uint64_t userdata2 = + (static_cast<uint64_t>(membufs_present) << 32); + l_errl = hwasError(ERRL_SEV_UNRECOVERABLE, MOD_CHECK_MIN_HW, RC_SYSAVAIL_NO_MEMBUFS_FUNC, userdata1, userdata2); - // call out the procedure to find the deconfigured part. - hwasErrorAddProcedureCallout( l_errl, + // call out the procedure to find the deconfigured part. + hwasErrorAddProcedureCallout( l_errl, EPUB_PRC_FIND_DECONFIGURED_PART, SRCI_PRIORITY_HIGH ); - // if we already have an error, link this one to the earlier; - // if not, set the common plid - hwasErrorUpdatePlid( l_errl, l_commonPlid ); - errlCommit(l_errl, HWAS_COMP_ID); - // errl is now NULL + // if we already have an error, link this one to the earlier; + // if not, set the common plid + hwasErrorUpdatePlid( l_errl, l_commonPlid ); + errlCommit(l_errl, HWAS_COMP_ID); + // errl is now NULL + } } -#endif // ------------------------------------------------------------ // Check for Mirrored memory - // If the user requests mirrored memory and we do not have it, @@ -1651,7 +1726,7 @@ void invokePresentByAssoc() // make one list TargetHandleList l_funcTargetList; - // get the functional mcss + // get the functional MCSs TargetHandleList l_funcMCSTargetList; getAllChiplets(l_funcMCSTargetList, TYPE_MCS, true ); l_funcTargetList.insert(l_funcTargetList.begin(), @@ -1671,6 +1746,7 @@ void invokePresentByAssoc() #endif // get the functional membufs + // note: do not expect membufs for NIMBUS direct memory attach TargetHandleList l_funcMembufTargetList; getAllChips(l_funcMembufTargetList, TYPE_MEMBUF, true ); l_funcTargetList.insert(l_funcTargetList.begin(), @@ -1690,6 +1766,7 @@ void invokePresentByAssoc() #endif // get the functional mbas + // note: do not expect mbas for NIMBUS direct memory attach TargetHandleList l_funcMBATargetList; getAllChiplets(l_funcMBATargetList, TYPE_MBA, true ); l_funcTargetList.insert(l_funcTargetList.begin(), @@ -1708,6 +1785,25 @@ void invokePresentByAssoc() } #endif + // get the functional MCAs + // note: MCAs are expected for NIMBUS direct memory attach + TargetHandleList l_funcMcaTargetList; + getAllChiplets(l_funcMcaTargetList, TYPE_MCA, true ); + l_funcTargetList.insert(l_funcTargetList.begin(), + l_funcMcaTargetList.begin(), + l_funcMcaTargetList.end()); + +// If VPO, dump targets (MCA) for verification & debug purposes +#ifdef CONFIG_VPO_COMPILE + HWAS_INF("invokePresentByAssocDA(): MCA targets:"); + for (TargetHandleList::const_iterator + l_MCA_Itr = l_funcMcaTargetList.begin(); + l_MCA_Itr != l_funcMcaTargetList.end(); + l_MCA_Itr++) + { + HWAS_INF(" MCA: HUID %.8x", TARGETING::get_huid(*l_MCA_Itr)); + } +#endif // get the functional dimms TargetHandleList l_funcDIMMTargetList; getAllLogicalCards(l_funcDIMMTargetList, TYPE_DIMM, true ); @@ -1767,6 +1863,11 @@ void presentByAssoc(TargetInfoVector& io_funcTargets, // Sort entire vector by affinity path. This provides the algorithm with // an ordered vector of targets, making it easy to check if: + // for direct attach memory - + // MCS has child MCA + // MCA has child DIMM and parent MCS + // DIMM has parent MCA. + // for non direct attach memory - // MCS has child MEMBUF // MEMBUF has parent MCS and child MBA // MBA has child DIMM and parnent MEMBUF @@ -1780,6 +1881,7 @@ void presentByAssoc(TargetInfoVector& io_funcTargets, size_t l_MCSIndex = __INT_MAX__; size_t l_MEMBUFIndex = __INT_MAX__; size_t l_MBAIndex = __INT_MAX__; + size_t l_MCAIndex = __INT_MAX__; size_t i = 0; // Perform presentByAssoc algorithm @@ -1807,16 +1909,16 @@ void presentByAssoc(TargetInfoVector& io_funcTargets, { case TYPE_MCS: { - // No Child MEMBUFs - // If next is not a MEMBUF sharing the same MCS, deconfig MCS + // No Child MEMBUFs or MCAs + // If next is not a MEMBUF or MCA sharing the same MCS, deconfig MCS if ( (l_nextTargetInfo == NULL) || - (l_nextTargetInfo->type != TYPE_MEMBUF) || + ( (l_nextTargetInfo->type != TYPE_MEMBUF) && + (l_nextTargetInfo->type != TYPE_MCA) ) || !isSameSubPath(l_curTargetInfo, *l_nextTargetInfo) ) { - // Disable MCS - NO_CHILD_MEMBUF + // Disable MCS - NO_CHILD_MEMBUF_OR_MCA l_curTargetInfo.reason = - DeconfigGard::DECONFIGURED_BY_NO_CHILD_MEMBUF; - + DeconfigGard::DECONFIGURED_BY_NO_CHILD_MEMBUF_OR_MCA; // Add target to Deconfig vector to be deconfigured later o_targToDeconfig.push_back(l_curTargetInfo); // Remove target from funcTargets @@ -1930,17 +2032,72 @@ void presentByAssoc(TargetInfoVector& io_funcTargets, break; } // MBA + case TYPE_MCA: + { +// @todo RTC:149770 Once ZZ supports DIMMs, add DIMMs back in min hdw check. +// It works for stand alone. +#if (0) + // No Child DIMMs + // If next is not a DIMM sharing the same MCA, deconfig MCS + if ( (l_nextTargetInfo == NULL) || + (l_nextTargetInfo->type != TYPE_DIMM) || + !isSameSubPath(l_curTargetInfo, *l_nextTargetInfo) ) + { + // Disable MCS - NO_CHILD_DIMM + l_curTargetInfo.reason = + DeconfigGard::DECONFIGURED_BY_NO_CHILD_DIMM; + } + // No Parent MCS + // If MCA doesn't share the same MCS as MCSIndex, deconfig MCA + else +#endif // the new line can be removed + if ( (l_MCSIndex == __INT_MAX__) || + !isSameSubPath(l_curTargetInfo, io_funcTargets[l_MCSIndex])) + { + // Disable MCA - NO_PARENT_MCS + l_curTargetInfo.reason = + DeconfigGard::DECONFIGURED_BY_NO_PARENT_MCS; + } + // Update MCA Index + else + { + l_MCAIndex = i; + i++; + continue; + } + + // Add target to deconfig vector to be deconfigured later + o_targToDeconfig.push_back(l_curTargetInfo); + // Remove target from funcTargets + io_funcTargets.erase(it); + + // Backtrack to last MCS + if ( l_MCSIndex != __INT_MAX__ ) + { + i = l_MCSIndex; + } + // Backtrack to beginning if no MCS has been seen yet + else + { + i = 0; + } + break; + } // MCS + case TYPE_DIMM: { - // No Parent MBA + // No Parent MBA or MCA // If DIMM does not share the same MBA as MBAIndex, + // or if DIMM does not share the same MCA as MCAIndex, // deconfig DIMM - if ( (l_MBAIndex == __INT_MAX__) || - !isSameSubPath(l_curTargetInfo, io_funcTargets[l_MBAIndex])) + if ( ((l_MBAIndex == __INT_MAX__) || + !isSameSubPath(l_curTargetInfo, io_funcTargets[l_MBAIndex])) && + ((l_MCAIndex == __INT_MAX__) || + !isSameSubPath(l_curTargetInfo, io_funcTargets[l_MCAIndex])) ) { // Disable DIMM l_curTargetInfo.reason = - DeconfigGard::DECONFIGURED_BY_NO_PARENT_MBA; + DeconfigGard::DECONFIGURED_BY_NO_PARENT_MBA_OR_MCA; // Add target to deconfig vector to be deconfigured later o_targToDeconfig.push_back(l_curTargetInfo); @@ -1952,6 +2109,11 @@ void presentByAssoc(TargetInfoVector& io_funcTargets, { i = l_MBAIndex; } + // Backtrack to last MCA + else if ( l_MCAIndex != __INT_MAX__) + { + i = l_MCSIndex; + } // Backtrack to last MEMBUF if no MBA has been seen yet else if ( l_MEMBUFIndex != __INT_MAX__) { diff --git a/src/usr/hwas/hwasPlat.C b/src/usr/hwas/hwasPlat.C index 1eb3241c0..57d185ab2 100644 --- a/src/usr/hwas/hwasPlat.C +++ b/src/usr/hwas/hwasPlat.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -412,7 +412,8 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets) errlCommit(errl, HWAS_COMP_ID); } #endif -#ifdef CONFIG_CVPD_WRITE_TO_PNOR +#if defined(CONFIG_MEMVPD_WRITE_TO_PNOR) || \ + defined(CONFIG_PVPD_WRITE_TO_PNOR) errl = PNOR::clearSection( PNOR::CENTAUR_VPD ); if( errl ) { diff --git a/src/usr/hwpf/hwp/dmi_training/HBconfig b/src/usr/hwpf/hwp/dmi_training/HBconfig index f91efb455..f3bf34d2b 100644 --- a/src/usr/hwpf/hwp/dmi_training/HBconfig +++ b/src/usr/hwpf/hwp/dmi_training/HBconfig @@ -1,4 +1,4 @@ config NO_DMI_EREPAIR - default y if(!CVPD_WRITE || !CVPD_READ) + default y if(!MEMVPD_WRITE || !MEMVPD_READ) help Do not apply erepair information on the DMI bus during boot diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index 2e332c252..fe9970541 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -3758,7 +3758,7 @@ sub generate_mcs print " <targetInstance> <id>sys${sys}node${node}proc${proc}mcs$mcs</id> - <type>unit-mcs-power9</type> + <type>unit-mcs-$CHIPNAME</type> <attribute><id>HUID</id><default>${uidstr}</default></attribute> <attribute> <id>PHYS_PATH</id> @@ -3787,7 +3787,8 @@ sub generate_mcs <attribute> <id>EI_BUS_TX_MSBSWAP</id> <default>$msb_swap</default> - </attribute>"; + </attribute> + <attribute><id>VPD_REC_NUM</id><default>0</default></attribute>"; addPervasiveParentLink($sys,$node,$proc,$mcs,"mcs"); diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml index bf639e453..3c3dd541f 100644 --- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml @@ -218,7 +218,7 @@ <targetInstance> <id>sys0node0proc0eq0</id> <type>unit-eq-power9</type> - <attribute><id>HUID</id><default>0x00200000</default></attribute> + <attribute><id>HUID</id><default>0x00230000</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/eq-0</default> @@ -240,7 +240,7 @@ <targetInstance> <id>sys0node0proc0eq1</id> <type>unit-eq-power9</type> - <attribute><id>HUID</id><default>0x00200001</default></attribute> + <attribute><id>HUID</id><default>0x00230001</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/eq-1</default> @@ -262,7 +262,7 @@ <targetInstance> <id>sys0node0proc0eq2</id> <type>unit-eq-power9</type> - <attribute><id>HUID</id><default>0x00200002</default></attribute> + <attribute><id>HUID</id><default>0x00230002</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/eq-2</default> @@ -284,7 +284,7 @@ <targetInstance> <id>sys0node0proc0eq3</id> <type>unit-eq-power9</type> - <attribute><id>HUID</id><default>0x00200003</default></attribute> + <attribute><id>HUID</id><default>0x00230003</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/eq-3</default> @@ -306,7 +306,7 @@ <targetInstance> <id>sys0node0proc0eq4</id> <type>unit-eq-power9</type> - <attribute><id>HUID</id><default>0x00200004</default></attribute> + <attribute><id>HUID</id><default>0x00230004</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/eq-4</default> @@ -328,7 +328,7 @@ <targetInstance> <id>sys0node0proc0eq5</id> <type>unit-eq-power9</type> - <attribute><id>HUID</id><default>0x00200005</default></attribute> + <attribute><id>HUID</id><default>0x00230005</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/eq-5</default> @@ -1136,6 +1136,7 @@ <id>PARENT_PERVASIVE</id> <default>physical:sys-0/node-0/proc-0/perv-7</default> </attribute> + <attribute><id>VPD_REC_NUM</id><default>0</default></attribute> </targetInstance> <targetInstance> @@ -1164,6 +1165,7 @@ <id>PARENT_PERVASIVE</id> <default>physical:sys-0/node-0/proc-0/perv-7</default> </attribute> + <attribute><id>VPD_REC_NUM</id><default>0</default></attribute> </targetInstance> <targetInstance> @@ -1192,6 +1194,7 @@ <id>PARENT_PERVASIVE</id> <default>physical:sys-0/node-0/proc-0/perv-8</default> </attribute> + <attribute><id>VPD_REC_NUM</id><default>0</default></attribute> </targetInstance> <targetInstance> @@ -1220,13 +1223,14 @@ <id>PARENT_PERVASIVE</id> <default>physical:sys-0/node-0/proc-0/perv-8</default> </attribute> + <attribute><id>VPD_REC_NUM</id><default>0</default></attribute> </targetInstance> <!-- Nimbus n0p0mcs0 MCA units --> <targetInstance> <id>sys0node0proc0mcs0mca0</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0100</default></attribute> + <attribute><id>HUID</id><default>0x00240100</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-0/mca-0</default> @@ -1248,7 +1252,7 @@ <targetInstance> <id>sys0node0proc0mcs0mca1</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0101</default></attribute> + <attribute><id>HUID</id><default>0x00240101</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-0/mca-1</default> @@ -1271,7 +1275,7 @@ <targetInstance> <id>sys0node0proc0mcs1mca0</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0102</default></attribute> + <attribute><id>HUID</id><default>0x00240102</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-1/mca-0</default> @@ -1293,7 +1297,7 @@ <targetInstance> <id>sys0node0proc0mcs1mca1</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0103</default></attribute> + <attribute><id>HUID</id><default>0x00240103</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-1/mca-1</default> @@ -1316,7 +1320,7 @@ <targetInstance> <id>sys0node0proc0mcs2mca0</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0104</default></attribute> + <attribute><id>HUID</id><default>0x00240104</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-2/mca-0</default> @@ -1338,7 +1342,7 @@ <targetInstance> <id>sys0node0proc0mcs2mca1</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0105</default></attribute> + <attribute><id>HUID</id><default>0x00240105</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-2/mca-1</default> @@ -1361,7 +1365,7 @@ <targetInstance> <id>sys0node0proc0mcs3mca0</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0106</default></attribute> + <attribute><id>HUID</id><default>0x00240106</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-3/mca-0</default> @@ -1383,7 +1387,7 @@ <targetInstance> <id>sys0node0proc0mcs3mca1</id> <type>unit-mca-nimbus</type> - <attribute><id>HUID</id><default>0x000D0107</default></attribute> + <attribute><id>HUID</id><default>0x00240107</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcs-3/mca-1</default> @@ -1406,7 +1410,7 @@ <targetInstance> <id>sys0node0proc0mcbist0</id> <type>unit-mcbist-nimbus</type> - <attribute><id>HUID</id><default>0x000D0000</default></attribute> + <attribute><id>HUID</id><default>0x00250000</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcbist-0</default> @@ -1428,7 +1432,7 @@ <targetInstance> <id>sys0node0proc0mcbist1</id> <type>unit-mcbist-nimbus</type> - <attribute><id>HUID</id><default>0x000D0001</default></attribute> + <attribute><id>HUID</id><default>0x00250001</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/mcbist-1</default> @@ -1451,7 +1455,7 @@ <targetInstance> <id>sys0node0proc0pec0</id> <type>unit-pec-power9</type> - <attribute><id>HUID</id><default>0x000E0000</default></attribute> + <attribute><id>HUID</id><default>0x002D0000</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-0</default> @@ -1473,7 +1477,7 @@ <targetInstance> <id>sys0node0proc0pec1</id> <type>unit-pec-power9</type> - <attribute><id>HUID</id><default>0x000E0001</default></attribute> + <attribute><id>HUID</id><default>0x002D0001</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-1</default> @@ -1495,7 +1499,7 @@ <targetInstance> <id>sys0node0proc0pec2</id> <type>unit-pec-power9</type> - <attribute><id>HUID</id><default>0x000E0002</default></attribute> + <attribute><id>HUID</id><default>0x002D0002</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-2</default> @@ -1518,7 +1522,7 @@ <targetInstance> <id>sys0node0proc0pec0phb0</id> <type>unit-phb-nimbus</type> - <attribute><id>HUID</id><default>0x000E0100</default></attribute> + <attribute><id>HUID</id><default>0x002E0100</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-0/phb-0</default> @@ -1541,7 +1545,7 @@ <targetInstance> <id>sys0node0proc0pec1phb0</id> <type>unit-phb-nimbus</type> - <attribute><id>HUID</id><default>0x000E0101</default></attribute> + <attribute><id>HUID</id><default>0x002E0101</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-1/phb-0</default> @@ -1563,7 +1567,7 @@ <targetInstance> <id>sys0node0proc0pec1phb1</id> <type>unit-phb-nimbus</type> - <attribute><id>HUID</id><default>0x000E0102</default></attribute> + <attribute><id>HUID</id><default>0x002E0102</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-1/phb-1</default> @@ -1586,7 +1590,7 @@ <targetInstance> <id>sys0node0proc0pec2phb0</id> <type>unit-phb-nimbus</type> - <attribute><id>HUID</id><default>0x000E0103</default></attribute> + <attribute><id>HUID</id><default>0x002E0103</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-2/phb-0</default> @@ -1608,7 +1612,7 @@ <targetInstance> <id>sys0node0proc0pec2phb1</id> <type>unit-phb-nimbus</type> - <attribute><id>HUID</id><default>0x000E0104</default></attribute> + <attribute><id>HUID</id><default>0x002E0104</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-2/phb-1</default> @@ -1630,7 +1634,7 @@ <targetInstance> <id>sys0node0proc0pec2phb2</id> <type>unit-phb-nimbus</type> - <attribute><id>HUID</id><default>0x000E0105</default></attribute> + <attribute><id>HUID</id><default>0x002E0105</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/pec-2/phb-2</default> @@ -1653,7 +1657,7 @@ <targetInstance> <id>sys0node0proc0obus0</id> <type>unit-obus-nimbus</type> - <attribute><id>HUID</id><default>0x000E0200</default></attribute> + <attribute><id>HUID</id><default>0x002E0200</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/obus-0</default> @@ -1675,7 +1679,7 @@ <targetInstance> <id>sys0node0proc0obus3</id> <type>unit-obus-nimbus</type> - <attribute><id>HUID</id><default>0x000E0201</default></attribute> + <attribute><id>HUID</id><default>0x002E0201</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/obus-3</default> @@ -1698,7 +1702,7 @@ <targetInstance> <id>sys0node0proc0nv0</id> <type>unit-nv-nimbus</type> - <attribute><id>HUID</id><default>0x000E0300</default></attribute> + <attribute><id>HUID</id><default>0x002E0300</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/nv-0</default> @@ -1720,7 +1724,7 @@ <targetInstance> <id>sys0node0proc0nv1</id> <type>unit-nv-nimbus</type> - <attribute><id>HUID</id><default>0x000E0301</default></attribute> + <attribute><id>HUID</id><default>0x002E0301</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/nv-1</default> @@ -1744,7 +1748,7 @@ <targetInstance> <id>sys0node0proc0ppe0</id> <type>unit-ppe-nimbus</type> - <attribute><id>HUID</id><default>0x000E0400</default></attribute> + <attribute><id>HUID</id><default>0x002E0400</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/ppe-0</default> @@ -1762,7 +1766,7 @@ <targetInstance> <id>sys0node0proc0ppe1</id> <type>unit-ppe-nimbus</type> - <attribute><id>HUID</id><default>0x000E0401</default></attribute> + <attribute><id>HUID</id><default>0x002E0401</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/ppe-1</default> @@ -2828,7 +2832,7 @@ <targetInstance> <id>sys0node0proc0sbe0</id> <type>unit-sbe-nimbus</type> - <attribute><id>HUID</id><default>0x00220000</default></attribute> + <attribute><id>HUID</id><default>0x002A0000</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/sbe-0</default> @@ -2848,7 +2852,7 @@ <targetInstance> <id>sys0node0proc0occ0</id> <type>occ</type> - <attribute><id>HUID</id><default>0x00230000</default></attribute> + <attribute><id>HUID</id><default>0x00130000</default></attribute> <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0/occ-0</default> @@ -2881,4 +2885,492 @@ </attribute> </targetInstance> +<!-- DIMMS + id/physical is sys-0/node-0/dimm-[d] + where d=[0-31] + affinity is sys-0/node-0/proc-0/mcs-[j]/mca-[k]/dimm-[m] + where j=[0-3] k=[0-1] m=[0-3] +--> + +<targetInstance> + <id>sys0node0dimm0</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030000</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-0</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-0/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>0</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm1</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030001</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-1</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-0/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>1</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm2</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030002</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-2</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-0/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>2</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm3</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030003</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-3</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-0/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>3</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm4</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030004</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-4</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-1/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>4</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm5</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030005</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-5</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-1/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>5</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm6</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030006</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-6</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-1/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>7</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm7</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030007</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-7</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-0/mca-1/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>7</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm8</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030008</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-8</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-0/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>8</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm9</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030009</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-9</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-0/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>9</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm10</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003000A</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-10</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-0/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>10</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm11</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003000B</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-11</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-0/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>11</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm12</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003000C</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-12</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-1/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>12</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm13</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003000D</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-13</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-1/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>14</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm14</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003000E</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-14</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-1/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>14</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm15</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003000F</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-15</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-1/mca-1/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>15</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm16</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030010</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-16</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-0/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>16</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm17</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030017</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-17</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-0/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>17</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm18</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030012</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-18</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-0/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>18</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm19</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030013</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-19</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-0/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>19</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm20</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030014</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-20</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-1/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>20</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm21</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030015</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-21</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-1/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>21</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm22</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030016</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-22</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-1/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>22</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm23</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030017</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-23</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-2/mca-1/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>23</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm24</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030018</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-24</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-0/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>24</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm25</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x00030019</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-25</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-0/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>25</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm26</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003001A</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-26</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-0/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>26</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm27</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003001B</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-27</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-0/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>27</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm28</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003001C</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-28</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-1/dimm-0</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>28</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm29</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003001D</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-29</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-1/dimm-1</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>29</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm30</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003001E</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-30</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-1/dimm-2</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>30</default></attribute> +</targetInstance> + +<targetInstance> + <id>sys0node0dimm31</id> + <type>lcard-dimm-jedec</type> + <attribute><id>HUID</id><default>0x0003001F</default></attribute> + <attribute> + <id>PHYS_PATH</id> + <default>physical:sys-0/node-0/dimm-31</default> + </attribute> + <attribute> + <id>AFFINITY_PATH</id> + <default>affinity:sys-0/node-0/proc-0/mcs-3/mca-1/dimm-3</default> + </attribute> + <attribute><id>VPD_REC_NUM</id><default>31</default></attribute> +</targetInstance> + </attributes> + diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 9e1125653..1a8f7c192 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -311,7 +311,6 @@ <attribute><id>FORCE_USE_SBE_SLAVE_SCAN_SERVICE</id></attribute> <attribute><id>SBE_MASTER_INTR_SERVICE_DELAY_CYCLES</id></attribute> <attribute><id>SBE_MASTER_INTR_SERVICE_DELAY_US</id></attribute> - <attribute><id>CLEAR_DIMM_SPD_ENABLE</id></attribute> <attribute><id>MRW_MCS_PREFETCH_RETRY_THRESHOLD</id></attribute> <!-- AVP override for fused cores or normal cores --> <attribute><id>FUSED_CORE_OPTION</id></attribute> @@ -2261,6 +2260,8 @@ <id>MODEL</id> <default>NIMBUS</default> </attribute> + <attribute><id>EEPROM_VPD_PRIMARY_INFO</id></attribute> + <attribute><id>VPD_REC_NUM</id></attribute> </targetType> <!-- MCA diff --git a/src/usr/targeting/common/xmltohb/target_types_hb.xml b/src/usr/targeting/common/xmltohb/target_types_hb.xml index 5aa15470b..1207865f1 100755 --- a/src/usr/targeting/common/xmltohb/target_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/target_types_hb.xml @@ -75,6 +75,7 @@ <attribute><id>HTMGT_SAFEMODE</id></attribute> <attribute><id>IPMI_SENSORS</id></attribute> <attribute><id>IPMI_MAX_BUFFER_SIZE</id></attribute> + <attribute><id>CLEAR_DIMM_SPD_ENABLE</id></attribute> </targetTypeExtension> <targetTypeExtension> diff --git a/src/usr/vpd/HBconfig b/src/usr/vpd/HBconfig index 615a548e8..49d846757 100644 --- a/src/usr/vpd/HBconfig +++ b/src/usr/vpd/HBconfig @@ -1,37 +1,37 @@ -config CVPD_READ_FROM_PNOR +config MEMVPD_READ_FROM_PNOR default y help - Read Centaur VPD data from PNOR cache + Read memory VPD data from PNOR cache -config CVPD_READ_FROM_HW +config MEMVPD_READ_FROM_HW default n depends on !PALMETTO_PASS1 help - Read Centaur VPD data from HW resources + Read memory VPD data from HW resources -config CVPD_READ +config MEMVPD_READ default y - depends on CVPD_READ_FROM_PNOR || CVPD_READ_FROM_HW + depends on MEMVPD_READ_FROM_PNOR || MEMVPD_READ_FROM_HW help - Ensure at least one of the CVPD READs are enabled + Ensure at least one of the MEMVPD READs are enabled -config CVPD_WRITE_TO_PNOR - default y if CVPD_READ_FROM_PNOR - depends on CVPD_READ_FROM_PNOR +config MEMVPD_WRITE_TO_PNOR + default y if MEMVPD_READ_FROM_PNOR + depends on MEMVPD_READ_FROM_PNOR help - Write Centaur VPD data to PNOR cache + Write memory VPD data to PNOR cache -config CVPD_WRITE_TO_HW - default y if CVPD_READ_FROM_HW - depends on !PALMETTO_PASS1 && CVPD_READ_FROM_HW +config MEMVPD_WRITE_TO_HW + default y if MEMVPD_READ_FROM_HW + depends on !PALMETTO_PASS1 && MEMVPD_READ_FROM_HW help - Write Centaur VPD data to HW resources + Write memory VPD data to HW resources -config CVPD_WRITE +config MEMVPD_WRITE default y - depends on CVPD_WRITE_TO_PNOR || CVPD_WRITE_TO_HW + depends on MEMVPD_WRITE_TO_PNOR || MEMVPD_WRITE_TO_HW help - Ensure at least one of the CVPD WRITEs are enabled + Ensure at least one of the MEMVPD WRITEs are enabled config PVPD_READ_FROM_PNOR default n @@ -45,7 +45,7 @@ config PVPD_READ_FROM_HW config PVPD_WRITE_TO_PNOR default y if PVPD_READ_FROM_PNOR - depends on PVPD_READ_FROM_PNOR && CVPD_WRITE_TO_PNOR + depends on PVPD_READ_FROM_PNOR && MEMVPD_WRITE_TO_PNOR help Write Planar VPD data to PNOR cache @@ -122,8 +122,8 @@ config DJVPD_WRITE Ensure at least one of the DJVPD WRITEs are enabled config HAVE_MBVPD - default y if CVPD_READ_FROM_PNOR || CVPD_READ_FROM_HW - depends on (CVPD_READ_FROM_PNOR || CVPD_READ_FROM_HW) && !PALMETTO_PASS1 + default y if MEMVPD_READ_FROM_PNOR || MEMVPD_READ_FROM_HW + depends on (MEMVPD_READ_FROM_PNOR || MEMVPD_READ_FROM_HW) && !PALMETTO_PASS1 help Have MemBuff/Centaur VPD, PNOR or HW diff --git a/src/usr/vpd/cvpd.C b/src/usr/vpd/cvpd.C index fa37dc978..ea7e71680 100644 --- a/src/usr/vpd/cvpd.C +++ b/src/usr/vpd/cvpd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -197,7 +197,7 @@ namespace CVPD bool VPD::cvpdPresent( TARGETING::Target * i_target ) { TRACSSCOMP( g_trac_vpd, ENTER_MRK"cvpdPresent()"); -#if(defined( CONFIG_CVPD_READ_FROM_HW ) && !defined( __HOSTBOOT_RUNTIME) ) +#if(defined( CONFIG_MEMVPD_READ_FROM_HW ) && !defined( __HOSTBOOT_RUNTIME) ) return EEPROM::eepromPresence( i_target ); @@ -228,22 +228,22 @@ IpVpdFacade(CVPD::SECTION_SIZE, { TRACUCOMP(g_trac_vpd, "CvpdFacade::CvpdFacade> " ); -#ifdef CONFIG_CVPD_READ_FROM_PNOR +#ifdef CONFIG_MEMVPD_READ_FROM_PNOR iv_configInfo.vpdReadPNOR = true; #else iv_configInfo.vpdReadPNOR = false; #endif -#ifdef CONFIG_CVPD_READ_FROM_HW +#ifdef CONFIG_MEMVPD_READ_FROM_HW iv_configInfo.vpdReadHW = true; #else iv_configInfo.vpdReadHW = false; #endif -#ifdef CONFIG_CVPD_WRITE_TO_PNOR +#ifdef CONFIG_MEMVPD_WRITE_TO_PNOR iv_configInfo.vpdWritePNOR = true; #else iv_configInfo.vpdWritePNOR = false; #endif -#ifdef CONFIG_CVPD_WRITE_TO_HW +#ifdef CONFIG_MEMVPD_WRITE_TO_HW iv_configInfo.vpdWriteHW = true; #else iv_configInfo.vpdWriteHW = false; diff --git a/src/usr/vpd/dimmPres.C b/src/usr/vpd/dimmPres.C index 8c54eca75..a62d31f5e 100755 --- a/src/usr/vpd/dimmPres.C +++ b/src/usr/vpd/dimmPres.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -43,6 +43,7 @@ #include <vpd/spdenums.H> #include <config.h> #include <initservice/initserviceif.H> +#include <fsi/fsiif.H> #include "spd.H" @@ -90,16 +91,15 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, bool present = false; size_t presentSz = sizeof(present); - TRACSSCOMP( g_trac_spd, - ENTER_MRK"dimmPresenceDetect()" ); - + TRACSSCOMP( g_trac_spd, ENTER_MRK"dimmPresenceDetect() " + "DIMM HUID 0x%X", TARGETING::get_huid(i_target)); do { // Check to be sure that the buffer is big enough. if( !(io_buflen >= sizeof(bool)) ) { - TRACFCOMP( g_trac_spd, - ERR_MRK"dimmPresenceDetect() - Invalid Data Length: %d", + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "Invalid Data Length: %d", io_buflen ); /*@ @@ -124,45 +124,81 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, break; } - // Is the target present + // Is the target present? #ifdef CONFIG_DJVPD_READ_FROM_HW - // Check if the parent MBA/MEMBUF is present. If it is not then - // no reason to check the DIMM which would otherwise generate - // tons of FSI errors. We can't just check if parent MBA + // Check if the i2c master is present. + // If it is not then no reason to check the DIMM which would + // otherwise generate tons of FSI errors. + // We can't just check if parent MCA or MBA // is functional because DIMM presence detect is called before - // the parent MBA/MEMBUF is set as present/functional. - TARGETING::TargetHandleList membufList; - TARGETING::PredicateCTM membufPred( TARGETING::CLASS_CHIP, - TARGETING::TYPE_MEMBUF ); - TARGETING::targetService().getAssociated( - membufList, - i_target, - TARGETING::TargetService::PARENT_BY_AFFINITY, - TARGETING::TargetService::ALL, - &membufPred); - - bool parentPresent = false; - const TARGETING::TargetHandle_t membufTarget = *(membufList.begin()); - - err = deviceRead(membufTarget, &parentPresent, presentSz, - DEVICE_PRESENT_ADDRESS()); - if (err) + // the parent MCS/MCA or MBA/MEMBUF is set as present/functional. + bool l_i2cMasterPresent = false; + + do { - TRACFCOMP( - g_trac_spd, - "Error reading parent MEMBUF present: huid 0x%X DIMM huid 0x%X", - TARGETING::get_huid(membufTarget), - TARGETING::get_huid(i_target) ); - break; + // get eeprom vpd primary info + TARGETING::EepromVpdPrimaryInfo eepromData; + if( !(i_target-> + tryGetAttr<TARGETING::ATTR_EEPROM_VPD_PRIMARY_INFO> + ( eepromData ) ) ) + { + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "Error: no eeprom vpd primary info" ); + break; + } + + // find i2c master target + TARGETING::TargetService& tS = TARGETING::targetService(); + bool exists = false; + tS.exists( eepromData.i2cMasterPath, exists ); + if( !exists ) + { + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "i2cMasterPath attribute path doesn't exist"); + break; + } + + // Since it exists, convert to a target + TARGETING::Target * l_i2cMasterTarget = + tS.toTarget( eepromData.i2cMasterPath ); + + if( NULL == l_i2cMasterTarget ) + { + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "i2cMasterPath target is NULL"); + break; + } + TRACSSCOMP( g_trac_spd, "dimmPresenceDetect() " + "i2c master HUID 0x%X", TARGETING::get_huid(l_i2cMasterTarget)); + + // Check if present + TARGETING::Target* masterProcTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle( + masterProcTarget ); + // Master proc is taken as always present. Validate other targets. + if (l_i2cMasterTarget != masterProcTarget) + { + l_i2cMasterPresent = FSI::isSlavePresent(l_i2cMasterTarget); + if( !l_i2cMasterPresent ) + { + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "isSlavePresent failed"); + break; + } + } + l_i2cMasterPresent = true; } - if (!parentPresent) + while (0); + + if (!l_i2cMasterPresent) { present = false; // Invalidate the SPD in PNOR err = VPD::invalidatePnorCache(i_target); if (err) { - TRACFCOMP( g_trac_spd, "Error invalidating SPD in PNOR" ); + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "Error invalidating SPD in PNOR" ); } break; } @@ -172,13 +208,13 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, if( present == false ) { - TRACUCOMP( g_trac_spd, - INFO_MRK"Dimm was found to be NOT present." ); + TRACUCOMP( g_trac_spd, INFO_MRK"dimmPresenceDetect() " + "Dimm was found to be NOT present." ); } else { - TRACUCOMP( g_trac_spd, - INFO_MRK"Dimm was found to be present." ); + TRACUCOMP( g_trac_spd, INFO_MRK"dimmPresenceDetect() " + "Dimm was found to be present." ); } #if defined(CONFIG_DJVPD_READ_FROM_HW) && defined(CONFIG_DJVPD_READ_FROM_PNOR) @@ -189,8 +225,8 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, if( err ) { present = false; - - TRACFCOMP(g_trac_spd,ERR_MRK "dimmPresenceDetectt> Error during ensureCacheIsInSync (SPD)" ); + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "Error during ensureCacheIsInSync (SPD)" ); break; } } @@ -200,7 +236,8 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, err = VPD::invalidatePnorCache(i_target); if (err) { - TRACFCOMP( g_trac_spd, "Error invalidating SPD in PNOR" ); + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "Error invalidating SPD in PNOR" ); } } #endif @@ -221,7 +258,7 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, TARGETING::ATTR_CLEAR_DIMM_SPD_ENABLE_type l_clearSPD = l_sys->getAttr<TARGETING::ATTR_CLEAR_DIMM_SPD_ENABLE>(); - // If SPD clear is enabled then write 0's into magic word for + // If SPD clear is enabled then write 0's into magic word for // DIMM_BAD_DQ_DATA keyword // Note: If there's an error from performing the clearing, // just log the error and continue. @@ -234,7 +271,7 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, DEVICE_SPD_ADDRESS( DIMM_BAD_DQ_DATA )); if (err) { - TRACFCOMP(g_trac_spd, "dimmPresenceDetect - " + TRACFCOMP( g_trac_spd, ERR_MRK"dimmPresenceDetect() " "Error reading DIMM_BAD_DQ_DATA keyword size"); errlCommit( err, VPD_COMP_ID ); } @@ -252,9 +289,9 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, DEVICE_SPD_ADDRESS( DIMM_BAD_DQ_DATA )); if (err) { - TRACFCOMP( g_trac_spd, "Error trying to clear SPD on " - "DIMM HUID 0x%X", - TARGETING::get_huid(i_target)); + TRACFCOMP(g_trac_spd, ERR_MRK"dimmPresenceDetect() " + "Error trying to clear SPD on DIMM HUID 0x%X", + TARGETING::get_huid(i_target)); errlCommit( err, VPD_COMP_ID ); } @@ -273,8 +310,7 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, } while( 0 ); - TRACSSCOMP( g_trac_spd, - EXIT_MRK"dimmPresenceDetect()" ); + TRACSSCOMP( g_trac_spd, EXIT_MRK"dimmPresenceDetect()" ); return err; } // end dimmPresenceDetect diff --git a/src/usr/vpd/dvpd.C b/src/usr/vpd/dvpd.C new file mode 100644 index 000000000..b8c49a8ed --- /dev/null +++ b/src/usr/vpd/dvpd.C @@ -0,0 +1,375 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/vpd/dvpd.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +// ---------------------------------------------- +// Includes +// ---------------------------------------------- +#include <string.h> +#include <endian.h> +#include <trace/interface.H> +#include <errl/errlentry.H> +#include <errl/errlmanager.H> +#include <targeting/common/targetservice.H> +#include <targeting/common/util.H> +#include <targeting/common/utilFilter.H> +#include <devicefw/driverif.H> +#include <vfs/vfs.H> +#include <vpd/vpdreasoncodes.H> +#include <vpd/dvpdenums.H> +#include <vpd/vpd_if.H> +#include <i2c/eepromif.H> +#include <config.h> +#include "dvpd.H" +#include "cvpd.H" +#include "vpd.H" +#include <initservice/initserviceif.H> + + +// ---------------------------------------------- +// Trace definitions +// ---------------------------------------------- +extern trace_desc_t* g_trac_vpd; + + +// ------------------------ +// Macros for unit testing +//#define TRACUCOMP(args...) TRACFCOMP(args) +#define TRACUCOMP(args...) +//#define TRACSSCOMP(args...) TRACFCOMP(args) +#define TRACSSCOMP(args...) + +namespace DVPD +{ + // local functions + bool dvpdPresent ( TARGETING::Target * i_target ); + + // ---------------------------------------------- + // Globals + // ---------------------------------------------- + mutex_t g_mutex = MUTEX_INITIALIZER; + + + /** + * @brief This function will perform the steps required to do a read from + * the Hostboot DVPD data. + * + * @param[in] i_opType - Operation Type - See DeviceFW::OperationType in + * driververif.H + * + * @param[in] i_target - Processor Target device + * + * @param [in/out] io_buffer - Pointer to the data that was read from + * the target device. This parameter, when set to NULL, will return + * the keyword size value in io_buflen. + * + * @param [in/out] io_buflen - Length of the buffer to be read or written + * to/from the target. This value should indicate the size of the + * io_buffer parameter that has been allocated. Being returned it + * will indicate the number of valid bytes in the buffer being + * returned. This parameter will contain the size of a keyword when + * the io_buffer parameter is passed in NULL. + * + * @param [in] i_accessType - Access Type - See DeviceFW::AccessType in + * usrif.H + * + * @param [in] i_args - This is an argument list for the device driver + * framework. + * + * @return errlHndl_t - NULL if successful, otherwise a pointer to the + * error log. + */ + errlHndl_t dvpdRead ( DeviceFW::OperationType i_opType, + TARGETING::Target * i_target, + void * io_buffer, + size_t & io_buflen, + int64_t i_accessType, + va_list i_args ) + { + errlHndl_t err = NULL; + IpVpdFacade::input_args_t args; + args.record = ((dvpdRecord)va_arg( i_args, uint64_t )); + args.keyword = ((dvpdKeyword)va_arg( i_args, uint64_t )); + args.location = ((VPD::vpdCmdTarget)va_arg( i_args, uint64_t )); + + TRACSSCOMP( g_trac_vpd, + ENTER_MRK"dvpdRead()" ); + + err = Singleton<DvpdFacade>::instance().read(i_target, + io_buffer, + io_buflen, + args); + + return err; + } + + + /** + * @brief This function will perform the steps required to do a write to + * the Hostboot DVPD data. + * + * @param[in] i_opType - Operation Type - See DeviceFW::OperationType in + * driververif.H + * + * @param[in] i_target - Processor Target device + * + * @param [in/out] io_buffer - Pointer to the data that was read from + * the target device. It will also be used to contain data to + * be written to the device. + * + * @param [in/out] io_buflen - Length of the buffer to be read or written + * to/from the target. This value should indicate the size of the + * io_buffer parameter that has been allocated. Being returned it + * will indicate the number of valid bytes in the buffer being + * returned. + * + * @param [in] i_accessType - Access Type - See DeviceFW::AccessType in + * usrif.H + * + * @param [in] i_args - This is an argument list for the device driver + * framework. + * + * @return errlHndl_t - NULL if successful, otherwise a pointer to the + * error log. + */ + errlHndl_t dvpdWrite ( DeviceFW::OperationType i_opType, + TARGETING::Target * i_target, + void * io_buffer, + size_t & io_buflen, + int64_t i_accessType, + va_list i_args ) + { + errlHndl_t err = NULL; + IpVpdFacade::input_args_t args; + args.record = ((dvpdRecord)va_arg( i_args, uint64_t )); + args.keyword = ((dvpdKeyword)va_arg( i_args, uint64_t )); + args.location = ((VPD::vpdCmdTarget)va_arg( i_args, uint64_t )); + + TRACSSCOMP( g_trac_vpd, + ENTER_MRK"dvpdWrite()" ); + + + err = Singleton<DvpdFacade>::instance().write(i_target, + io_buffer, + io_buflen, + args); + + return err; + } + + // Register with the routing code + DEVICE_REGISTER_ROUTE( DeviceFW::READ, + DeviceFW::DVPD, + TARGETING::TYPE_MCS, + dvpdRead ); + DEVICE_REGISTER_ROUTE( DeviceFW::WRITE, + DeviceFW::DVPD, + TARGETING::TYPE_MCS, + dvpdWrite ); + +}; // end namespace DVPD + +#if !defined(__HOSTBOOT_RUNTIME) +// -------------------------------------------------------- +// Presence Detection +//--------------------------------------------------------- + +/** + * @brief Performs a presence detect operation on MCSs + * + * Although not a physical part, presence detect confirms access + * to direct access memory vpd. + * + * @param[in] i_opType Operation type, see DeviceFW::OperationType + * in driverif.H + * @param[in] i_target Presence detect target + * @param[in/out] io_buffer Read: Pointer to output data storage + * Write: Pointer to input data storage + * @param[in/out] io_buflen Input: size of io_buffer (in bytes, always 1) + * Output: Success = 1, Failure = 0 + * @param[in] i_accessType DeviceFW::AccessType enum (userif.H) + * @param[in] i_args This is an argument list for DD framework. + * In this function, there are no arguments. + * @return errlHndl_t + */ +errlHndl_t directMemoryPresenceDetect(DeviceFW::OperationType i_opType, + TARGETING::Target* i_target, + void* io_buffer, + size_t& io_buflen, + int64_t i_accessType, + va_list i_args) +{ + errlHndl_t l_errl = NULL; + bool dvpd_present = false; + + TRACSSCOMP(g_trac_vpd, + ENTER_MRK "directMemoryPresenceDetect"); + + if (unlikely(io_buflen < sizeof(bool))) + { + TRACFCOMP(g_trac_vpd, + ERR_MRK "directMemoryPresenceDetect> Invalid data length: %d", + io_buflen); + /*@ + * @errortype + * @moduleid VPD::VPD_DVPD_PRESENCEDETECT + * @reasoncode VPD::VPD_INVALID_LENGTH + * @userdata1 Data Length + * @devdesc presenceDetect> Invalid data length (!= 1 bytes) + */ + l_errl = + new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + VPD::VPD_DVPD_PRESENCEDETECT, + VPD::VPD_INVALID_LENGTH, + TO_UINT64(io_buflen), + true /*SW error*/); + io_buflen = 0; + return l_errl; + } + + dvpd_present = DVPD::dvpdPresent( i_target ); +#if defined(CONFIG_MEMVPD_READ_FROM_HW) && defined(CONFIG_MEMVPD_READ_FROM_PNOR) + if( dvpd_present ) + { + // Check if the VPD data in the PNOR matches the SEEPROM + l_errl = VPD::ensureCacheIsInSync( i_target ); + if( l_errl ) + { + TRACFCOMP(g_trac_vpd,ERR_MRK "nodePresenceDetect>" + " Error during ensureCacheIsInSync (DVPD)" ); + errlCommit( l_errl, FSI_COMP_ID ); + } + } + else + { + TRACFCOMP(g_trac_vpd, + ERR_MRK "directMemoryPresenceDetect> failed presence detect"); + + // Invalidate DVPD in the PNOR + l_errl = VPD::invalidatePnorCache(i_target); + if (l_errl) + { + TRACFCOMP( g_trac_vpd, "Error invalidating DVPD in PNOR" ); + errlCommit( l_errl, VPD_COMP_ID ); + } + } +#endif + + memcpy(io_buffer, &dvpd_present, sizeof(dvpd_present)); + io_buflen = sizeof(dvpd_present); + + TRACSSCOMP(g_trac_vpd, + EXIT_MRK "directMemoryPresenceDetect = %d",dvpd_present); + return NULL; +} + +// Register as the presence detect for MCSs. +DEVICE_REGISTER_ROUTE(DeviceFW::READ, + DeviceFW::PRESENT, + TARGETING::TYPE_MCS, + directMemoryPresenceDetect); +#endif + +bool DVPD::dvpdPresent( TARGETING::Target * i_target ) +{ + TRACSSCOMP( g_trac_vpd, ENTER_MRK"dvpdPresent()"); +#if(defined( CONFIG_MEMVPD_READ_FROM_HW ) && !defined( __HOSTBOOT_RUNTIME) ) + + return EEPROM::eepromPresence( i_target ); + +#else + return Singleton<DvpdFacade>::instance().hasVpdPresent( i_target, +//TODO RTC 144519 Update recod/keyword once records/keywords defined +// to be used as "sniff test" that vpd is readable. + CVPD::VEIR, + CVPD::PF ); +#endif +} + + +//DVPD Class Functions +/** + * @brief Constructor + * Planar VPD is included in the Centaur PNOR section. + * Including with Centaur vpd minimizes the number of PNOR sections. + */ +DvpdFacade::DvpdFacade() : +IpVpdFacade(DVPD::SECTION_SIZE, + DVPD::MAX_SECTIONS, + DVPD::dvpdRecords, + (sizeof(DVPD::dvpdRecords)/sizeof(DVPD::dvpdRecords[0])), + DVPD::dvpdKeywords, + (sizeof(DVPD::dvpdKeywords)/sizeof(DVPD::dvpdKeywords[0])), + PNOR::CENTAUR_VPD, // note use of CVPD + DVPD::g_mutex, + VPD::VPD_WRITE_MCS) // Direct access memory +{ + TRACUCOMP(g_trac_vpd, "DvpdFacade::DvpdFacade> " ); + +#ifdef CONFIG_MEMVPD_READ_FROM_PNOR + iv_configInfo.vpdReadPNOR = true; +#else + iv_configInfo.vpdReadPNOR = false; +#endif +#ifdef CONFIG_MEMVPD_READ_FROM_HW + iv_configInfo.vpdReadHW = true; +#else + iv_configInfo.vpdReadHW = false; +#endif +#ifdef CONFIG_MEMVPD_WRITE_TO_PNOR + iv_configInfo.vpdWritePNOR = true; +#else + iv_configInfo.vpdWritePNOR = false; +#endif +#ifdef CONFIG_MEMVPD_WRITE_TO_HW + iv_configInfo.vpdWriteHW = true; +#else + iv_configInfo.vpdWriteHW = false; +#endif +} +// Retrun lists of records that should be copied to pnor. +void DvpdFacade::getRecordLists( + const recordInfo* & o_list1VpdRecords, + uint64_t & o_list1RecSize, + const recordInfo* & o_list2VpdRecords, + uint64_t & o_list2RecSize) +{ + // Always return this object's list + o_list1VpdRecords = iv_vpdRecords; + o_list1RecSize = iv_recSize; + + // If the planar eeprom is being shared with direct memory vpd, + // then return the pvpd list as the secondlist. + // TODO RTC 144519 If there is a separate eeprom for planar + // and direct memory VPD, then list2 = NULL size=0; + // The pvpd and cvpd may need an update on what configs to check for + // sharing. +#ifdef CONFIG_PVPD_READ_FROM_PNOR + o_list2VpdRecords = Singleton<PvpdFacade>::instance().iv_vpdRecords; + o_list2RecSize = Singleton<PvpdFacade>::instance().iv_recSize; +#else + o_list2VpdRecords = NULL; + o_list2RecSize = 0; +#endif +} + diff --git a/src/usr/vpd/dvpd.H b/src/usr/vpd/dvpd.H new file mode 100644 index 000000000..8f0f3630b --- /dev/null +++ b/src/usr/vpd/dvpd.H @@ -0,0 +1,204 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/vpd/dvpd.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __DVPD_H +#define __DVPD_H + + +/** + * @file dvpd.H + * + * @brief Provides the interfaces for the DVPD device driver + * + */ + +// ---------------------------------------------- +// Includes +// ---------------------------------------------- +#include <errl/errlentry.H> +#include <vpd/dvpdenums.H> + +#include "ipvpd.H" +#include <config.h> + +namespace DVPD +{ + + enum + { + // For a given MCS we need selector*2 + MR + MT = + // 256*2 + 16*128 + 4*128 = 3KB. + // There can be up to 8 MCS units (2 Nimbus chips) sharing a + // single eeprom. So we would need 24KB per record. + MAX_SECTIONS = 8, + SECTION_SIZE = 0x8000, + }; + +//TODO RTC 144519 Replace with list of direct memory records and keywords +// from memory team. + /** + * @brief Conversion of DVPD Records to corresponding character + * representation. + */ + const IpVpdFacade::recordInfo dvpdRecords[] = + { + // ------------------------------------------------------------------- + // NOTE: This list must remain an ordered list! There is a + // testcase that checks this. When adding new entries to the + // list, be sure that the keyword in each entry (value 0) + // are in ascending order. + // ------------------------------------------------------------------- + { VEIR, "VEIR" }, + { VER0, "VER0" }, //Not currently used, but keep support + { MER0, "MER0" }, + { VSPD, "VSPD" }, + { VINI, "VINI" }, + { OPFR, "OPFR" }, + { VNDR, "VNDR" }, + { SPDX, "SPDX" }, + // ------------------------------------------------------------------- + // DO NOT USE!! This is for test purposes ONLY! + { DVPD_TEST_RECORD, "TEST" }, + // ------------------------------------------------------------------- + }; + + /** + * @brief Conversion of DVPD Keywords to corresponding character + * representation. + */ + const IpVpdFacade::keywordInfo dvpdKeywords[] = + { + // ------------------------------------------------------------------- + // NOTE: This list must remain an ordered list! There is a + // testcase that checks this. When adding new entries to + // the list, be sure that the keyword in each entry (value 0) + // are in ascending order. + // ------------------------------------------------------------------- + { pdI, "#I" }, + { PF, "PF" }, + { MT, "MT" }, + { MR, "MR" }, + { pdA, "#A" }, + { EL, "EL" }, + { LM, "LM" }, + { MW, "MW" }, + { MV, "MV" }, + { AM, "AM" }, + { VZ, "VZ" }, + { pdD, "#D" }, + { MX, "MX" }, + { DW, "DW" }, + { PN, "PN" }, + { SN, "SN" }, + { DR, "DR" }, + { CE, "CE" }, + { FN, "FN" }, + { CC, "CC" }, + { HE, "HE" }, + { CT, "CT" }, + { HW, "HW" }, + { VD, "VD" }, + { VN, "VN" }, + { VP, "VP" }, + { VS, "VS" }, + { M0, "M0" }, + { M1, "M1" }, + { M2, "M2" }, + { M3, "M3" }, + { M4, "M4" }, + { M5, "M5" }, + { M6, "M6" }, + { M7, "M7" }, + { M8, "M8" }, + { T1, "T1" }, + { T2, "T2" }, + { T4, "T4" }, + { T5, "T5" }, + { T6, "T6" }, + { T8, "T8" }, + { Q0, "Q0" }, + { Q1, "Q1" }, + { Q2, "Q2" }, + { Q3, "Q3" }, + { Q4, "Q4" }, + { Q5, "Q5" }, + { Q6, "Q6" }, + { Q7, "Q7" }, + { Q8, "Q8" }, + { K0, "K0" }, + { K1, "K1" }, + { K2, "K2" }, + { K3, "K3" }, + { K4, "K4" }, + { K5, "K5" }, + { K6, "K6" }, + { K7, "K7" }, + { K8, "K8" }, + { MM, "MM" }, + { SS, "SS" }, + { ET, "ET" }, + + // ------------------------------------------------------------------- + // DO NOT USE!! This is for test purposes ONLY! + { DVPD_TEST_KEYWORD, "XX" }, + // ------------------------------------------------------------------- + + //Common ipvpd + { FULL_RECORD, "FL"}, + }; + +}; // end DVPD namespace + +class DvpdFacade: public IpVpdFacade +{ + public: + + /** + * @brief Constructor + */ + DvpdFacade( ); + + private: + + /** + * @brief This function returns a primary and an alternate list of records + * that should be copied to pnor. The Alternate list is optional. + * + * @param[out] o_primaryVpdRecords - Pointer to array of VPD Records to use + * + * @param[out] o_primaryRecSize - Size of o_primaryVpdRecords array + * + * @param[out] o_altVpdRecords - Pointer to array of VPD Records to use + * + * @param[out] o_altRecSize - Size of o_altVpdRecords array + * + */ + void getRecordLists( + const recordInfo* & o_primaryVpdRecords, + uint64_t & o_primaryRecSize, + const recordInfo* & o_altVpdRecords, + uint64_t & o_altRecSize); + +}; +#endif // __DVPD_H diff --git a/src/usr/vpd/makefile b/src/usr/vpd/makefile index 3a0990a4e..482d927ff 100644 --- a/src/usr/vpd/makefile +++ b/src/usr/vpd/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2013,2015 +# Contributors Listed Below - COPYRIGHT 2013,2016 # [+] International Business Machines Corp. # # @@ -47,4 +47,7 @@ BINARY_FILES += $(IMGDIR)/procmvpd_p9n.dat:c459021cad3335d42274fbf151ecd3647d0df #Update to Centaur DD2.0 for CCIN 31E8 BINARY_FILES += $(IMGDIR)/cvpd.dat:2e33352ca95279b992927336567adf960dca7d46 +#Direct memory vpd +BINARY_FILES += $(IMGDIR)/dvpd.dat:2e33352ca95279b992927336567adf960dca7d46 + include ${ROOTPATH}/config.mk diff --git a/src/usr/vpd/pvpd.C b/src/usr/vpd/pvpd.C index 878e4b705..3acde7831 100644 --- a/src/usr/vpd/pvpd.C +++ b/src/usr/vpd/pvpd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -325,7 +325,7 @@ IpVpdFacade(CVPD::SECTION_SIZE, // note use of CVPD (sizeof(PVPD::pvpdKeywords)/sizeof(PVPD::pvpdKeywords[0])), PNOR::CENTAUR_VPD, // note use of CVPD PVPD::g_mutex, - VPD::VPD_WRITE_PLANAR) + VPD::VPD_WRITE_NODE) { TRACUCOMP(g_trac_vpd, "PvpdFacade::PvpdFacade> " ); @@ -367,7 +367,7 @@ void PvpdFacade::getRecordLists( // At thip point, if the node is be processed, then the mem buffs // might have not been discovered yet. If cvpd is being cached, then // include the cvpd list as the altnative. -#ifdef CONFIG_CVPD_READ_FROM_PNOR +#ifdef CONFIG_MEMVPD_READ_FROM_PNOR o_altVpdRecords = Singleton<CvpdFacade>::instance().iv_vpdRecords; o_altRecSize = Singleton<CvpdFacade>::instance().iv_recSize; #else diff --git a/src/usr/vpd/test/dvpdtest.H b/src/usr/vpd/test/dvpdtest.H new file mode 100755 index 000000000..c192d326c --- /dev/null +++ b/src/usr/vpd/test/dvpdtest.H @@ -0,0 +1,728 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/vpd/test/dvpdtest.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __DVPDTEST_H +#define __DVPDTEST_H + +/** + * @file dvpdtest.H + * + * @brief Test cases for DVPD code + */ +#include <sys/time.h> + +#include <cxxtest/TestSuite.H> +#include <errl/errlmanager.H> +#include <errl/errlentry.H> +#include <devicefw/driverif.H> +#include <targeting/common/predicates/predicatectm.H> + +#include <vpd/dvpdenums.H> +#include <vpd/vpdreasoncodes.H> +#include "../dvpd.H" +#include "../ipvpd.H" + +extern trace_desc_t* g_trac_vpd; + +using namespace TARGETING; + +/** + * @brief Structure to define record/keyword pairs for DVPD tests. + */ +struct dvpdTestData +{ + VPD::vpdRecord record; + VPD::vpdRecord keyword; +}; + +/** + * @brief Data sample to be used for DVPD testing. + */ +dvpdTestData dvpdData[] = +{ + { DVPD::VEIR, DVPD::pdI }, + { DVPD::MER0, DVPD::pdI }, + { DVPD::VSPD, DVPD::pdI }, + { DVPD::VSPD, DVPD::MT }, + { DVPD::VSPD, DVPD::MR }, + { DVPD::VSPD, DVPD::pdA }, + { DVPD::VSPD, DVPD::EL }, + { DVPD::VSPD, DVPD::LM }, + { DVPD::VSPD, DVPD::MW }, + { DVPD::VSPD, DVPD::MV }, + { DVPD::VSPD, DVPD::AM }, + { DVPD::VINI, DVPD::VZ }, + { DVPD::VSPD, DVPD::MX }, + +}; + +TARGETING::Target* getFunctionalMcsTarget() +{ + TARGETING::Target * theTarget = NULL; + TRACDCOMP( g_trac_vpd, + "getFunctionalMcsTarget() - Finding a functional MCS" ); + + // Get a list of functional MCS targets + TargetHandleList mcsList; + getAllChiplets(mcsList,TARGETING::TYPE_MCS); + + if( mcsList.size() ) + { + theTarget = mcsList[0]; + } + + return theTarget; +} + +class DVPDTest: public CxxTest::TestSuite +{ + public: + + /** + * @brief This function will test DVPD reads. + */ + void testDvpdRead ( void ) + { + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + uint64_t theRecord = 0x0; + uint64_t theKeyword = 0x0; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdRead()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, + "testDvpdRead() - No Functional Targets found!"); + break; + } + + uint8_t * theData = NULL; + size_t theSize = 0; + const uint32_t numCmds = sizeof(dvpdData)/sizeof(dvpdData[0]); + for( uint32_t curCmd = 0; curCmd < numCmds; curCmd++ ) + { + cmds++; + theRecord = (uint64_t)dvpdData[curCmd].record; + theKeyword = (uint64_t)dvpdData[curCmd].keyword; + err = deviceRead( theTarget, + NULL, + theSize, + DEVICE_DVPD_ADDRESS( theRecord, + theKeyword ) ); + + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdRead() - failure reading " + "keyword size!! rec: 0x%04x, kwd: 0x%04x", + theRecord, + theKeyword ); + TS_FAIL( "testDvpdRead() - " + "Failure reading keyword size!" ); + errlCommit( err, + VPD_COMP_ID ); + continue; + } + + theData = static_cast<uint8_t*>(malloc( theSize )); + + // Read record/keyword pair + err = deviceRead( theTarget, + theData, + theSize, + DEVICE_DVPD_ADDRESS( theRecord, + theKeyword ) ); + + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdRead() - Failure on Record: " + "0x%04x, keyword: 0x%04x, of size: 0x%04x " + "- test %d", + theRecord, + theKeyword, + theSize, curCmd ); + TS_FAIL( "testDvpdRead() - Failure during DVPD read!" ); + errlCommit( err, + VPD_COMP_ID ); + + // Free the data + if( NULL != theData ) + { + free( theData ); + theData = NULL; + } + continue; + } + + TRACDCOMP( g_trac_vpd, + INFO_MRK"testDvpdRead Results:" ); + for( uint32_t i = 0; i < theSize; i++ ) + { + TRACDCOMP( g_trac_vpd, + INFO_MRK" Byte[%d]: 0x%02x", + i, theData[i] ); + } + + // Free the data + if( NULL != theData ) + { + free( theData ); + theData = NULL; + } + } + } while( 0 ); + + TRACFCOMP( g_trac_vpd, + "testDvpdRead - %d/%d fails", + fails, cmds ); + } + + /** + * @brief This function will test DVPD writes. + */ + void testDvpdWrite ( void ) + { +#ifndef __HOSTBOOT_RUNTIME + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + uint8_t* testData = NULL; + uint8_t* origData = NULL; + uint8_t* verifyData = NULL; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdWrite()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, + "testDvpdWrite() - No Functional Targets found!"); + break; + } + + // first figure out how big the keyword is + cmds++; + size_t theSize = 0; + err = deviceRead( theTarget, + testData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) ); + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdWrite() - " + "failure getting size of VEIR/#I, RC=%.4X", + err->reasonCode() ); + TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" ); + errlCommit( err, + VPD_COMP_ID ); + continue; + } + + // save off the original data + origData = new uint8_t[theSize]; + cmds++; + err = deviceRead( theTarget, + origData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) ); + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdWrite() - " + "failure reading VEIR/#I, RC=%.4X", + err->reasonCode() ); + TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" ); + errlCommit( err, + VPD_COMP_ID ); + continue; + } + TRACFBIN( g_trac_vpd, "testDvpdWrite() - orig=", + origData, theSize ); + + // fill it up with some dummy data + testData = new uint8_t[theSize]; + for( size_t x=0; x<theSize; x++ ) + { + testData[x] = x; + } + + // write the new data in + cmds++; + err = deviceWrite( theTarget, + testData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) ); + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdWrite() - " + "failure writing VEIR/#I, RC=%.4X", + err->reasonCode() ); + TS_FAIL( "testDvpdWrite() - Failure calling deviceWrite!" ); + errlCommit( err, + VPD_COMP_ID ); + continue; + } + + // verify the data got written + cmds++; + verifyData = new uint8_t[theSize]; + err = deviceRead( theTarget, + verifyData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) ); + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdWrite() - " + "failure reading VEIR/#I to verify, RC=%.4X", + err->reasonCode() ); + TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" ); + errlCommit( err, + VPD_COMP_ID ); + continue; + } + TRACFBIN( g_trac_vpd, "testDvpdWrite() - verif=", + verifyData, theSize ); + + // compare what we read to what we wrote + if( memcmp( testData, verifyData, theSize ) ) + { + fails++; + TRACFBIN( g_trac_vpd, "testDvpdWrite() - wrote=", + testData, theSize ); + TRACFBIN( g_trac_vpd, "testDvpdWrite() - read=", + verifyData, theSize ); + TS_FAIL( "testDvpdWrite - Data mismatch!" ); + } + + // put the original data back to be a good citizen + cmds++; + err = deviceWrite( theTarget, + origData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) ); + if( err ) + { + fails++; + TRACFCOMP( g_trac_vpd, + ERR_MRK"testDvpdWrite() - " + "failure writing original data back into VEIR/#I, RC=%.4X", + err->reasonCode() ); + TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" ); + errlCommit( err, + VPD_COMP_ID ); + continue; + } + + } while( 0 ); + + if( NULL != testData ) + { + delete[] testData; + testData = NULL; + } + + if( NULL != origData ) + { + delete[] origData; + origData = NULL; + } + + if( NULL != verifyData ) + { + delete[] verifyData; + verifyData = NULL; + } + + if( cmds == 0 ) + { + TRACFCOMP(g_trac_vpd, "testDvpdWrite - No tests ran, something is wrong..."); + } + + TRACFCOMP( g_trac_vpd, + "testDvpdWrite - %d/%d fails", + fails, cmds ); +#endif + } + + /** + * @brief This function will test that an error is generated when a + * record is passed in that cannot be found in the structure + * that defines the Records string representation. + */ + void testDvpdInvalidRecord ( void ) + { + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdInvalidRecord()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, "testDvpdInvalidRecord() No Functional Targets found!"); + break; + } + + + size_t theSize = 1; + uint8_t * theData = new uint8_t[theSize]; + + cmds++; + err = deviceRead( theTarget, + theData, + theSize, + DEVICE_DVPD_ADDRESS( DVPD::DVPD_LAST_RECORD, + DVPD::pdI ) ); + + if( NULL == err ) + { + fails++; + TS_FAIL( "testDvpdInvalidRecord() - Error expected with " + "record of type DVPD_LAST_RECORD (0x%04x), but " + "no error returned!", + DVPD::DVPD_LAST_RECORD ); + } + else + { + delete err; + err = NULL; + } + + if( NULL != theData ) + { + delete theData; + theData = NULL; + } + } while( 0 ); + + TRACFCOMP( g_trac_vpd, + "testDvpdInvalidRecord - %d/%d fails", + fails, cmds ); + } + + /** + * @brief This function will test for a record which is not in the TOC + * of the DVPD area. + */ + void testDvpdMissingRecord ( void ) + { + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdMissingRecord()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, "testDvpdMissingRecord() - No Functional Targets found!"); + break; + } + + size_t theSize = 1; + uint8_t * theData = new uint8_t[theSize]; + + cmds++; + err = deviceRead( theTarget, + theData, + theSize, + DEVICE_DVPD_ADDRESS( DVPD::DVPD_TEST_RECORD, + DVPD::pdI ) ); + + if( NULL == err ) + { + fails++; + TS_FAIL( "testDvpdMissingRecord() - "); + } + else + { + delete err; + err = NULL; + } + + if( NULL != theData ) + { + delete theData; + theData = NULL; + } + } while( 0 ); + + TRACFCOMP( g_trac_vpd, + "testDvpdMissingRecord - %d/%d fails", + fails, cmds ); + } + + /** + * @brief This function will test for a keyword that cannot be found + * in the expected record + */ + void testDvpdMissingKeyword ( void ) + { + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdMissingKeyword()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, "testDvpdMissingKeyword() - No Functional Targets found!"); + break; + } + + size_t theSize = 1; + uint8_t * theData = new uint8_t[theSize]; + + cmds++; + err = deviceRead(theTarget, + theData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::DVPD_FIRST_RECORD, + DVPD::DVPD_TEST_KEYWORD)); + + if( NULL == err ) + { + fails++; + TS_FAIL("testDvpdMissingKeyword() - Expected error from " + "invalid Keyword missing from associated record!"); + } + else + { + delete err; + err = NULL; + } + + if( NULL != theData ) + { + delete theData; + theData = NULL; + } + } while( 0 ); + + TRACFCOMP( g_trac_vpd, + "testDvpdMissingKeyword - %d/%d fails", + fails, cmds ); + } + + /** + * @brief This function will test that an error is generated when a + * keyword is passed in that cannot be found in the structure + * that defines the Keywords string representation. + */ + void testDvpdInvalidKeyword ( void ) + { + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdInvalidKeyword()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, "testDvpdInvalidKeyword() - No Functional Targets found!"); + break; + } + + size_t theSize = 1; + uint8_t * theData = new uint8_t[theSize]; + + cmds++; + err = deviceRead(theTarget, + theData, + theSize, + DEVICE_DVPD_ADDRESS(DVPD::VEIR, + DVPD::DVPD_LAST_KEYWORD)); + + if( NULL == err ) + { + fails++; + TS_FAIL( "testDvpdInvalidKeyword() - Error expected with " + "keyword of type DVPD_LAST_KEYWORD (0x%04x), but " + "no error returned!", + DVPD::DVPD_LAST_KEYWORD ); + } + else + { + delete err; + err = NULL; + } + + if( NULL != theData ) + { + delete theData; + theData = NULL; + } + } while( 0 ); + + TRACFCOMP( g_trac_vpd, + "testDvpdInvalidKeyword - %d/%d fails", + fails, cmds ); + } + + /** + * @brief This function will test that an error is generated when a + * buffer that has an insufficient size is passed in to read a + * record/keyword. + */ + void testDvpdInvalidBufferSize ( void ) + { + errlHndl_t err = NULL; + uint64_t cmds = 0x0; + uint64_t fails = 0x0; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdInvalidBufferSize()" ); + + do + { + TARGETING::Target * theTarget = getFunctionalMcsTarget(); + if(theTarget == NULL) + { + TRACFCOMP(g_trac_vpd, "testDvpdInvalidBufferSize() - No Functional Targets found!"); + break; + } + + uint8_t * theData = new uint8_t[1]; + size_t theSize = 0; + + cmds++; + err = deviceRead( theTarget, + theData, + theSize, + DEVICE_DVPD_ADDRESS( DVPD::VEIR, + DVPD::pdI ) ); + + if( NULL == err ) + { + fails++; + TS_FAIL( "testDvpdInvalidBufferSize() - Error was expected " + "for an invalid size of 0x0 for a DVPD read!" ); + } + else + { + delete err; + err = NULL; + } + + if( NULL != theData ) + { + delete theData; + theData = NULL; + } + } while( 0 ); + + TRACFCOMP( g_trac_vpd, + "testDvpdInvalidBufferSize - %d/%d fails", + fails, cmds ); + } + + /** + * @brief This function will test the numerical order of the dvpdRecords + * and dvpdKeywords structures. + */ + void testDvpdCheckStructOrder ( void ) + { + uint64_t fails = 0x0; + VPD::vpdRecord prevRecord = DVPD::DVPD_FIRST_RECORD; + VPD::vpdKeyword prevKeyword = DVPD::DVPD_FIRST_KEYWORD; + + TRACFCOMP( g_trac_vpd, + ENTER_MRK"testDvpdCheckStructOrder()" ); + + // Check the dvpdRecords structure for proper order + uint32_t entry = 0x0; + for( entry = 0; + entry < (sizeof(DVPD::dvpdRecords)/ + sizeof(DVPD::dvpdRecords[0])); + entry++ ) + { + if( !(DVPD::dvpdRecords[entry].record >= prevRecord) ) + { + fails++; + TS_FAIL( "testDvpdCheckStructOrder() - Record table out of " + "order! Cur Record: 0x%04x, Prev Record: 0x%04x", + DVPD::dvpdRecords[entry].record, + prevRecord ); + } + prevRecord = DVPD::dvpdRecords[entry].record; + } + + // Check the dvpdKeywords structure for proper order + for( entry = 0; + entry < (sizeof(DVPD::dvpdKeywords)/ + sizeof(DVPD::dvpdKeywords[0])); + entry++ ) + { + if( !(DVPD::dvpdKeywords[entry].keyword >= prevKeyword) ) + { + fails++; + TS_FAIL( "testDvpdCheckStructOrder() - " + "Keyword table out of order! Cur Keyword: 0x%04x, Prev Keyword: 0x%04x", + DVPD::dvpdKeywords[entry].keyword, + prevKeyword ); + } + prevKeyword = DVPD::dvpdKeywords[entry].keyword; + } + + TRACFCOMP( g_trac_vpd, + "testDvpdCheckStructOrder - %d fails", + fails ); + } +}; + +#endif diff --git a/src/usr/vpd/test/makefile b/src/usr/vpd/test/makefile index 3902c51b9..85a0f9441 100644 --- a/src/usr/vpd/test/makefile +++ b/src/usr/vpd/test/makefile @@ -27,7 +27,7 @@ ROOTPATH = ../../../.. MODULE = testvpd #TESTS = *.H -TESTS += spdtest.H dimmPrestest.H cvpdtest.H +TESTS += spdtest.H dimmPrestest.H cvpdtest.H dvpdtest.H #@TODO: RTC 131121 Reenable mvpd test cases after mvpd available #TEST += mvpdtest.H include ${ROOTPATH}/config.mk diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C index 75a090577..b39361b45 100755 --- a/src/usr/vpd/vpd.C +++ b/src/usr/vpd/vpd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -485,7 +485,7 @@ errlHndl_t getPnAndSnRecordAndKeywords( TARGETING::Target * i_target, } else if( i_type == TARGETING::TYPE_MEMBUF ) { -#if defined(CONFIG_CVPD_READ_FROM_HW) && defined(CONFIG_CVPD_READ_FROM_PNOR) +#if defined(CONFIG_MEMVPD_READ_FROM_HW) && defined(CONFIG_MEMVPD_READ_FROM_PNOR) IpVpdFacade* l_ipvpd = &(Singleton<CvpdFacade>::instance()); io_record = CVPD::OPFR; io_keywordPN = CVPD::VP; diff --git a/src/usr/vpd/vpd.H b/src/usr/vpd/vpd.H index 1451feae8..99340c0cd 100644 --- a/src/usr/vpd/vpd.H +++ b/src/usr/vpd/vpd.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,7 +50,8 @@ enum VPD_MSG_TYPE VPD_WRITE_DIMM = 0x00C1, //< DIMM SPD VPD_WRITE_PROC = 0x00C2, //< Processor MVPD VPD_WRITE_MEMBUF = 0x00C3, //< Centaur FRU VPD - VPD_WRITE_PLANAR = 0x00C4, //< Planar VPD + VPD_WRITE_NODE = 0x00C4, //< Planar VPD + VPD_WRITE_MCS = 0x00C5, //< Direct access memory VPD }; /** diff --git a/src/usr/vpd/vpd.mk b/src/usr/vpd/vpd.mk index a541ccc7e..58702127e 100644 --- a/src/usr/vpd/vpd.mk +++ b/src/usr/vpd/vpd.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2013,2015 +# Contributors Listed Below - COPYRIGHT 2013,2016 # [+] International Business Machines Corp. # # @@ -28,5 +28,6 @@ OBJS += ipvpd.o OBJS += mvpd.o OBJS += cvpd.o OBJS += pvpd.o +OBJS += dvpd.o OBJS += spd.o OBJS += errlud_vpd.o |