diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C | 12 | ||||
-rw-r--r-- | src/usr/pnor/runtime/rt_pnor.C | 23 | ||||
-rw-r--r-- | src/usr/pnor/runtime/rt_pnor.H | 8 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 11 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/target_types.xml | 1 |
5 files changed, 53 insertions, 2 deletions
diff --git a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C index 9389db2ad..67be5d5c1 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 <fsi/fsiif.H> #include <pnor/pnorif.H> +#include <targeting/common/targetservice.H> 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<ATTR_PNOR_FLASH_WORKAROUNDS>(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 5d3ec698a..dc5adb7f7 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<RtPnor>::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 e2f390afd..7425adda6 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 3110b0816..5c32ae8e5 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</description> </enumerator> </enumerationType> +<attribute> + <id>PNOR_FLASH_WORKAROUNDS</id> + <description>Save state of the sfc driver flash workarounds for runtime</description> + <simpleType> + <uint32_t><default>0</default></uint32_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> +</attribute> + </attributes> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 61295aae2..7156e1ce5 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -48,6 +48,7 @@ <attribute><id>ORDINAL_ID</id></attribute> <attribute><id>FAPI_POS</id></attribute> <attribute><id>FAPI_NAME</id></attribute> + <attribute><id>PNOR_FLASH_WORKAROUNDS</id></attribute> </targetType> <targetType> |