summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2015-02-24 10:41:02 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-03-10 22:42:32 -0500
commitd75a32eaa8312aa7f057a73479f74747b73e54f2 (patch)
tree8fb6bfda20a2bfc13a49472870d6439df65ac2e3 /src/usr
parenta4e3995bbd258ec44d3b9b1b7f3e8d22538e4e71 (diff)
downloadblackbird-hostboot-d75a32eaa8312aa7f057a73479f74747b73e54f2.tar.gz
blackbird-hostboot-d75a32eaa8312aa7f057a73479f74747b73e54f2.zip
Clear out VPD caches when booting with a golden image
Change-Id: Ie371e855dc53655ac0d9d3f10119a2253cfab77d RTC: 124570 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15964 Tested-by: Jenkins Server Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwas/hwasPlat.C24
-rw-r--r--src/usr/hwpf/hwp/start_payload/start_payload.C26
-rw-r--r--src/usr/vpd/rtvpd_load.C55
-rwxr-xr-xsrc/usr/vpd/vpd.C50
4 files changed, 129 insertions, 26 deletions
diff --git a/src/usr/hwas/hwasPlat.C b/src/usr/hwas/hwasPlat.C
index 71ed3bbad..80c36f95d 100644
--- a/src/usr/hwas/hwasPlat.C
+++ b/src/usr/hwas/hwasPlat.C
@@ -381,6 +381,30 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets)
{
errlHndl_t errl = NULL;
+#ifdef CONFIG_PNOR_TWO_SIDE_SUPPORT
+ // If we're booting from the golden side of PNOR we need
+ // to wipe out our VPD caches to force a re-read of
+ // the data from hardware
+ PNOR::SideInfo_t l_pnorInfo;
+ errl = PNOR::getSideInfo( PNOR::WORKING, l_pnorInfo );
+ if( errl )
+ {
+ // commit the error but keep going
+ errlCommit(errl, HWAS_COMP_ID);
+ // force the caches to get wiped out just in case
+ l_pnorInfo.isGolden = true;
+ }
+ if( l_pnorInfo.isGolden )
+ {
+ errl = VPD::invalidateAllPnorCaches(false);
+ if( errl )
+ {
+ // commit the error but keep going
+ errlCommit(errl, HWAS_COMP_ID);
+ }
+ }
+#endif
+
// we got a list of targets - determine if they are present
// if not, delete them from the list
for (TargetHandleList::iterator pTarget_it = io_targets.begin();
diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C
index 7d28ae0b0..0428000ac 100644
--- a/src/usr/hwpf/hwp/start_payload/start_payload.C
+++ b/src/usr/hwpf/hwp/start_payload/start_payload.C
@@ -87,6 +87,8 @@
#include <algorithm>
#include <config.h>
#include <ipmi/ipmiwatchdog.H>
+#include <vpd/vpd_if.H>
+
// Uncomment these files as they become available:
// #include "host_start_payload/host_start_payload.H"
@@ -351,6 +353,30 @@ void* call_host_runtime_setup( void *io_pArgs )
// break from do loop if error occured
break;
}
+
+#ifdef CONFIG_PNOR_TWO_SIDE_SUPPORT
+ // We also need to wipe the cache out after booting from the
+ // golden side of pnor
+ PNOR::SideInfo_t l_pnorInfo;
+ l_err = PNOR::getSideInfo( PNOR::WORKING, l_pnorInfo );
+ if( l_err )
+ {
+ // commit the error but keep going
+ errlCommit(l_err, ISTEP_COMP_ID);
+ // force the caches to get wiped out just in case
+ l_pnorInfo.isGolden = true;
+ }
+ if( l_pnorInfo.isGolden )
+ {
+ // Invalidate the VPD Caches for all targets
+ l_err = VPD::invalidateAllPnorCaches(true);
+ if (l_err)
+ {
+ break;
+ }
+ }
+#endif
+
}
else if( is_sapphire_load() )
{
diff --git a/src/usr/vpd/rtvpd_load.C b/src/usr/vpd/rtvpd_load.C
index 837d9477b..d7b46436f 100644
--- a/src/usr/vpd/rtvpd_load.C
+++ b/src/usr/vpd/rtvpd_load.C
@@ -31,6 +31,9 @@
#include <pnor/pnorif.H>
#include <vpd/vpdreasoncodes.H>
#include <vpd/vpd_if.H>
+#include <errl/errlmanager.H>
+
+
// ----------------------------------------------
// Trace definitions
@@ -149,6 +152,8 @@ errlHndl_t VPD::vpd_load_rt_image(uint64_t & o_vpd_addr)
mm_block_unmap(vptr);
+ bool l_invalidateCaches = false;
+
// In manufacturing mode the VPD PNOR cache needs to be cleared
// And the VPD ATTR switch and flags need to be reset
// Note: this code should do nothing when not in PNOR caching mode
@@ -156,39 +161,37 @@ errlHndl_t VPD::vpd_load_rt_image(uint64_t & o_vpd_addr)
TARGETING::targetService().getTopLevelTarget(l_pTopLevel);
TARGETING::ATTR_MNFG_FLAGS_type l_mnfgFlags =
l_pTopLevel->getAttr<TARGETING::ATTR_MNFG_FLAGS>();
-
// @todo RTC 118752 Use generic mfg-mode attr when available
if (l_mnfgFlags & TARGETING::MNFG_FLAG_SRC_TERM)
{
- // Reset the PNOR config flags to HW - MVPD/CVPD/SPD
- // Checks for PNOR caching mode before reset
- VPD::setVpdConfigFlagsHW();
- if (err)
+ l_invalidateCaches = true;
+ }
+
+#ifdef CONFIG_PNOR_TWO_SIDE_SUPPORT
+ // We also need to wipe the cache out after booting from the
+ // golden side of pnor
+ if( !l_invalidateCaches )
+ {
+ PNOR::SideInfo_t l_pnorInfo;
+ err = PNOR::getSideInfo( PNOR::WORKING, l_pnorInfo );
+ if( err )
{
- break;
+ // commit the error but keep going
+ errlCommit(err, VPD_COMP_ID);
+ // force the caches to get wiped out just in case
+ l_invalidateCaches = true;
}
-
- // Find all the targets with VPD switches
- for (TARGETING::TargetIterator target =
- TARGETING::targetService().begin();
- target != TARGETING::targetService().end();
- ++target)
+ else if( l_pnorInfo.isGolden )
{
- TARGETING::ATTR_VPD_SWITCHES_type l_switch;
- if(target->tryGetAttr<TARGETING::ATTR_VPD_SWITCHES>(l_switch))
- {
- if (l_switch.pnorCacheValid)
- {
- // Invalidate the VPD PNOR for this target
- // This also clears the VPD ATTR switch
- err = VPD::invalidatePnorCache(*target);
- if (err)
- {
- break;
- }
- }
- }
+ l_invalidateCaches = true;
}
+ }
+#endif
+
+ if( l_invalidateCaches )
+ {
+ // Invalidate the VPD Caches for all targets
+ err = invalidateAllPnorCaches(true);
if (err)
{
break;
diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C
index 921e4e5da..3533af9d1 100755
--- a/src/usr/vpd/vpd.C
+++ b/src/usr/vpd/vpd.C
@@ -36,6 +36,8 @@
#include "cvpd.H"
#include "spd.H"
+
+
// ----------------------------------------------
// Trace definitions
// ----------------------------------------------
@@ -618,4 +620,52 @@ void setVpdConfigFlagsHW ( )
}
+// ------------------------------------------------------------------
+// invalidateAllPnorCaches
+// ------------------------------------------------------------------
+errlHndl_t invalidateAllPnorCaches ( bool i_setHwOnly )
+{
+ TRACFCOMP(g_trac_vpd,"invalidateAllPnorCaches");
+ errlHndl_t l_err = NULL;
+
+ do {
+ // Reset the PNOR config flags to HW - MVPD/CVPD/SPD
+ // Checks for PNOR caching mode before reset
+ if( i_setHwOnly )
+ {
+ VPD::setVpdConfigFlagsHW();
+ }
+
+ // Find all the targets with VPD switches
+ for (TARGETING::TargetIterator target =
+ TARGETING::targetService().begin();
+ target != TARGETING::targetService().end();
+ ++target)
+ {
+ TARGETING::ATTR_VPD_SWITCHES_type l_switch;
+ if(target->tryGetAttr<TARGETING::ATTR_VPD_SWITCHES>(l_switch))
+ {
+ if (l_switch.pnorCacheValid)
+ {
+ // Invalidate the VPD PNOR for this target
+ // This also clears the VPD ATTR switch
+ l_err = invalidatePnorCache(*target);
+ if (l_err)
+ {
+ break;
+ }
+ }
+ }
+ }
+ if (l_err)
+ {
+ break;
+ }
+
+ } while(0);
+
+ return l_err;
+}
+
+
}; //end VPD namespace
OpenPOWER on IntegriCloud