summaryrefslogtreecommitdiffstats
path: root/sbe/sbefw
diff options
context:
space:
mode:
authorSachin Gupta <sgupta2m@in.ibm.com>2015-12-09 23:40:23 -0600
committerAmit J. Tendolkar <amit.tendolkar@in.ibm.com>2015-12-17 01:22:38 -0600
commit2a2c61c301b0d568ef2054a5c321d96e4406d6b0 (patch)
treea279059db46eb4b7b7158d2348735009984d1b80 /sbe/sbefw
parentf24c2b2bdd2e19bcaab1e8c9613eea49bc0a6649 (diff)
downloadtalos-sbe-2a2c61c301b0d568ef2054a5c321d96e4406d6b0.tar.gz
talos-sbe-2a2c61c301b0d568ef2054a5c321d96e4406d6b0.zip
Add support for gard records
Change-Id: Ia00dff931bbfbdcfbf28440a75dbde3070215059 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22598 Tested-by: Jenkins Server Reviewed-by: Basabjit Sengupta <basengup@in.ibm.com> Reviewed-by: Amit J. Tendolkar <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'sbe/sbefw')
-rw-r--r--sbe/sbefw/sbecmdiplcontrol.C54
1 files changed, 46 insertions, 8 deletions
diff --git a/sbe/sbefw/sbecmdiplcontrol.C b/sbe/sbefw/sbecmdiplcontrol.C
index 56961610..84323e0e 100644
--- a/sbe/sbefw/sbecmdiplcontrol.C
+++ b/sbe/sbefw/sbecmdiplcontrol.C
@@ -66,8 +66,9 @@ typedef ReturnCode (*sbeIstepHwp_t)
// Wrapper function for HWP IPl functions
typedef ReturnCode (*sbeIstep_t)( sbeIstepHwp_t );
-// Wrapper function which will call HWP with Proc target.
+// Wrapper function which will call HWP.
ReturnCode istepWithProc( sbeIstepHwp_t i_hwp );
+ReturnCode istepAttrSetup( sbeIstepHwp_t i_hwp );
ReturnCode istepNoOp( sbeIstepHwp_t i_hwp );
ReturnCode istepWithEq( sbeIstepHwp_t i_hwp);
ReturnCode istepWithCore( sbeIstepHwp_t i_hwp);
@@ -104,7 +105,7 @@ const uint32_t ISTEP5_MAX_SUBSTEPS = 2;
static istepMap_t g_istep2PtrTbl[ ISTEP2_MAX_SUBSTEPS ] =
{
{ NULL, NULL },
- { &istepWithProc, (sbeIstepHwp_t)&p9_sbe_attr_setup },
+ { &istepAttrSetup, (sbeIstepHwp_t)&p9_sbe_attr_setup },
{ &istepWithProc, (sbeIstepHwp_t)&p9_sbe_tp_chiplet_init1 },
{ &istepNoOp, NULL }, // DFT only
{ &istepWithProc, (sbeIstepHwp_t)&p9_sbe_npll_initf },
@@ -400,6 +401,26 @@ bool validateIstep (const uint8_t i_major, const uint8_t i_minor)
//----------------------------------------------------------------------------
+ReturnCode istepAttrSetup( sbeIstepHwp_t i_hwp)
+{
+ SBE_DEBUG("istepAttrSetup");
+ Target<TARGET_TYPE_PROC_CHIP > proc = plat_getChipTarget();
+ ReturnCode rc = FAPI2_RC_SUCCESS;
+ do
+ {
+ rc = i_hwp(proc);
+ if( rc != FAPI2_RC_SUCCESS )
+ {
+ break;
+ }
+ // Apply the gard records
+ rc = plat_ApplyGards();
+ }while(0);
+ return rc;
+}
+
+//----------------------------------------------------------------------------
+
ReturnCode istepWithProc( sbeIstepHwp_t i_hwp)
{
#ifndef SBE_ISTEP_STUBBED // @TODO via RTC 142985
@@ -423,16 +444,25 @@ ReturnCode istepWithProc( sbeIstepHwp_t i_hwp)
ReturnCode istepWithEq( sbeIstepHwp_t i_hwp)
{
#ifndef SBE_ISTEP_STUBBED // @TODO via RTC 142985
+ SBE_DEBUG("istepWithEq");
// TODO via RTC 135345
// Curently we are passing Hard code eq target. Finally it is
// going to be a multicast target. Once multicast support is
// present, use the right target.
- fapi2::Target<fapi2::TARGET_TYPE_EQ > eq10_target((uint64_t)10);
- SBE_DEBUG("istepWithEq");
+ 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];
+ }
+
ReturnCode rc = FAPI2_RC_SUCCESS;
if( i_hwp )
{
- rc = i_hwp( eq10_target );
+ rc = i_hwp( eqTgt );
}
return rc;
#else
@@ -445,16 +475,24 @@ ReturnCode istepWithEq( sbeIstepHwp_t i_hwp)
ReturnCode istepWithCore( sbeIstepHwp_t i_hwp)
{
#ifndef SBE_ISTEP_STUBBED // @TODO via RTC 142985
+ SBE_DEBUG("istepWithCore");
// TODO via RTC 135345
// Curently we are passing Hard code core target. Finally it is
// going to be a multicast target. Once multicast support is
// present, use the right target.
- fapi2::Target<fapi2::TARGET_TYPE_CORE > core_target((uint64_t)10);
- SBE_DEBUG("istepWithCore");
+ fapi2::Target<fapi2::TARGET_TYPE_CORE > coreTgt;
+ // Put this in scope so that vector can be freed up before calling hwp.
+ {
+ Target<TARGET_TYPE_PROC_CHIP > proc = plat_getChipTarget();
+ auto coreList = proc.getChildren<fapi2::TARGET_TYPE_CORE>();
+ // As it is workaround lets assume there will always be atleast one
+ // functional ec. No need to validate.
+ coreTgt = coreList[0];
+ }
ReturnCode rc = FAPI2_RC_SUCCESS;
if( i_hwp )
{
- rc = i_hwp( core_target );
+ rc = i_hwp( coreTgt );
}
return rc;
#else
OpenPOWER on IntegriCloud