summaryrefslogtreecommitdiffstats
path: root/src/sbefw
diff options
context:
space:
mode:
authorRaja Das <rajadas2@in.ibm.com>2017-01-13 00:14:55 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2017-02-03 08:39:18 -0500
commit8079ff5b9c6ced7c47190d5f17c86a6fdca2c7aa (patch)
tree430f896d42c2451a3a2674fe5df20466adee8a39 /src/sbefw
parent905dad6aa648f7a3dcb8e2f2591eb09bc36e99a7 (diff)
downloadtalos-sbe-8079ff5b9c6ced7c47190d5f17c86a6fdca2c7aa.tar.gz
talos-sbe-8079ff5b9c6ced7c47190d5f17c86a6fdca2c7aa.zip
StopClock Isteps in SBE (Debug usecase in MPIPL)
Change-Id: I2eab07b70d021294bb938a2c8aabd9b81641d212 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34817 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r--src/sbefw/sbecmdiplcontrol.C53
-rw-r--r--src/sbefw/sbecmdiplcontrol.H4
2 files changed, 53 insertions, 4 deletions
diff --git a/src/sbefw/sbecmdiplcontrol.C b/src/sbefw/sbecmdiplcontrol.C
index aa8474c3..3e676384 100644
--- a/src/sbefw/sbecmdiplcontrol.C
+++ b/src/sbefw/sbecmdiplcontrol.C
@@ -100,6 +100,8 @@
#include "p9_thread_control.H"
#include "sbecmdcntlinst.H"
#include "p9_quad_power_off.H"
+#include "p9_hcd_cache_stopclocks.H"
+#include "p9_stopclocks.H"
#include "sbeXipUtils.H" // For getting hbbl offset
#include "sbeutil.H" // For getting SBE_TO_NEST_FREQ_FACTOR
@@ -182,14 +184,14 @@ ReturnCode istepWithProcSequenceDrtm( sbeIstepHwp_t i_hwp );
ReturnCode istepMpiplSetFunctionalState( sbeIstepHwp_t i_hwp );
ReturnCode istepMpiplSetMPIPLMode( sbeIstepHwp_t i_hwp );
ReturnCode istepMpiplQuadPoweroff( sbeIstepHwp_t i_hwp );
-ReturnCode istepMpiplSetFunctionalState( sbeIstepHwp_t i_hwp );
-ReturnCode istepMpiplSetMPIPLMode( sbeIstepHwp_t i_hwp );
+ReturnCode istepStopClockMpipl( sbeIstepHwp_t i_hwp );
// Utility function to do TPM reset
ReturnCode performTpmReset();
#ifdef SEEPROM_IMAGE
// Using function pointer to force long call.
p9_sbe_select_ex_FP_t p9_sbe_select_ex_hwp = &p9_sbe_select_ex;
+p9_stopclocks_FP_t p9_stopclocks_hwp = &p9_stopclocks;
//p9_thread_control_FP_t threadCntlhwp = &p9_thread_control;
extern p9_thread_control_FP_t threadCntlhwp;
#endif
@@ -255,6 +257,14 @@ static istepMap_t g_istepMpiplContinuePtrTbl[MPIPL_CONTINUE_MAX_SUBSTEPS] =
#endif
};
+static istepMap_t g_istepStopClockPtrTbl[ISTEP_STOPCLOCK_MAX_SUBSTEPS] =
+ {
+#ifdef SEEPROM_IMAGE
+ // Stop Clock Mpipl
+ { &istepStopClockMpipl, NULL},
+#endif
+ };
+
// File static data
static istepMap_t g_istep2PtrTbl[ ISTEP2_MAX_SUBSTEPS ] =
{
@@ -478,6 +488,11 @@ ReturnCode sbeExecuteIstep (const uint8_t i_major, const uint8_t i_minor)
g_istepMpiplContinuePtrTbl[i_minor-1].istepHwp);
break;
+ case SBE_ISTEP_STOPCLOCK:
+ rc = (g_istepStopClockPtrTbl[i_minor-1].istepWrapper)(
+ g_istepStopClockPtrTbl[i_minor-1].istepHwp);
+ break;
+
// We should never reach here as before calling this validation has
// been done.
default:
@@ -564,6 +579,12 @@ bool validateIstep (const uint8_t i_major, const uint8_t i_minor)
}
break;
+ case SBE_ISTEP_STOPCLOCK:
+ if( i_minor > ISTEP_STOPCLOCK_MAX_SUBSTEPS )
+ {
+ valid = false;
+ }
+
default:
valid = false;
break;
@@ -1264,7 +1285,6 @@ ReturnCode performTpmReset()
}
//----------------------------------------------------------------------------
-
ReturnCode istepLpcInit( sbeIstepHwp_t i_hwp)
{
ReturnCode rc = FAPI2_RC_SUCCESS;
@@ -1277,4 +1297,31 @@ ReturnCode istepLpcInit( sbeIstepHwp_t i_hwp)
return rc;
}
+//----------------------------------------------------------------------------
+ReturnCode istepStopClockMpipl( sbeIstepHwp_t i_hwp )
+{
+ #define SBE_FUNC "istepStopClockMpipl"
+ SBE_ENTER(SBE_FUNC);
+ uint32_t l_fapiRc = FAPI2_RC_SUCCESS;
+ p9_stopclocks_flags l_flags; // Default Flag Values
+ Target<TARGET_TYPE_PROC_CHIP > l_procTgt = plat_getChipTarget();
+ p9hcd::P9_HCD_CLK_CTRL_CONSTANTS l_clk_regions =
+ p9hcd::CLK_REGION_ALL_BUT_PLL_REFR;
+ p9hcd::P9_HCD_EX_CTRL_CONSTANTS l_ex_select = p9hcd::BOTH_EX;
+
+ l_flags.clearAll();
+ l_flags.stop_core_clks = true;
+ l_flags.stop_cache_clks = true;
+
+ SBE_EXEC_HWP(l_fapiRc,
+ p9_stopclocks_hwp,
+ l_procTgt,
+ l_flags,
+ l_clk_regions,
+ l_ex_select);
+
+ SBE_EXIT(SBE_FUNC);
+ return l_fapiRc;
+ #undef SBE_FUNC
+}
diff --git a/src/sbefw/sbecmdiplcontrol.H b/src/sbefw/sbecmdiplcontrol.H
index c5ccf71e..bd7b821a 100644
--- a/src/sbefw/sbecmdiplcontrol.H
+++ b/src/sbefw/sbecmdiplcontrol.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -54,8 +54,10 @@ typedef enum
// Major MPIPL isteps which are supported
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;
// constants
static const uint32_t ISTEP2_MAX_SUBSTEPS = 17;
OpenPOWER on IntegriCloud