Skip to content

Commit

Permalink
Re-enable OCC parition in pnor
Browse files Browse the repository at this point in the history
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 <mbaiocch@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Stephen Cprek authored and dcrowell77 committed Sep 8, 2017
1 parent 948bff4 commit 513299a
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 71 deletions.
53 changes: 7 additions & 46 deletions src/build/buildpnor/pnorLayoutFSP.xml
Expand Up @@ -176,38 +176,10 @@ Layout Description - Used when building an FSP driver
<side>sideless</side>
<ecc/>
</section>
<section>
<description>Payload (21.375MB)</description>
<eyeCatch>PAYLOAD</eyeCatch>
<physicalOffset>0x162D000</physicalOffset>
<physicalRegionSize>0x1560000</physicalRegionSize>
<side>sideless</side>
<ecc/>
</section>
<section>
<description>Special PNOR Test Space (36K)</description>
<eyeCatch>TEST</eyeCatch>
<physicalOffset>0x2B8D000</physicalOffset>
<physicalRegionSize>0x9000</physicalRegionSize>
<testonly/>
<side>sideless</side>
<ecc/>
</section>
<section>
<description>Special PNOR Test Space (36K)</description>
<eyeCatch>TESTRO</eyeCatch>
<physicalOffset>0x2B96000</physicalOffset>
<physicalRegionSize>0x9000</physicalRegionSize>
<side>sideless</side>
<testonly/>
<preserved/>
<readOnly/>
<ecc/>
</section>
<section>
<description>Hostboot Bootloader (28K)</description>
<eyeCatch>HBBL</eyeCatch>
<physicalOffset>0x2B9F000</physicalOffset>
<physicalOffset>0x162D000</physicalOffset>
<!-- Physical Size includes Header rounded to ECC valid size -->
<!-- Max size of actual HBBL content is 20K and 22.5K with ECC -->
<physicalRegionSize>0x7000</physicalRegionSize>
Expand All @@ -217,62 +189,51 @@ Layout Description - Used when building an FSP driver
<section>
<description>Global Data (36K)</description>
<eyeCatch>GLOBAL</eyeCatch>
<physicalOffset>0x2BA6000</physicalOffset>
<physicalOffset>0x1634000</physicalOffset>
<physicalRegionSize>0x9000</physicalRegionSize>
<side>sideless</side>
<ecc/>
</section>
<section>
<description>Ref Image Ring Overrides (20K)</description>
<eyeCatch>RINGOVD</eyeCatch>
<physicalOffset>0x2BAF000</physicalOffset>
<physicalOffset>0x163D000</physicalOffset>
<physicalRegionSize>0x5000</physicalRegionSize>
<side>sideless</side>
<ecc/>
</section>
<section>
<description>SecureBoot Key Transition Partition (16K)</description>
<eyeCatch>SBKT</eyeCatch>
<physicalOffset>0x2BB4000</physicalOffset>
<physicalOffset>0x1642000</physicalOffset>
<physicalRegionSize>0x4000</physicalRegionSize>
<side>sideless</side>
<ecc/>
</section>
<!--
@TODO RTC:178164 add OCC support back in
<section>
<description>OCC Lid (1.125M)</description>
<eyeCatch>OCC</eyeCatch>
<physicalOffset>0x2BB8000</physicalOffset>
<physicalOffset>0x1646000</physicalOffset>
<physicalRegionSize>0x120000</physicalRegionSize>
<sha512Version/>
<side>sideless</side>
<ecc/>
</section>
-->
<section>
<description>VFRT data for WOF (12MB)</description>
<!-- We need 266KB per module sort, going to support
10 sorts by default, plus ECC -->
<eyeCatch>WOFDATA</eyeCatch>
<physicalOffset>0x2BB8000</physicalOffset>
<physicalOffset>0x1766000</physicalOffset>
<physicalRegionSize>0xC00000</physicalRegionSize>
<side>sideless</side>
<sha512Version/>
<ecc/>
</section>
<section>
<description>FIRDATA (12K)</description>
<eyeCatch>FIRDATA</eyeCatch>
<physicalOffset>0x37B8000</physicalOffset>
<physicalRegionSize>0x3000</physicalRegionSize>
<side>sideless</side>
<ecc/>
</section>
<section>
<description>Memory Data (24K)</description>
<eyeCatch>MEMD</eyeCatch>
<physicalOffset>0x37BB000</physicalOffset>
<physicalOffset>0x2366000</physicalOffset>
<physicalRegionSize>0x6000</physicalRegionSize>
<side>sideless</side>
<sha512Version/>
Expand Down
20 changes: 11 additions & 9 deletions src/build/mkrules/hbfw/img/makefile
Expand Up @@ -123,7 +123,11 @@ PNOR_LAYOUT = ${pnorLayoutFSP.xml:P}
# Decide which PNOR to build
.if(${FAKEPNOR} == "")
# Parameters passed into GEN_PNOR_IMAGE_SCRIPT.
GEN_DEFAULT_BIN_FILES = HBBL=${HBBL_IMG},HBB=${HBB_IMG},HBI=${HBI_IMG},HBRT=${HBRT_IMG},TEST=EMPTY,TESTRO=EMPTY,HBEL=EMPTY,GUARD=EMPTY,GLOBAL=EMPTY,PAYLOAD=EMPTY,CVPD=EMPTY,MVPD=EMPTY,DJVPD=EMPTY,RINGOVD=EMPTY,SBKT=EMPTY,FIRDATA=EMPTY,MEMD=${MEMD_IMG}
.if(${DEFAULT_PNOR} == 1)
GEN_DEFAULT_BIN_FILES = HBBL=${HBBL_IMG},HBB=${HBB_IMG},HBI=${HBI_IMG},HBRT=${HBRT_IMG},TEST=EMPTY,TESTRO=EMPTY,HBEL=EMPTY,GUARD=EMPTY,GLOBAL=EMPTY,PAYLOAD=EMPTY,CVPD=EMPTY,MVPD=EMPTY,DJVPD=EMPTY,RINGOVD=EMPTY,SBKT=EMPTY,FIRDATA=EMPTY,MEMD=${MEMD_IMG}
.else
GEN_DEFAULT_BIN_FILES = HBBL=${HBBL_IMG},HBB=${HBB_IMG},HBI=${HBI_IMG},HBRT=${HBRT_IMG},HBEL=EMPTY,GUARD=EMPTY,GLOBAL=EMPTY,CVPD=EMPTY,MVPD=EMPTY,DJVPD=EMPTY,RINGOVD=EMPTY,SBKT=EMPTY,MEMD=${MEMD_IMG}
.endif
DEFAULT_PARAMS = --build-all --emit-eccless ${TARGET_TEST:b--test} ${HB_STANDALONE:b--hb-standalone} \
${CONFIG_SECUREBOOT:b--secureboot} --systemBinFiles ${GEN_DEFAULT_BIN_FILES} \
--pnorLayout ${PNOR_LAYOUT} ${KEY_TRANSITION_PARAMS} ${CORRUPT_PARAMS} \
Expand Down Expand Up @@ -275,14 +279,12 @@ ZZ_MEMD_FINAL_IMG = ZZ.MEMD.bin
GEN_NIMBUS_BIN_FILES = NIMBUS:SBE=${${NIMBUS_SBE_IMG}:P},HCODE=${${NIMBUS_HCODE_IMG}:P},OCC=${${NIMBUS_OCC_IMG}:P},HBD=${${NIMBUS_HBD_IMG}:P}
GEN_CUMULUS_BIN_FILES = CUMULUS:SBE=${${CUMULUS_SBE_IMG}:P},HCODE=${${CUMULUS_HCODE_IMG}:P},OCC=${${CUMULUS_OCC_IMG}:P},HBD=${${CUMULUS_HBD_IMG}:P}
.else
# @TODO RTC:178164 add OCC support back in
GEN_NIMBUS_BIN_FILES = NIMBUS:SBE=${${NIMBUS_SBE_IMG}:P},HCODE=${${NIMBUS_HCODE_IMG}:P},HBD=${${NIMBUS_HBD_IMG}:P}
GEN_CUMULUS_BIN_FILES = CUMULUS:SBE=${${CUMULUS_SBE_IMG}:P},HCODE=${${CUMULUS_HCODE_IMG}:P},HBD=${${CUMULUS_HBD_IMG}:P}
GEN_NIMBUS_BIN_FILES = NIMBUS:SBE=${${NIMBUS_SBE_IMG}:P},HCODE=${${NIMBUS_HCODE_IMG}:P},OCC=${${NIMBUS_OCC_IMG}:P},HBD=${${NIMBUS_HBD_IMG}:P}
GEN_CUMULUS_BIN_FILES = CUMULUS:SBE=${${CUMULUS_SBE_IMG}:P},HCODE=${${CUMULUS_HCODE_IMG}:P},OCC=${${CUMULUS_OCC_IMG}:P},HBD=${${CUMULUS_HBD_IMG}:P}
.endif
GEN_ZZ_BIN_FILES = ZZ:WOFDATA=${${ZZ_WOFDATA_IMG}:P},MEMD=${${ZZ_MEMD_IMG}:P}
GEN_ZEPPELIN_BIN_FILES = ZEPPELIN:WOFDATA=${${ZEPPELIN_WOFDATA_IMG}:P}

#@TODO RTC:163810 - Put SBEC back "--systemBinFile SBEC=${${SBEC_IMG}:P}"
SYSTEM_SPECIFIC_PARAMS = --install-all --emit-eccless ${TARGET_TEST:b--test} ${CONFIG_SECUREBOOT:b--secureboot} \
--pnorLayout ${PNOR_LAYOUT} ${CORRUPT_PARAMS} ${HB_STANDALONE:b--hb-standalone} \
--systemBinFiles ${GEN_NIMBUS_BIN_FILES} \
Expand Down Expand Up @@ -318,14 +320,14 @@ gen_system_specific_images_bypass_cache :
gen_system_specific_images: build_sbe_partitions .PMAKE
@${MAKE:T:R} gen_system_specific_images_bypass_cache

HOSTBOOT_DEFAULT_SECTIONS = HBBL=${HBBL_FINAL_IMG},HBB=${HBB_FINAL_IMG},HBI=${HBI_FINAL_IMG},HBRT=${HBRT_FINAL_IMG},TEST=${TEST_FINAL_IMG},TESTRO=${TESTRO_FINAL_IMG},HBEL=${HBEL_FINAL_IMG},GUARD=${GUARD_FINAL_IMG},GLOBAL=${GLOBAL_FINAL_IMG},PAYLOAD=${PAYLOAD_FINAL_IMG},CVPD=${CVPD_FINAL_IMG},MVPD=${MVPD_FINAL_IMG},DJVPD=${DJVPD_FINAL_IMG},RINGOVD=${RINGOVD_FINAL_IMG},SBKT=${SBKT_FINAL_IMG},FIRDATA=${FIRDATA_FINAL_IMG},MEMD=${MEMD_FINAL_IMG}
.if(${DEFAULT_PNOR} == 1)
HOSTBOOT_DEFAULT_SECTIONS = HBBL=${HBBL_FINAL_IMG},HBB=${HBB_FINAL_IMG},HBI=${HBI_FINAL_IMG},HBRT=${HBRT_FINAL_IMG},TEST=${TEST_FINAL_IMG},TESTRO=${TESTRO_FINAL_IMG},HBEL=${HBEL_FINAL_IMG},GUARD=${GUARD_FINAL_IMG},GLOBAL=${GLOBAL_FINAL_IMG},PAYLOAD=${PAYLOAD_FINAL_IMG},CVPD=${CVPD_FINAL_IMG},MVPD=${MVPD_FINAL_IMG},DJVPD=${DJVPD_FINAL_IMG},RINGOVD=${RINGOVD_FINAL_IMG},SBKT=${SBKT_FINAL_IMG},FIRDATA=${FIRDATA_FINAL_IMG},MEMD=${MEMD_FINAL_IMG}
NIMBUS_SECT = HBD=${NIMBUS_HBD_FINAL_IMG},SBE=${NIMBUS_SBE_FINAL_IMG},HCODE=${NIMBUS_HCODE_FINAL_IMG},OCC=${NIMBUS_OCC_FINAL_IMG},WOFDATA=${ZZ_WOFDATA_FINAL_IMG}
CUMULUS_SECT = HBD=${CUMULUS_HBD_FINAL_IMG},SBE=${CUMULUS_SBE_FINAL_IMG},HCODE=${CUMULUS_HCODE_FINAL_IMG},OCC=${CUMULUS_OCC_FINAL_IMG},WOFDATA=${ZEPPELIN_WOFDATA_FINAL_IMG}
.else
# @TODO RTC:178164 add OCC support back in
NIMBUS_SECT = HBD=${NIMBUS_HBD_FINAL_IMG},SBE=${NIMBUS_SBE_FINAL_IMG},HCODE=${NIMBUS_HCODE_FINAL_IMG},WOFDATA=${ZZ_WOFDATA_FINAL_IMG}
CUMULUS_SECT = HBD=${CUMULUS_HBD_FINAL_IMG},SBE=${CUMULUS_SBE_FINAL_IMG},HCODE=${CUMULUS_HCODE_FINAL_IMG},WOFDATA=${ZEPPELIN_WOFDATA_FINAL_IMG}
HOSTBOOT_DEFAULT_SECTIONS = HBBL=${HBBL_FINAL_IMG},HBB=${HBB_FINAL_IMG},HBI=${HBI_FINAL_IMG},HBRT=${HBRT_FINAL_IMG},HBEL=${HBEL_FINAL_IMG},GUARD=${GUARD_FINAL_IMG},GLOBAL=${GLOBAL_FINAL_IMG},CVPD=${CVPD_FINAL_IMG},MVPD=${MVPD_FINAL_IMG},DJVPD=${DJVPD_FINAL_IMG},RINGOVD=${RINGOVD_FINAL_IMG},SBKT=${SBKT_FINAL_IMG},MEMD=${MEMD_FINAL_IMG}
NIMBUS_SECT = HBD=${NIMBUS_HBD_FINAL_IMG},SBE=${NIMBUS_SBE_FINAL_IMG},HCODE=${NIMBUS_HCODE_FINAL_IMG},OCC=${NIMBUS_OCC_FINAL_IMG},WOFDATA=${ZZ_WOFDATA_FINAL_IMG}
CUMULUS_SECT = HBD=${CUMULUS_HBD_FINAL_IMG},SBE=${CUMULUS_SBE_FINAL_IMG},HCODE=${CUMULUS_HCODE_FINAL_IMG},OCC=${CUMULUS_OCC_FINAL_IMG},WOFDATA=${ZEPPELIN_WOFDATA_FINAL_IMG}
.endif
PNOR_IMG_INFO = \
nimbus.pnor:${PNOR_LAYOUT}:${NIMBUS_SECT},${HOSTBOOT_DEFAULT_SECTIONS} \
Expand Down
12 changes: 12 additions & 0 deletions src/include/usr/pnor/pnorif.H
Expand Up @@ -263,6 +263,18 @@ errlHndl_t readHeaderMagic(
size_t i_size,
void* o_pData);

// @TODO CQ:SW400352 remove function
/**
* @brief Determine if a PNOR section is empty by checking if first PAGE
* is all 0xFF's or 0x00's depending on ECC or not.
*
* @param[in] i_secId ID of requested section
*
* @return bool - True if the section is empty (all 0xFF's or 0x00's)
* False otherwise.
*/
bool isSectionEmpty(const PNOR::SectionId i_section);

} // PNOR

#endif
33 changes: 33 additions & 0 deletions src/usr/pnor/pnor_common.C
Expand Up @@ -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<uint8_t,PAGESIZE> 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<uint8_t*>(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;
}
12 changes: 4 additions & 8 deletions src/usr/runtime/populate_hbruntime.C
Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions src/usr/util/runtime/utillidmgr_rt.C
Expand Up @@ -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 ||
Expand Down
11 changes: 11 additions & 0 deletions src/usr/util/utillidpnor.C
Expand Up @@ -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<Util::LidId>(i_lidId));

do {
// LidToPnor will return INVALID_SECITON if no mapping found
if (l_secId == PNOR::INVALID_SECTION)
{
Expand Down Expand Up @@ -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;
}

0 comments on commit 513299a

Please sign in to comment.