summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2018-04-09 12:30:22 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-10 15:54:44 -0400
commit4f32915aa1240d07bb2671010f95695ba5f306c3 (patch)
tree1a47694858b4089d6d0cc843b83fa65dddc352a1 /src/usr/sbeio
parentb10263aeedd30c991c5b20926a3ac1a4f5a4c70f (diff)
downloadtalos-hostboot-4f32915aa1240d07bb2671010f95695ba5f306c3.tar.gz
talos-hostboot-4f32915aa1240d07bb2671010f95695ba5f306c3.zip
Clear perv scrach register prior to triggering HRESET
Before we initiate an HRESET we need to make sure that the perv scratch register that the SBE looks at during boot are all zeros. When these registers are zeros the SBE will ignore them and pull values from its own image. We need to do this because Hostboot will repurpose these registers after the SBE boots the first time so the data in the registers is no longer valid. It is okay for the SBE to pull the values from it's own image because during the IPL hostboot customized the SBE image with the correct values. Change-Id: I8b434d04cde3c384e35a3089a349a1d121b6b1dc RTC: 180242 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56959 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> CI-Ready: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio')
-rw-r--r--src/usr/sbeio/common/sbe_retry_handler.C54
1 files changed, 48 insertions, 6 deletions
diff --git a/src/usr/sbeio/common/sbe_retry_handler.C b/src/usr/sbeio/common/sbe_retry_handler.C
index 5cfa6f32f..60ced2eca 100644
--- a/src/usr/sbeio/common/sbe_retry_handler.C
+++ b/src/usr/sbeio/common/sbe_retry_handler.C
@@ -434,10 +434,19 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
{
this->iv_currentSideBootAttempts++;
- // For now we only use HRESET during runtime, the bool param
- // we are passing in is supposed to be FALSE if runtime, TRUE is ipl time
- FAPI_INVOKE_HWP(l_errl, p9_sbe_hreset,
- l_fapi2_proc_target, false);
+ // Prior to performing the hreset we want to zero out the scratch registers
+ // this will force the SBE to use its own image to populate the values it
+ // is expecting from the scratch regs.
+ l_errl = clearSbeScratchRegisters(i_target);
+
+ if(!l_errl)
+ {
+ // For now we only use HRESET during runtime, the bool param
+ // we are passing in is supposed to be FALSE if runtime, TRUE is ipl time
+ FAPI_INVOKE_HWP(l_errl, p9_sbe_hreset,
+ l_fapi2_proc_target, false);
+ }
+
if(l_errl)
{
SBE_TRACF("ERROR: call p9_sbe_hreset, PLID=0x%x",
@@ -1169,7 +1178,7 @@ errlHndl_t SbeRetryHandler::switch_sbe_sides(TARGETING::Target * i_target)
if( l_errl )
{
SBE_TRACF( ERR_MRK"switch_sbe_sides: SCOM device read "
- "PERV_SB_CS_SCOM (0x%.4X), proc target = %.8X, "
+ "PERV_SB_CS_SCOM (0x%.8X), proc target = %.8X, "
"RC=0x%X, PLID=0x%lX",
PERV_SB_CS_SCOM, // 0x50008
TARGETING::get_huid(i_target),
@@ -1206,7 +1215,7 @@ errlHndl_t SbeRetryHandler::switch_sbe_sides(TARGETING::Target * i_target)
if( l_errl )
{
SBE_TRACF( ERR_MRK"switch_sbe_sides: SCOM device write "
- "PERV_SB_CS_SCOM (0x%.4X), proc target = %.8X, "
+ "PERV_SB_CS_SCOM (0x%.8X), proc target = %.8X, "
"RC=0x%X, PLID=0x%lX",
PERV_SB_CS_SCOM, // 0x50008
TARGETING::get_huid(i_target),
@@ -1238,4 +1247,37 @@ errlHndl_t SbeRetryHandler::switch_sbe_sides(TARGETING::Target * i_target)
return l_errl;
}
+errlHndl_t SbeRetryHandler::clearSbeScratchRegisters(TARGETING::Target * i_target)
+{
+ SBE_TRACF(ENTER_MRK "clearSbeScratchRegisters()");
+ errlHndl_t l_errl = nullptr;
+
+ uint64_t l_writeVal = 0;
+ size_t l_opSize = sizeof(uint64_t);
+
+ // Loop through all 8 SBE scratch registers writing 0's to each
+ // one via SCOM
+ for(uint64_t l_reg = PERV_SCRATCH_REGISTER_1_SCOM;
+ l_reg <= PERV_SCRATCH_REGISTER_8_SCOM;
+ l_reg++)
+ {
+ l_errl = DeviceFW::deviceOp(
+ DeviceFW::WRITE,
+ i_target,
+ &l_writeVal,
+ l_opSize,
+ DEVICE_SCOM_ADDRESS(l_reg) );
+ if(l_errl)
+ {
+ SBE_TRACF( "clearSbeScratchRegisters: Error attempting to zero out 0x%.8X via SCOM on proc w/ HUID: 0x%.8X",
+ l_reg,
+ TARGETING::get_huid(i_target));
+ break;
+ }
+ }
+
+ SBE_TRACF(EXIT_MRK "clearSbeScratchRegisters()");
+ return l_errl;
+}
+
} // End of namespace SBEIO
OpenPOWER on IntegriCloud