summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2017-02-20 15:14:46 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-03-08 18:07:17 -0500
commitc4599e71cc5de0030fa4e8bedb368bfede132c1f (patch)
tree7533822a9373b2570dd348e8380433a41780f663 /src
parent2e65c884bc76759a6010249036c57c02e1516a36 (diff)
downloadtalos-hostboot-c4599e71cc5de0030fa4e8bedb368bfede132c1f.tar.gz
talos-hostboot-c4599e71cc5de0030fa4e8bedb368bfede132c1f.zip
FIRDATA changes - adding getPnorInfo to runtime
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>
Diffstat (limited to 'src')
-rw-r--r--src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C12
-rw-r--r--src/usr/pnor/runtime/rt_pnor.C23
-rw-r--r--src/usr/pnor/runtime/rt_pnor.H8
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml11
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/target_types.xml1
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>
OpenPOWER on IntegriCloud