summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/util.C
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2013-08-15 14:48:29 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-08-21 15:39:45 -0500
commita0a28214eff925dae2a5e1081c6d600560fafdb5 (patch)
treeac65e7477e1080fa4b288754731d5800b0668c83 /src/usr/targeting/common/util.C
parentb814311a6dc122e761336881130eace63d3533e7 (diff)
downloadtalos-hostboot-a0a28214eff925dae2a5e1081c6d600560fafdb5.tar.gz
talos-hostboot-a0a28214eff925dae2a5e1081c6d600560fafdb5.zip
Update PAYLOAD_KIND to non volatile for Sapphire
Change-Id: Icc7a5782ed32cbe3fc814951613d6d2b543c7e59 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5804 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/util.C')
-rw-r--r--src/usr/targeting/common/util.C58
1 files changed, 38 insertions, 20 deletions
diff --git a/src/usr/targeting/common/util.C b/src/usr/targeting/common/util.C
index c622e4b5d..a53f2c88a 100644
--- a/src/usr/targeting/common/util.C
+++ b/src/usr/targeting/common/util.C
@@ -133,29 +133,18 @@ bool is_phyp_load( ATTR_PAYLOAD_KIND_type* o_type )
// get the current payload kind
ATTR_PAYLOAD_KIND_type payload_kind = sys->getAttr<ATTR_PAYLOAD_KIND>();
- // read the mfg flags if we haven't already
- if( payload_kind != PAYLOAD_KIND_AVP )
- {
- ATTR_MNFG_FLAGS_type mnfg_flags = sys->getAttr<ATTR_MNFG_FLAGS>();
-
- // if any AVP flags are set, override the payload kind
- if( (mnfg_flags & MNFG_FLAG_BIT_MNFG_AVP_ENABLE)
- || (mnfg_flags & MNFG_FLAG_BIT_MNFG_HDAT_AVP_ENABLE) )
- {
- if( payload_kind != PAYLOAD_KIND_AVP )
- {
- payload_kind = PAYLOAD_KIND_AVP;
- sys->setAttr<ATTR_PAYLOAD_KIND>(payload_kind);
- }
- }
- }
-
if( o_type )
{
*o_type = payload_kind;
}
- return( PAYLOAD_KIND_PHYP == payload_kind );
+ //If in AVP mode default to false
+ bool is_phyp = false;
+ if(!is_avp_load())
+ {
+ is_phyp = (PAYLOAD_KIND_PHYP == payload_kind);
+ }
+ return is_phyp;
}
/**
@@ -171,9 +160,38 @@ bool is_sapphire_load(void)
TARGETING::Target * sys = NULL;
TARGETING::targetService().getTopLevelTarget( sys );
assert(sys != NULL);
+ bool is_sapphire = false;
+
+ //If in AVP mode default to false
+ if(!is_avp_load())
+ {
+ is_sapphire = (PAYLOAD_KIND_SAPPHIRE ==
+ sys->getAttr<TARGETING::ATTR_PAYLOAD_KIND>());
+ }
+ return is_sapphire;
+}
+
+/**
+ * @brief Utility function to determine if an AVP is the payload
+ * Note the actual payload could be something else -- this
+ * is based solely on MFG flags
+ *
+ * @description If MFG AVP mode flags are set then returns true
+ * Does not matter what the actual payload is
+ *
+ * @return bool True when in AVP mode
+ */
+bool is_avp_load(void)
+{
+ TARGETING::Target * sys = NULL;
+ TARGETING::targetService().getTopLevelTarget( sys );
+ assert(sys != NULL);
+
+ TARGETING::ATTR_MNFG_FLAGS_type mnfg_flags =
+ sys->getAttr<TARGETING::ATTR_MNFG_FLAGS>();
- return (TARGETING::PAYLOAD_KIND_SAPPHIRE ==
- sys->getAttr<TARGETING::ATTR_PAYLOAD_KIND>());
+ return ((mnfg_flags & TARGETING::MNFG_FLAG_BIT_MNFG_AVP_ENABLE)
+ || (mnfg_flags & TARGETING::MNFG_FLAG_BIT_MNFG_HDAT_AVP_ENABLE));
}
OpenPOWER on IntegriCloud