diff --git a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C index 9389db2adc0..67be5d5c1b2 100644 --- a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C +++ b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -32,6 +32,7 @@ #include #include +#include using namespace TARGETING; @@ -523,6 +524,15 @@ errlHndl_t getPnorInfo( HOMER_Data_t & o_data ) PNOR::PnorInfo_t pnorInfo; PNOR::getPnorInfo( pnorInfo ); + // Saving the flash workarounds in an attribute for when we + // call getPnorInfo() in the runtime code. + // Using sys target + Target* sys = NULL; + targetService().getTopLevelTarget( sys ); + assert(sys != NULL); + + sys->setAttr(pnorInfo.norWorkarounds); + o_data.pnorInfo.pnorOffset = sectionInfo.flashAddr; o_data.pnorInfo.pnorSize = sectionInfo.size; o_data.pnorInfo.mmioOffset = pnorInfo.mmioOffset; diff --git a/src/usr/pnor/runtime/rt_pnor.C b/src/usr/pnor/runtime/rt_pnor.C index 5d3ec698a51..dc5adb7f7ec 100644 --- a/src/usr/pnor/runtime/rt_pnor.C +++ b/src/usr/pnor/runtime/rt_pnor.C @@ -87,6 +87,26 @@ errlHndl_t PNOR::clearSection(PNOR::SectionId i_section) return Singleton::instance().clearSection(i_section); } +void PNOR::getPnorInfo( PnorInfo_t& o_pnorInfo ) +{ + o_pnorInfo.mmioOffset = LPC_SFC_MMIO_OFFSET | LPC_FW_SPACE; + + //Using sys target + TARGETING::Target* sys = NULL; + TARGETING::targetService().getTopLevelTarget( sys ); + assert(sys != NULL); + + o_pnorInfo.norWorkarounds = sys->getAttr< + TARGETING::ATTR_PNOR_FLASH_WORKAROUNDS>(); + +#ifdef CONFIG_PNOR_IS_32MB + o_pnorInfo.flashSize = 32*MEGABYTE; +#else + o_pnorInfo.flashSize = 64*MEGABYTE; +#endif + +} + /****************Public Methods***************************/ /** * STATIC @@ -321,12 +341,12 @@ RtPnor::RtPnor() { errlCommit(l_err, PNOR_COMP_ID); } + } /*************************/ RtPnor::~RtPnor() { - } /*******************Private Methods*********************/ @@ -832,3 +852,4 @@ errlHndl_t RtPnor::clearSection(PNOR::SectionId i_section) return l_errl; } + diff --git a/src/usr/pnor/runtime/rt_pnor.H b/src/usr/pnor/runtime/rt_pnor.H index e2f390afd5d..7425adda6db 100644 --- a/src/usr/pnor/runtime/rt_pnor.H +++ b/src/usr/pnor/runtime/rt_pnor.H @@ -86,6 +86,14 @@ class RtPnor */ errlHndl_t clearSection(PNOR::SectionId i_section); + /** + * @brief Retrieve some information about the PNOR/SFC hardware + * In runtime, some of this information is from attributes. + * + * @param[out] o_pnorInfo Information about PNOR. + */ + errlHndl_t getPnorInfo( PNOR::PnorInfo_t& o_pnorInfo ); + protected: /** * @brief Constructor diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 3110b081655..5c32ae8e594 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -33337,4 +33337,15 @@ Measured in GB + + PNOR_FLASH_WORKAROUNDS + Save state of the sfc driver flash workarounds for runtime + + 0 + + volatile-zeroed + + + + diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 61295aae231..7156e1ce5d3 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -48,6 +48,7 @@ ORDINAL_ID FAPI_POS FAPI_NAME + PNOR_FLASH_WORKAROUNDS