summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2013-08-05 09:20:20 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-08-07 16:48:28 -0500
commit4f00fd5fef1cd375f85516c8fbc3855f0dd93b5a (patch)
tree97eae2c986b122deefce06b8762a2295675976c2 /src
parent75ecf4cb9842739b4f495c0cf3f330f03cd348dd (diff)
downloadtalos-hostboot-4f00fd5fef1cd375f85516c8fbc3855f0dd93b5a.tar.gz
talos-hostboot-4f00fd5fef1cd375f85516c8fbc3855f0dd93b5a.zip
Do not enable PCI/PHB BARs when starting PHYP
Change-Id: Ie01a1a2966a2ed6e7ca0a14ec9a4ab54f779c7e3 CQ: SW213092 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5697 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/targeting/common/util.H11
-rw-r--r--src/usr/hwpf/plat/fapiPlatAttributeService.C22
-rw-r--r--src/usr/runtime/hdatservice.C30
-rw-r--r--src/usr/targeting/common/util.C38
4 files changed, 75 insertions, 26 deletions
diff --git a/src/include/usr/targeting/common/util.H b/src/include/usr/targeting/common/util.H
index 69f302df8..4ea2ab8de 100644
--- a/src/include/usr/targeting/common/util.H
+++ b/src/include/usr/targeting/common/util.H
@@ -30,7 +30,7 @@
* @brief Targeting utility functions
*/
-#include <attributeenums.H>
+#include <targeting/common/attributes.H>
namespace TARGETING
{
@@ -82,6 +82,15 @@ void update_hwas_changed_mask(Target * i_target);
*/
void clear_hwas_changed_bit(Target * i_target, const HWAS_CHANGED_BIT i_bit);
+/**
+ * @brief Checks if we are loading a PHYP payload
+ * @description Looks at both ATTR_PAYLOAD_KIND and the MNFG flags
+ * to determine if we are really loading and starting PHYP
+ * @param[out] Current value of PAYLOAD_KIND
+ * @return True if PHYP will be loaded and started
+ */
+bool is_phyp_load( ATTR_PAYLOAD_KIND_type* o_type = NULL );
+
}
#endif // __TARGETING_COMMON_UTIL_H
diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C
index c3ab3567a..71fefb5a8 100644
--- a/src/usr/hwpf/plat/fapiPlatAttributeService.C
+++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C
@@ -1041,14 +1041,30 @@ fapi::ReturnCode fapiPlatGetProcPcieBarEnable (
}
else
{
+ // In PHYP mode, we need to leave the PCI BARs disabled
+ bool phyp_mode = false;
+ if( TARGETING::is_phyp_load() )
+ {
+ phyp_mode = true;
+ }
+
// BAR # 0 are the PCIE unit #'s
// BAR # 1 is reserved, should be DISabled (per Joe McGill)
// BAR # 2 are the PHB REGS
for( uint8_t u=0; u<3; u++ )
{
- o_pcieBarEnable[u][0] = l_isEnabled ;
- o_pcieBarEnable[u][1] = PROC_BARS_DISABLE ;
- o_pcieBarEnable[u][2] = l_isEnabled ;
+ if( phyp_mode )
+ {
+ o_pcieBarEnable[u][0] = PROC_BARS_DISABLE ;
+ o_pcieBarEnable[u][1] = PROC_BARS_DISABLE ;
+ o_pcieBarEnable[u][2] = PROC_BARS_DISABLE ;
+ }
+ else
+ {
+ o_pcieBarEnable[u][0] = l_isEnabled ;
+ o_pcieBarEnable[u][1] = PROC_BARS_DISABLE ;
+ o_pcieBarEnable[u][2] = l_isEnabled ;
+ }
FAPI_DBG( "fapiPlatGetProcPcieBarEnable: Unit %d : %p %p %p",
u,
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C
index 3c40d91eb..a2b273e48 100644
--- a/src/usr/runtime/hdatservice.C
+++ b/src/usr/runtime/hdatservice.C
@@ -337,32 +337,18 @@ errlHndl_t hdatService::loadHostData(void)
break;
}
+ // Call this routine to make sure we check the MNFG flags
+ TARGETING::ATTR_PAYLOAD_KIND_type payload_kind =
+ TARGETING::PAYLOAD_KIND_NONE;
+ bool is_phyp = TARGETING::is_phyp_load(&payload_kind);
+ TRACFCOMP( g_trac_runtime,
+ "PAYLOAD_KIND = %d (is_phyp=%d)",
+ payload_kind, is_phyp );
+
TARGETING::Target * sys = NULL;
TARGETING::targetService().getTopLevelTarget( sys );
assert(sys != NULL);
- // get the current payload kind
- TARGETING::ATTR_PAYLOAD_KIND_type payload_kind
- = sys->getAttr<TARGETING::ATTR_PAYLOAD_KIND>();
-
- // read the mfg flags
- TARGETING::ATTR_MNFG_FLAGS_type mnfg_flags
- = sys->getAttr<TARGETING::ATTR_MNFG_FLAGS>();
-
- // if any AVP flags are set, override the payload kind
- if( (mnfg_flags & TARGETING::MNFG_FLAG_BIT_MNFG_AVP_ENABLE)
- || (mnfg_flags & TARGETING::MNFG_FLAG_BIT_MNFG_HDAT_AVP_ENABLE) )
- {
- if( payload_kind != TARGETING::PAYLOAD_KIND_AVP )
- {
- TRACFCOMP( g_trac_runtime,
- "Overriding PAYLOAD_KIND to AVP (from %d) based on MNFG flags (=%.8X)",
- payload_kind, mnfg_flags );
- payload_kind = TARGETING::PAYLOAD_KIND_AVP;
- sys->setAttr<TARGETING::ATTR_PAYLOAD_KIND>(payload_kind);
- }
- }
-
#ifdef REAL_HDAT_TEST
// Manually load HDAT memory now
TRACFCOMP( g_trac_runtime, "Forcing PHYP mode for testing" );
diff --git a/src/usr/targeting/common/util.C b/src/usr/targeting/common/util.C
index caa7a786f..5f2bcd919 100644
--- a/src/usr/targeting/common/util.C
+++ b/src/usr/targeting/common/util.C
@@ -121,4 +121,42 @@ void clear_hwas_changed_bit(Target * i_target, const HWAS_CHANGED_BIT i_bit)
i_target->setAttr<ATTR_HWAS_STATE_CHANGED_FLAG>(hwasChangedState);
}
+/**
+ * @brief Checks if we are loading a PHYP payload
+ */
+bool is_phyp_load( ATTR_PAYLOAD_KIND_type* o_type )
+{
+ Target* sys = NULL;
+ targetService().getTopLevelTarget( sys );
+ assert(sys != NULL);
+
+ // 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 );
+}
+
+
}
OpenPOWER on IntegriCloud