From 513299a5b565b066816fe31b1ba224f8d195ca27 Mon Sep 17 00:00:00 2001 From: Stephen Cprek Date: Mon, 28 Aug 2017 11:39:53 -0500 Subject: Re-enable OCC parition in pnor Additional Changes - Created isEmpty check for pnor sections to handle lack of FSP support when loading Lids - Removed not needed PNOR partitions from FSP layout Change-Id: I326831a1b389ef25b6f5f557d332c74f3b5e77d8 RTC:178164 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45251 Reviewed-by: Michael Baiocchi Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Nicholas E. Bofferding Reviewed-by: Daniel M. Crowell --- src/usr/pnor/pnor_common.C | 33 +++++++++++++++++++++++++++++++++ src/usr/runtime/populate_hbruntime.C | 12 ++++-------- src/usr/util/runtime/utillidmgr_rt.C | 8 -------- src/usr/util/utillidpnor.C | 11 +++++++++++ 4 files changed, 48 insertions(+), 16 deletions(-) (limited to 'src/usr') diff --git a/src/usr/pnor/pnor_common.C b/src/usr/pnor/pnor_common.C index 20d6bd760..3b0195756 100644 --- a/src/usr/pnor/pnor_common.C +++ b/src/usr/pnor/pnor_common.C @@ -533,3 +533,36 @@ errlHndl_t PNOR::hasKnownHeader( return pError; } +// @TODO CQ:SW400352 remove function +bool PNOR::isSectionEmpty(const PNOR::SectionId i_section) +{ + errlHndl_t l_errhdl = nullptr; + bool l_result = true; + + PNOR::SectionInfo_t l_sectionInfo; + l_errhdl = PNOR::getSectionInfo( i_section, l_sectionInfo ); + if (l_errhdl) + { + // If section is not in PNOR, just delete error and return false + delete l_errhdl; + l_errhdl = nullptr; + } + else + { + std::array empty_buffer{}; + // Empty ECC sections are filled with 0xFF's to ensure good ECC + if (l_sectionInfo.eccProtected) + { + empty_buffer.fill(0xFF); + } + + l_result = memcmp(&empty_buffer, + reinterpret_cast(l_sectionInfo.vaddr), + sizeof(empty_buffer)) ==0; + } + + TRACFCOMP(g_trac_pnor, "PNOR::isSectionEmpty: i_section=%s isSectionEmpty=%d", + PNOR::SectionIdToString(i_section), l_result); + + return l_result; +} diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C index 450ff22fd..b4af2f3d6 100644 --- a/src/usr/runtime/populate_hbruntime.C +++ b/src/usr/runtime/populate_hbruntime.C @@ -1169,15 +1169,11 @@ errlHndl_t populate_HbRsvMem(uint64_t i_nodeId) // -- HCODE // -- Non-verified Images /// -- RINGOVD - // @TODO RTC:178164 add OCC PNOR support for fsp back - if (!INITSERVICE::spBaseServicesEnabled()) + l_elog = hbResvLoadSecureSection(PNOR::OCC, i_nodeId, + l_prevDataAddr, l_prevDataSize); + if (l_elog) { - l_elog = hbResvLoadSecureSection(PNOR::OCC, i_nodeId, - l_prevDataAddr, l_prevDataSize); - if (l_elog) - { - break; - } + break; } l_elog = hbResvLoadSecureSection(PNOR::WOFDATA, i_nodeId, l_prevDataAddr, l_prevDataSize); diff --git a/src/usr/util/runtime/utillidmgr_rt.C b/src/usr/util/runtime/utillidmgr_rt.C index 2fe72d655..cbaaac3fa 100644 --- a/src/usr/util/runtime/utillidmgr_rt.C +++ b/src/usr/util/runtime/utillidmgr_rt.C @@ -327,14 +327,6 @@ const uint32_t * UtilLidMgr::getLidList(size_t * o_num) bool UtilLidMgr::lidInHbResvMem(const uint32_t i_lidId) const { - // @TODO RTC:178164 Remove this and add OCC PNOR support for fsp back - // hostboot could not verify it from pnor, so it is not in hb resv meomory - if (iv_spBaseServicesEnabled && - (i_lidId == Util::OCC_LIDID || i_lidId == Util::OCC_CONTAINER_LIDID)) - { - return false; - } - return i_lidId == Util::OCC_LIDID || i_lidId == Util::OCC_CONTAINER_LIDID || i_lidId == Util::WOF_LIDID || diff --git a/src/usr/util/utillidpnor.C b/src/usr/util/utillidpnor.C index 1545ffc57..48381e0d7 100644 --- a/src/usr/util/utillidpnor.C +++ b/src/usr/util/utillidpnor.C @@ -106,6 +106,7 @@ bool UtilLidMgr::getLidPnorSectionInfo(uint32_t i_lidId, // Search if a lid id maps to pnor section auto l_secId = Util::getLidPnorSection(static_cast(i_lidId)); + do { // LidToPnor will return INVALID_SECITON if no mapping found if (l_secId == PNOR::INVALID_SECTION) { @@ -156,7 +157,17 @@ bool UtilLidMgr::getLidPnorSectionInfo(uint32_t i_lidId, } #endif #endif + // @TODO CQ:SW400352 remove this check + if ((l_secId == PNOR::OCC) && PNOR::isSectionEmpty(l_secId)) + { + UTIL_FT("UtilLidMgr::getLidPnorSection PNOR section %s is empty get data from LID transfer", + PNOR::SectionIdToString(l_secId)); + l_lidInPnor = false; + break; + } } } + } while(0); + return l_lidInPnor; } \ No newline at end of file -- cgit v1.2.1