From 0f94c2620c702c36cd179af9231b9ea4a611a911 Mon Sep 17 00:00:00 2001 From: Swathi Madhuri Bhattiprolu Date: Thu, 2 Nov 2017 03:38:06 -0500 Subject: Support CDIMM VPD Change-Id: I85c100c319f114ae00009d4b5055910851a13f50 RTC:176407 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49128 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Prachi Gupta Reviewed-by: Daniel M. Crowell Reviewed-by: William G. Hoffa --- .../targeting/common/xmltohb/attribute_types.xml | 30 ++++++++++++++++++++++ src/usr/targeting/common/xmltohb/target_types.xml | 2 ++ src/usr/vpd/HBconfig | 5 ---- src/usr/vpd/cvpd.C | 21 ++++++++++++--- src/usr/vpd/cvpd.H | 14 ---------- src/usr/vpd/dvpd.C | 8 +++--- src/usr/vpd/ipvpd.C | 11 ++++---- src/usr/vpd/ipvpd.H | 10 +------- src/usr/vpd/makefile | 17 +++++++----- src/usr/vpd/memd_vpd.C | 6 ++--- src/usr/vpd/mvpd.C | 9 ++++--- src/usr/vpd/pvpd.C | 18 ++++++++++--- 12 files changed, 94 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 66f489f49..2fdf78e54 100755 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -1741,6 +1741,36 @@ + + CVPD_SIZE + Size of CDIMM/ISDIMM + This is the size of the centaur vpd or memory buffer vpd. + It varies based on the type of the DIMM. For ISDIMMs, + the size will be 8KB and for CDIMM, it will be 4KB. + + + + 0x2000 + + + non-volatile + + + + + + CVPD_MAX_SECTIONS + Max CVPD sections + + + 32 + + + non-volatile + + + + Base Address of RNG IO Region diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 800751b69..1ee961e85 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -532,6 +532,8 @@ PCI_REFCLOCK_RCVR_TERM SYNC_BETWEEN_STEPS MIRROR_BASE_ADDRESS + CVPD_SIZE + CVPD_MAX_SECTIONS SYS CLASS diff --git a/src/usr/vpd/HBconfig b/src/usr/vpd/HBconfig index 131f9cd74..70c533dd2 100644 --- a/src/usr/vpd/HBconfig +++ b/src/usr/vpd/HBconfig @@ -136,8 +136,3 @@ config PALMETTO_PASS1 default n help Palmetto pass1 specific changes - -config CDIMM_FORMAT_FOR_CVPD - default n - help - Assume Custom DIMM VPD layout for CVPD diff --git a/src/usr/vpd/cvpd.C b/src/usr/vpd/cvpd.C index ea7e71680..7576009eb 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,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -216,9 +216,7 @@ bool VPD::cvpdPresent( TARGETING::Target * i_target ) * @brief Constructor */ CvpdFacade::CvpdFacade() : -IpVpdFacade(CVPD::SECTION_SIZE, - CVPD::MAX_SECTIONS, - CVPD::cvpdRecords, +IpVpdFacade(CVPD::cvpdRecords, (sizeof(CVPD::cvpdRecords)/sizeof(CVPD::cvpdRecords[0])), CVPD::cvpdKeywords, (sizeof(CVPD::cvpdKeywords)/sizeof(CVPD::cvpdKeywords[0])), @@ -248,6 +246,21 @@ IpVpdFacade(CVPD::SECTION_SIZE, #else iv_configInfo.vpdWriteHW = false; #endif + + +// Get System Target +TARGETING::Target* sysTgt = NULL; +TARGETING::targetService().getTopLevelTarget(sysTgt); + +assert(sysTgt != NULL,"CvpdFacade: " + "System target was NULL."); + +iv_vpdSectionSize = sysTgt->getAttr(); + +iv_vpdMaxSections = sysTgt->getAttr(); + +TRACDCOMP( g_trac_vpd, "CvpdFacade VpdSectionSize: %d" + "MaxSections: %d ", iv_vpdSectionSize,iv_vpdMaxSections); } // Retrun lists of records that should be copied to pnor. diff --git a/src/usr/vpd/cvpd.H b/src/usr/vpd/cvpd.H index e5eec6f6e..73c54128d 100644 --- a/src/usr/vpd/cvpd.H +++ b/src/usr/vpd/cvpd.H @@ -45,20 +45,6 @@ namespace CVPD { - enum - { -#ifdef CONFIG_CDIMM_FORMAT_FOR_CVPD - // 4KB x 64 - SECTION_SIZE = 0x1000, - MAX_SECTIONS = 64, -#else - // 8KB x 32 - SECTION_SIZE = 0x2000, - MAX_SECTIONS = 32, -#endif - }; - - /** * @brief Conversion of CVPD Records to corresponding character * representation. diff --git a/src/usr/vpd/dvpd.C b/src/usr/vpd/dvpd.C index 4962d12ed..8adf670f7 100644 --- a/src/usr/vpd/dvpd.C +++ b/src/usr/vpd/dvpd.C @@ -306,9 +306,7 @@ bool DVPD::dvpdPresent( TARGETING::Target * i_target ) * Including with Centaur vpd minimizes the number of PNOR sections. */ DvpdFacade::DvpdFacade() : -IpVpdFacade(DVPD::SECTION_SIZE, - DVPD::MAX_SECTIONS, - DVPD::dvpdRecords, +IpVpdFacade(DVPD::dvpdRecords, (sizeof(DVPD::dvpdRecords)/sizeof(DVPD::dvpdRecords[0])), DVPD::dvpdKeywords, (sizeof(DVPD::dvpdKeywords)/sizeof(DVPD::dvpdKeywords[0])), @@ -338,6 +336,10 @@ IpVpdFacade(DVPD::SECTION_SIZE, #else iv_configInfo.vpdWriteHW = false; #endif + +iv_vpdSectionSize = DVPD::SECTION_SIZE; +iv_vpdMaxSections = DVPD::MAX_SECTIONS; + } // Retrun lists of records that should be copied to pnor. void DvpdFacade::getRecordLists( diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C index 7c28f5d80..c62c8355f 100644 --- a/src/usr/vpd/ipvpd.C +++ b/src/usr/vpd/ipvpd.C @@ -73,18 +73,14 @@ uint64_t MEMD_HEADER_SIZE = sizeof(MemdHeader_t); /** * @brief Constructor */ -IpVpdFacade::IpVpdFacade(uint64_t i_vpdSectionSize, - uint64_t i_vpdMaxSections, - const recordInfo* i_vpdRecords, +IpVpdFacade::IpVpdFacade(const recordInfo* i_vpdRecords, uint64_t i_recSize, const keywordInfo* i_vpdKeywords, uint64_t i_keySize, PNOR::SectionId i_pnorSection, mutex_t i_mutex, VPD::VPD_MSG_TYPE i_vpdMsgType ) -:iv_vpdSectionSize(i_vpdSectionSize) -,iv_vpdMaxSections(i_vpdMaxSections) -,iv_vpdRecords(i_vpdRecords) +:iv_vpdRecords(i_vpdRecords) ,iv_recSize(i_recSize) ,iv_vpdKeywords(i_vpdKeywords) ,iv_keySize(i_keySize) @@ -98,6 +94,9 @@ IpVpdFacade::IpVpdFacade(uint64_t i_vpdSectionSize, iv_configInfo.vpdReadHW = false; iv_configInfo.vpdWritePNOR = false; iv_configInfo.vpdWriteHW = false; + iv_vpdSectionSize = 0; + iv_vpdMaxSections = 0; + TRACUCOMP(g_trac_vpd, "IpVpdFacade::IpVpdFacade> " ); } diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H index 35bc6cac8..4797cb317 100644 --- a/src/usr/vpd/ipvpd.H +++ b/src/usr/vpd/ipvpd.H @@ -132,12 +132,6 @@ class IpVpdFacade /** * @brief Constructor * - * @param[in] i_vpdSectionSize - Space allocated in PNOR for each - * instance of the current chip. - * - * @param[in] i_vpdMaxSections - Number of sections allocated in PNOR - * for the current chip. - * * @param[in] i_vpdRecords - Pointer to array of VPD Records to use * * @param[in] i_recSize - size of i_vpdRecords array @@ -156,9 +150,7 @@ class IpVpdFacade * data to FSP * */ - IpVpdFacade(uint64_t i_vpdSectionSize, - uint64_t i_vpdMaxSections, - const recordInfo* i_vpdRecords, + IpVpdFacade(const recordInfo* i_vpdRecords, uint64_t i_recSize, const keywordInfo* i_vpdKeywords, uint64_t i_keySize, diff --git a/src/usr/vpd/makefile b/src/usr/vpd/makefile index 72641004a..105beab63 100644 --- a/src/usr/vpd/makefile +++ b/src/usr/vpd/makefile @@ -39,7 +39,7 @@ OBJS += rtvpd_load.o SUBDIRS += test.d SUBDIRS += runtime.d -BINARY_FILES = $(IMGDIR)/dimmspd.dat:9852a0ed166442ef69ecd91a0379f282419a371f + #Updated mvpd to contain VRML so that part/serial numbers can be #found for procs CCIN 54E3 BINARY_FILES += $(IMGDIR)/procmvpd.dat:65759fa4aebd2e3b42b25309504a3007b3b51036 @@ -55,13 +55,16 @@ BINARY_FILES += $(IMGDIR)/procmvpd_p9n.dat:a351f3cd5ba8a81a50c3e5a0dea5fea03e557 BINARY_FILES += $(IMGDIR)/procmvpd_p9c.dat:423208204c2f0e759610f4f39243362fd4b6d103 #Update to Centaur DD2.0 for CCIN 31E8 -ifdef CONFIG_CDIMM_FORMAT_FOR_CVPD -#download 4k cvpd file -BINARY_FILES += $(IMGDIR)/cvpd.dat:2e33352ca95279b992927336567adf960dca7d46 -else -#download 8k cvpd file + +# CDIMM Format - download 4k cvpd file +#BINARY_FILES += $(IMGDIR)/cvpd.dat:2e33352ca95279b992927336567adf960dca7d46 +#BINARY_FILES += $(IMGDIR)/dimmspd.dat:e9bd99127597db1d20342d9953f3075c9079e0d2 + + +# ISDIMM Format - download 8k cvpd file BINARY_FILES += $(IMGDIR)/cvpd.dat:af41c35b5a10f309f2519a871204936a2129e5ea -endif +BINARY_FILES += $(IMGDIR)/dimmspd.dat:9852a0ed166442ef69ecd91a0379f282419a371f + #Direct memory vpd BINARY_FILES += $(IMGDIR)/dvpd.dat:9292032f653710f92bbeb56b39582b2d0e5296b7 diff --git a/src/usr/vpd/memd_vpd.C b/src/usr/vpd/memd_vpd.C index 22147100e..08f122d03 100644 --- a/src/usr/vpd/memd_vpd.C +++ b/src/usr/vpd/memd_vpd.C @@ -194,9 +194,7 @@ namespace MEMD_VPD * Including with Centaur vpd minimizes the number of PNOR sections. */ MEMD_VpdFacade::MEMD_VpdFacade() : -IpVpdFacade(MEMD_VPD::SECTION_SIZE, - MEMD_VPD::MAX_SECTIONS, - MEMD_VPD::MEMD_VPDRecords, +IpVpdFacade(MEMD_VPD::MEMD_VPDRecords, (sizeof(MEMD_VPD::MEMD_VPDRecords)/sizeof( MEMD_VPD::MEMD_VPDRecords[0])), MEMD_VPD::MEMD_VPDKeywords, @@ -212,6 +210,8 @@ IpVpdFacade(MEMD_VPD::SECTION_SIZE, iv_configInfo.vpdReadHW = false; iv_configInfo.vpdWritePNOR = false; iv_configInfo.vpdWriteHW = false; + iv_vpdSectionSize = MEMD_VPD::SECTION_SIZE; + iv_vpdMaxSections = MEMD_VPD::MAX_SECTIONS; } /** diff --git a/src/usr/vpd/mvpd.C b/src/usr/vpd/mvpd.C index 76204e5e7..4de720594 100644 --- a/src/usr/vpd/mvpd.C +++ b/src/usr/vpd/mvpd.C @@ -205,9 +205,7 @@ bool VPD::mvpdPresent( TARGETING::Target * i_target ) * @brief Constructor */ MvpdFacade::MvpdFacade() : -IpVpdFacade(MVPD::SECTION_SIZE, - MVPD::MAX_SECTIONS, - MVPD::mvpdRecords, +IpVpdFacade(MVPD::mvpdRecords, (sizeof(MVPD::mvpdRecords)/sizeof(MVPD::mvpdRecords[0])), MVPD::mvpdKeywords, (sizeof(MVPD::mvpdKeywords)/sizeof(MVPD::mvpdKeywords[0])), @@ -237,5 +235,10 @@ IpVpdFacade(MVPD::SECTION_SIZE, #else iv_configInfo.vpdWriteHW = false; #endif + + iv_vpdSectionSize = MVPD::SECTION_SIZE; + + iv_vpdMaxSections = MVPD::MAX_SECTIONS; + } diff --git a/src/usr/vpd/pvpd.C b/src/usr/vpd/pvpd.C index c97837bf8..f58e795cd 100644 --- a/src/usr/vpd/pvpd.C +++ b/src/usr/vpd/pvpd.C @@ -319,9 +319,7 @@ bool VPD::pvpdPresent( TARGETING::Target * i_target ) * Including with Centaur vpd minimizes the number of PNOR sections. */ PvpdFacade::PvpdFacade() : -IpVpdFacade(CVPD::SECTION_SIZE, // note use of CVPD - CVPD::MAX_SECTIONS, // note use of CVPD - PVPD::pvpdRecords, +IpVpdFacade(PVPD::pvpdRecords, (sizeof(PVPD::pvpdRecords)/sizeof(PVPD::pvpdRecords[0])), PVPD::pvpdKeywords, (sizeof(PVPD::pvpdKeywords)/sizeof(PVPD::pvpdKeywords[0])), @@ -351,6 +349,20 @@ IpVpdFacade(CVPD::SECTION_SIZE, // note use of CVPD #else iv_configInfo.vpdWriteHW = false; #endif + + // Get System Target + TARGETING::Target* sysTgt = NULL; + TARGETING::targetService().getTopLevelTarget(sysTgt); + + assert(sysTgt != NULL,"PvpdFacade: " + "System target was NULL."); + + iv_vpdSectionSize = sysTgt->getAttr(); + + iv_vpdMaxSections = sysTgt->getAttr(); + + TRACDCOMP( g_trac_vpd, "PvpdFacade VpdSectionSize: %d" + "MaxSections: %d ", iv_vpdSectionSize,iv_vpdMaxSections); } // Retrun lists of records that should be copied to pnor. -- cgit v1.2.1