summaryrefslogtreecommitdiffstats
path: root/src/sbefw
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2017-02-21 20:58:21 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2017-03-23 08:46:57 -0400
commit96491b00071b268af09379e7d9c22b3acc135481 (patch)
tree2aa4d23acbe54768f6ef170692770b5840e64cf5 /src/sbefw
parent2b98021d5662fe6d003276d5ae5fd0c8b5e438e9 (diff)
downloadtalos-sbe-96491b00071b268af09379e7d9c22b3acc135481.tar.gz
talos-sbe-96491b00071b268af09379e7d9c22b3acc135481.zip
Update quad power off so HB can call it on Slave Quads
Previously this HWP was only being called by the SBE down the MPIPL but we also need to call it during HB to power down the slave quads. There is a tricky workaround in this HWP where we need to save off some ring data EQ pointers for the PB. On the SBE we just saved the rings in global variables but we cannot do that in HB because the Hcode would not have access to the global varibles. Instead we will write the ring data to the OCC SRAM to do this I will just pass the data out of the hwp via an out param The same ring data is fetch during cache_initf procedure to init Change-Id: I4f20cd8dd9ca1b53604db1bc3020c0d57bbd1172 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36828 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: YUE DU <daviddu@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37977 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r--src/sbefw/sbecmdiplcontrol.C111
-rw-r--r--src/sbefw/sbecmdiplcontrol.H5
2 files changed, 55 insertions, 61 deletions
diff --git a/src/sbefw/sbecmdiplcontrol.C b/src/sbefw/sbecmdiplcontrol.C
index 841c764c..5f60b1d3 100644
--- a/src/sbefw/sbecmdiplcontrol.C
+++ b/src/sbefw/sbecmdiplcontrol.C
@@ -38,7 +38,6 @@
#include "sberegaccess.H"
#include "sbestates.H"
#include "sbecmdcntrldmt.H"
-#include "sbeglobals.H"
#include "fapi2.H"
#include "p9_misc_scom_addresses_fld.H"
@@ -141,6 +140,14 @@ typedef ReturnCode (*sbeIstepHwpSequenceDrtm_t)
(const Target<TARGET_TYPE_PROC_CHIP> & i_target,
uint8_t & o_status);
+typedef ReturnCode (*sbeIstepHwpQuadPoweroff_t)
+ (const Target<TARGET_TYPE_EQ> & i_target,
+ uint64_t * o_ring_save_data);
+
+typedef ReturnCode (*sbeIstepHwpCacheInitf_t)
+ (const Target<TARGET_TYPE_EQ> & i_target,
+ const uint64_t * i_ring_save_data);
+
typedef union
{
sbeIstepHwpProc_t procHwp;
@@ -151,6 +158,8 @@ typedef union
sbeIstepHwpCoreBlockIntr_t coreBlockIntrHwp;
sbeIstepHwpCoreScomState_t coreScomStateHwp;
sbeIstepHwpSequenceDrtm_t procSequenceDrtm;
+ sbeIstepHwpQuadPoweroff_t quadPoweroffHwp;
+ sbeIstepHwpCacheInitf_t cacheInitfHwp;
}sbeIstepHwp_t;
// Wrapper function for HWP IPl functions
@@ -170,6 +179,7 @@ ReturnCode istepWithCoreConditional( sbeIstepHwp_t i_hwp);
ReturnCode istepWithEqConditional( sbeIstepHwp_t i_hwp);
ReturnCode istepNestFreq( sbeIstepHwp_t i_hwp);
ReturnCode istepLpcInit( sbeIstepHwp_t i_hwp);
+ReturnCode istepCacheInitf( sbeIstepHwp_t i_hwp );
//MPIPL Specific
ReturnCode istepWithCoreSetBlock( sbeIstepHwp_t i_hwp );
@@ -183,11 +193,6 @@ ReturnCode istepWithProcSequenceDrtm( sbeIstepHwp_t i_hwp );
ReturnCode istepMpiplSetFunctionalState( sbeIstepHwp_t i_hwp );
ReturnCode istepMpiplQuadPoweroff( sbeIstepHwp_t i_hwp );
ReturnCode istepStopClockMpipl( sbeIstepHwp_t i_hwp );
-// BMC Isteps, No-op in Fsp
-ReturnCode istepMpiplDumpRegs( sbeIstepHwp_t i_hwp );
-ReturnCode istepMpiplQueryQuadAccessState( sbeIstepHwp_t i_hwp );
-ReturnCode istepMpiplHcdCoreStopClocks( sbeIstepHwp_t i_hwp );
-ReturnCode istepMpiplHcdCacheStopClocks( sbeIstepHwp_t i_hwp );
// Utility function to do TPM reset
ReturnCode performTpmReset();
@@ -220,7 +225,11 @@ static const uint64_t N3_FIR_SYSTEM_CHECKSTOP_BIT = 33;
// Globals
// TODO: via RTC 123602 This global needs to move to a class that will store the
// SBE FFDC.
-static fapi2::ReturnCode g_iplFailRc = FAPI2_RC_SUCCESS;
+fapi2::ReturnCode g_iplFailRc = FAPI2_RC_SUCCESS;
+
+uint64_t G_ring_save[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+
+sbeRole g_sbeRole = SBE_ROLE_MASTER;
static istepMap_t g_istepMpiplStartPtrTbl[MPIPL_START_MAX_SUBSTEPS] =
{
@@ -252,16 +261,8 @@ static istepMap_t g_istepMpiplContinuePtrTbl[MPIPL_CONTINUE_MAX_SUBSTEPS] =
#ifdef SEEPROM_IMAGE
// Setup EC/EQ guard records
{ &istepMpiplSetFunctionalState, NULL},
- // Collect master quad regs, BMC Only istep, No-op in FSP
- { &istepMpiplDumpRegs, NULL},
- // Query Master quad, BMC Only istep, No-op in Fsp
- { &istepMpiplQueryQuadAccessState, NULL},
- // Master Quad Core stop clocks, BMC Only istep, No-op in Fsp
- { &istepMpiplHcdCoreStopClocks, NULL},
- // Master Quad Cache stop clocks, BMC Only istep, No-op in Fsp
- { &istepMpiplHcdCacheStopClocks, NULL},
// p9_quad_power_off
- { istepMpiplQuadPoweroff, { .eqHwp = &p9_quad_power_off} },
+ { istepMpiplQuadPoweroff, { .quadPoweroffHwp = &p9_quad_power_off} },
// No-op
{ &istepNoOp, NULL},
#endif
@@ -341,7 +342,7 @@ static istepMap_t g_istep4PtrTbl[ ISTEP4_MAX_SUBSTEPS ] =
{ &istepWithEq, { .eqHwp = &p9_hcd_cache_arrayinit }},
{ &istepNoOp, NULL }, // DFT Only
{ &istepNoOp, NULL }, // DFT Only
- { &istepWithEq, { .eqHwp = &p9_hcd_cache_initf }},
+ { &istepCacheInitf, { .cacheInitfHwp = &p9_hcd_cache_initf }},
{ &istepWithEqConditional, { .eqHwp = &p9_hcd_cache_startclocks }},
{ &istepWithEqConditional, { .eqHwp = &p9_hcd_cache_scominit }},
{ &istepWithEqConditional, { .eqHwp = &p9_hcd_cache_scomcust }},
@@ -552,7 +553,7 @@ bool validateIstep (const uint8_t i_major, const uint8_t i_minor)
case SBE_ISTEP3:
if( (i_minor > ISTEP3_MAX_SUBSTEPS ) ||
- ((SBE_ROLE_SLAVE == SBE_GLOBAL->SBERole) &&
+ ((SBE_ROLE_SLAVE == g_sbeRole) &&
(i_minor > SLAVE_LAST_MINOR_ISTEP)) )
{
valid = false;
@@ -561,7 +562,7 @@ bool validateIstep (const uint8_t i_major, const uint8_t i_minor)
case SBE_ISTEP4:
if( (i_minor > ISTEP4_MAX_SUBSTEPS ) ||
- (SBE_ROLE_SLAVE == SBE_GLOBAL->SBERole) )
+ (SBE_ROLE_SLAVE == g_sbeRole) )
{
valid = false;
}
@@ -569,7 +570,7 @@ bool validateIstep (const uint8_t i_major, const uint8_t i_minor)
case SBE_ISTEP5:
if( (i_minor > ISTEP5_MAX_SUBSTEPS ) ||
- (SBE_ROLE_SLAVE == SBE_GLOBAL->SBERole) )
+ (SBE_ROLE_SLAVE == g_sbeRole) )
{
valid = false;
}
@@ -683,8 +684,6 @@ ReturnCode istepSelectEx( sbeIstepHwp_t i_hwp)
}
//----------------------------------------------------------------------------
-
-
ReturnCode istepWithEq( sbeIstepHwp_t i_hwp)
{
ReturnCode rc = FAPI2_RC_SUCCESS;
@@ -708,6 +707,30 @@ ReturnCode istepWithEq( sbeIstepHwp_t i_hwp)
}
//----------------------------------------------------------------------------
+ReturnCode istepCacheInitf (sbeIstepHwp_t i_hwp )
+{
+ #define SBE_FUNC "istepCacheInitf"
+ SBE_ENTER(SBE_FUNC);
+ ReturnCode l_rc = FAPI2_RC_SUCCESS;
+
+ // TODO via RTC 135345
+ fapi2::Target<fapi2::TARGET_TYPE_EQ > eqTgt;
+ // Put this in scope so that vector can be freed up before calling hwp.
+ {
+ Target<TARGET_TYPE_PROC_CHIP > proc = plat_getChipTarget();
+ auto eqList = proc.getChildren<fapi2::TARGET_TYPE_EQ>();
+ // As it is workaround lets assume there will always be atleast one
+ // functional eq. No need to validate.
+ eqTgt = eqList[0];
+ }
+
+ SBE_EXEC_HWP(l_rc, i_hwp.cacheInitfHwp, eqTgt, G_ring_save)
+ SBE_EXIT(SBE_FUNC);
+ return l_rc;
+ #undef SBE_FUNC
+}
+
+//----------------------------------------------------------------------------
ReturnCode istepWithCore( sbeIstepHwp_t i_hwp)
{
@@ -819,10 +842,10 @@ ReturnCode istepCheckSbeMaster( sbeIstepHwp_t i_hwp)
SBE_ERROR(SBE_FUNC" performTpmReset failed");
break;
}
- SBE_GLOBAL->SBERole = SbeRegAccess::theSbeRegAccess().isSbeSlave() ?
+ g_sbeRole = SbeRegAccess::theSbeRegAccess().isSbeSlave() ?
SBE_ROLE_SLAVE : SBE_ROLE_MASTER;
- SBE_INFO(SBE_FUNC"SBE_GLOBAL->SBERole [%x]", SBE_GLOBAL->SBERole);
- if(SBE_ROLE_SLAVE == SBE_GLOBAL->SBERole)
+ SBE_INFO(SBE_FUNC"g_sbeRole [%x]", g_sbeRole);
+ if(SBE_ROLE_SLAVE == g_sbeRole)
{
(void)SbeRegAccess::theSbeRegAccess().stateTransition(
SBE_RUNTIME_EVENT);
@@ -890,7 +913,7 @@ void sbeDoContinuousIpl()
// Check if we are at step 3.20 on the slave SBE
if(((SBE_ISTEP_LAST_SLAVE == l_major) &&
(SLAVE_LAST_MINOR_ISTEP == l_minor)) &&
- (SBE_ROLE_SLAVE == SBE_GLOBAL->SBERole))
+ (SBE_ROLE_SLAVE == g_sbeRole))
{
l_done = true;
break;
@@ -1121,7 +1144,7 @@ ReturnCode istepMpiplQuadPoweroff( sbeIstepHwp_t i_hwp)
#define SBE_FUNC "istepMpiplQuadPoweroff"
SBE_ENTER(SBE_FUNC);
ReturnCode l_rc = FAPI2_RC_SUCCESS;
- if(SBE_GLOBAL->SBERole == SBE_ROLE_MASTER)
+ if(g_sbeRole == SBE_ROLE_MASTER)
{
Target<TARGET_TYPE_PROC_CHIP > l_proc = plat_getChipTarget();
// Fetch the MASTER_CORE attribute
@@ -1133,7 +1156,7 @@ ReturnCode istepMpiplQuadPoweroff( sbeIstepHwp_t i_hwp)
l_coreId + CORE_CHIPLET_OFFSET));
fapi2::Target<fapi2::TARGET_TYPE_EQ> l_quad =
l_core.getParent<fapi2::TARGET_TYPE_EQ>();
- SBE_EXEC_HWP(l_rc, i_hwp.eqHwp, l_quad)
+ SBE_EXEC_HWP(l_rc, i_hwp.quadPoweroffHwp, l_quad, G_ring_save)
}
SBE_EXIT(SBE_FUNC);
return l_rc;
@@ -1328,35 +1351,3 @@ ReturnCode istepStopClockMpipl( sbeIstepHwp_t i_hwp )
#undef SBE_FUNC
}
-// BMC - Istep
-ReturnCode istepMpiplDumpRegs( sbeIstepHwp_t i_hwp )
-{
- #define SBE_FUNC "istepMpiplDumpRegs"
- return FAPI2_RC_SUCCESS;
- #undef SBE_FUNC
-}
-//----------------------------------------------------------------------------
-// BMC - Istep
-ReturnCode istepMpiplQueryQuadAccessState( sbeIstepHwp_t i_hwp )
-{
- #define SBE_FUNC "istepMpiplQueryQuadAccessState"
- return FAPI2_RC_SUCCESS;
- #undef SBE_FUNC
-}
-//----------------------------------------------------------------------------
-// BMC - Istep
-ReturnCode istepMpiplHcdCoreStopClocks( sbeIstepHwp_t i_hwp )
-{
- #define SBE_FUNC "istepMpiplHcdCoreStopClocks"
- return FAPI2_RC_SUCCESS;
- #undef SBE_FUNC
-}
-//----------------------------------------------------------------------------
-// BMC - Istep
-ReturnCode istepMpiplHcdCacheStopClocks( sbeIstepHwp_t i_hwp )
-{
- #define SBE_FUNC "istepMpiplHcdCacheStopClocks"
- return FAPI2_RC_SUCCESS;
- #undef SBE_FUNC
-}
-//----------------------------------------------------------------------------
diff --git a/src/sbefw/sbecmdiplcontrol.H b/src/sbefw/sbecmdiplcontrol.H
index 0895cad6..d19baf09 100644
--- a/src/sbefw/sbecmdiplcontrol.H
+++ b/src/sbefw/sbecmdiplcontrol.H
@@ -56,8 +56,8 @@ static const uint32_t SBE_ISTEP_MPIPL_START = 96;
static const uint32_t SBE_ISTEP_MPIPL_CONTINUE = 97;
static const uint32_t SBE_ISTEP_STOPCLOCK = 98;
static const uint32_t MPIPL_START_MAX_SUBSTEPS = 8;
+static const uint32_t MPIPL_CONTINUE_MAX_SUBSTEPS = 3;
static const uint32_t ISTEP_STOPCLOCK_MAX_SUBSTEPS = 1;
-static const uint32_t MPIPL_CONTINUE_MAX_SUBSTEPS = 7;
// constants
static const uint32_t ISTEP2_MAX_SUBSTEPS = 17;
@@ -68,6 +68,9 @@ static const uint8_t ISTEP_MINOR_START = 1;
static const uint8_t SLAVE_LAST_MINOR_ISTEP = 20;
static const uint8_t ISTEP2_MINOR_START = 2;
+extern uint64_t G_ring_save[8];
+extern const uint64_t G_ring_index[10];
+
/**
* @brief Support function to execute specific istep
*
OpenPOWER on IntegriCloud