Skip to content

Commit

Permalink
FIRDATA changes - adding getPnorInfo to runtime
Browse files Browse the repository at this point in the history
Change-Id: I9b6bd547a203bde70016427b471296b452108f4d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37515
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
e-liner authored and dcrowell77 committed Mar 8, 2017
1 parent 2e65c88 commit c4599e7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -32,6 +32,7 @@

#include <fsi/fsiif.H>
#include <pnor/pnorif.H>
#include <targeting/common/targetservice.H>

using namespace TARGETING;

Expand Down Expand Up @@ -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;
Expand Down
23 changes: 22 additions & 1 deletion src/usr/pnor/runtime/rt_pnor.C
Expand Up @@ -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
Expand Down Expand Up @@ -321,12 +341,12 @@ RtPnor::RtPnor()
{
errlCommit(l_err, PNOR_COMP_ID);
}

}

/*************************/
RtPnor::~RtPnor()
{

}

/*******************Private Methods*********************/
Expand Down Expand Up @@ -832,3 +852,4 @@ errlHndl_t RtPnor::clearSection(PNOR::SectionId i_section)
return l_errl;
}


8 changes: 8 additions & 0 deletions src/usr/pnor/runtime/rt_pnor.H
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Expand Up @@ -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>
1 change: 1 addition & 0 deletions src/usr/targeting/common/xmltohb/target_types.xml
Expand Up @@ -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>
Expand Down

0 comments on commit c4599e7

Please sign in to comment.