summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2016-10-06 11:27:40 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-10-07 13:48:45 -0400
commit90b0798b2ba62bd1fc00bbe183b71df5e2d796fb (patch)
tree26d6a9fec21fdc9b54a802ece7f575db6dff1c0d /src
parentbab702287b0b940351e66a4773b4424719843984 (diff)
downloadtalos-hostboot-90b0798b2ba62bd1fc00bbe183b71df5e2d796fb.tar.gz
talos-hostboot-90b0798b2ba62bd1fc00bbe183b71df5e2d796fb.zip
Read MC Sync Mode from SBE
The SBE boots the system into a specific mode for MC/Nest running synchronously. Hostboot needs to detect the mode that we booted in and set our live copy based on that since it may be out of sync from what our attribute might say. Change-Id: I4d7839eb4dd7e40fa045006abfdedc35b16f956c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30811 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/initservice/mboxRegs.H16
-rw-r--r--src/include/usr/sbe/sbeif.H9
-rw-r--r--src/usr/isteps/istep06/call_host_voltage_config.C3
-rw-r--r--src/usr/isteps/istep07/call_mss_freq.C67
-rw-r--r--src/usr/sbe/sbe_update.C44
5 files changed, 115 insertions, 24 deletions
diff --git a/src/include/usr/initservice/mboxRegs.H b/src/include/usr/initservice/mboxRegs.H
index cb1a60d05..6adbb546e 100644
--- a/src/include/usr/initservice/mboxRegs.H
+++ b/src/include/usr/initservice/mboxRegs.H
@@ -72,6 +72,22 @@ namespace SPLESS
} PACKED;
};
+ // Mailbox Scratch Register 5
+ union MboxScratch5_t
+ {
+ uint32_t data32;
+ struct
+ {
+ uint32_t cacheContained :1; //0
+ uint32_t initAllCores :1; //1
+ uint32_t riskLevel :1; //2
+ uint32_t noBLVectors :1; //3
+ uint32_t mcSyncMode :1; //4
+ uint32_t reserved :7; //5:11
+ uint32_t clockPllMux :20; //12:31
+ } PACKED;
+ };
+
// Mailbox Scratch Register 8
union MboxScratch8_t
{
diff --git a/src/include/usr/sbe/sbeif.H b/src/include/usr/sbe/sbeif.H
index 033e94908..e095250fa 100644
--- a/src/include/usr/sbe/sbeif.H
+++ b/src/include/usr/sbe/sbeif.H
@@ -132,6 +132,15 @@ namespace SBE
*/
errlHndl_t getBootNestFreq( uint32_t & o_bootNestFreq );
+ /**
+ * @brief Determines if we booted in synchronous memory mode or not
+ *
+ * @param[out] o_mcSyncMode - The MC sync mode the system last booted with.
+ *
+ * @return errlHndl_t Error log handle on error.
+ */
+ errlHndl_t getBootMcSyncMode( uint8_t& o_mcSyncMode );
+
} //end namespace SBE
#endif /* _SBEIF_H */
diff --git a/src/usr/isteps/istep06/call_host_voltage_config.C b/src/usr/isteps/istep06/call_host_voltage_config.C
index 19b35adde..1c5db7f76 100644
--- a/src/usr/isteps/istep06/call_host_voltage_config.C
+++ b/src/usr/isteps/istep06/call_host_voltage_config.C
@@ -95,6 +95,7 @@ void* call_host_voltage_config( void *io_pArgs )
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_voltage_config.C::"
"Failed getting the boot nest frequency from the SBE");
+ break;
}
l_sys->setAttr<TARGETING::ATTR_FREQ_PB_MHZ>( l_nestFreq );
@@ -284,7 +285,7 @@ void* call_host_voltage_config( void *io_pArgs )
l_sys->setAttr<ATTR_ULTRA_TURBO_FREQ_MHZ>(l_ultraTurboFreq);
- TRACDCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Setting System Frequency Attributes: "
"Nominal = %d, Floor = %d, Ceiling = %d, "
"Turbo = %d, UltraTurbo = %d",
diff --git a/src/usr/isteps/istep07/call_mss_freq.C b/src/usr/isteps/istep07/call_mss_freq.C
index 591b871ae..63b9cba91 100644
--- a/src/usr/isteps/istep07/call_mss_freq.C
+++ b/src/usr/isteps/istep07/call_mss_freq.C
@@ -56,7 +56,7 @@
// HWP
#include <p9_mss_freq.H>
#include <p9_mss_freq_system.H>
-// #include <p9_xip_customize.H> // RTC:138226
+
namespace ISTEP_07
{
@@ -103,7 +103,7 @@ void* call_mss_freq( void *io_pArgs )
l_StepError.addErrorDetails( l_err );
// Commit Error
- errlCommit( l_err, HWPF_COMP_ID );
+ errlCommit( l_err, ISTEP_COMP_ID );
}
else
@@ -123,12 +123,25 @@ void* call_mss_freq( void *io_pArgs )
l_sys->setAttr<TARGETING::ATTR_FREQ_PB_MHZ>(l_asyncFreq);
- // Save MC_SYNC_MODE
+ // Read MC_SYNC_MODE from SBE itself and set the attribute
+ uint8_t l_bootSyncMode = 0;
+ l_err = SBE::getBootMcSyncMode( l_bootSyncMode );
+ if( l_err )
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Failed getting the boot mc sync mode from the SBE");
+
+ // Create IStep error log and cross reference to error that occurred
+ l_StepError.addErrorDetails( l_err );
+
+ // Commit Error
+ errlCommit( l_err, ISTEP_COMP_ID );
+ }
+
TARGETING::Target * l_masterProc = nullptr;
TARGETING::targetService()
.masterProcChipTargetHandle( l_masterProc );
- uint8_t l_prevSyncMode =
- l_masterProc->getAttr<TARGETING::ATTR_MC_SYNC_MODE>();
+ l_masterProc->setAttr<TARGETING::ATTR_MC_SYNC_MODE>(l_bootSyncMode);
if(l_StepError.getErrorHandle() == NULL)
@@ -158,7 +171,7 @@ void* call_mss_freq( void *io_pArgs )
l_StepError.addErrorDetails( l_err );
// Commit Error
- errlCommit( l_err, HWPF_COMP_ID );
+ errlCommit( l_err, ISTEP_COMP_ID );
}
else
@@ -194,28 +207,36 @@ void* call_mss_freq( void *io_pArgs )
// TODO RTC: 161596 - Set ATTR_NEST_FREQ_MHZ as well until we know it is not being used anymore
l_sys->setAttr<TARGETING::ATTR_NEST_FREQ_MHZ>( l_newNest );
- //Trigger sbe update if the nest frequency changed.
- if( (l_newNest != l_originalNest) || (l_mcSyncMode != l_prevSyncMode) )
+ if(l_StepError.getErrorHandle() == NULL)
{
- TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "The nest frequency or sync mode changed!"
- " Original Nest: %d New Nest: %d"
- " Original syncMode: %d New syncMode: %d",
- l_originalNest, l_newNest, l_prevSyncMode, l_mcSyncMode );
- l_err = SBE::updateProcessorSbeSeeproms();
-
- if( l_err )
+ //Trigger sbe update if the nest frequency changed.
+ if( (l_newNest != l_originalNest) || (l_mcSyncMode != l_bootSyncMode) )
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "call_mss_freq.C - Error calling updateProcessorSbeSeeproms");
-
- // Create IStep error log and cross reference to error that occurred
- l_StepError.addErrorDetails( l_err );
-
- // Commit Error
- errlCommit( l_err, HWPF_COMP_ID );
+ "The nest frequency or sync mode changed!"
+ " Original Nest: %d New Nest: %d"
+ " Original syncMode: %d New syncMode: %d",
+ l_originalNest, l_newNest, l_bootSyncMode, l_mcSyncMode );
+ l_err = SBE::updateProcessorSbeSeeproms();
+
+ if( l_err )
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "call_mss_freq.C - Error calling updateProcessorSbeSeeproms");
+
+ // Create IStep error log and cross reference to error
+ // that occurred
+ l_StepError.addErrorDetails( l_err );
+
+ // Commit Error
+ errlCommit( l_err, ISTEP_COMP_ID );
+ }
}
}
+ else
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "WARNING skipping SBE update checks due to previous errors" );
+ }
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_freq exit" );
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
index ad1895d95..74f36f5a9 100644
--- a/src/usr/sbe/sbe_update.C
+++ b/src/usr/sbe/sbe_update.C
@@ -4871,5 +4871,49 @@ namespace SBE
return l_status;
}
+/////////////////////////////////////////////////////////////////////
+ errlHndl_t getBootMcSyncMode( uint8_t& o_mcSyncMode )
+ {
+ errlHndl_t l_err = nullptr;
+ uint64_t l_mboxScratchReg5 = 0;
+
+ INITSERVICE::SPLESS::MboxScratch5_t l_scratch5;
+ size_t l_indexSize = sizeof(l_mboxScratchReg5);
+
+ TARGETING::Target * l_masterProcTarget = NULL;
+ TARGETING::targetService()
+ .masterProcChipTargetHandle( l_masterProcTarget );
+
+ TRACFCOMP( g_trac_sbe, ENTER_MRK"Enter getBootMcSyncMode()");
+ do
+ {
+ l_err = deviceRead( l_masterProcTarget,
+ &l_mboxScratchReg5,
+ l_indexSize,
+ DEVICE_SCOM_ADDRESS(
+ INITSERVICE::SPLESS::MBOX_SCRATCH_REG5) );
+
+ if( l_err )
+ {
+ TRACFCOMP(g_trac_sbe,
+ "getBootMcSyncMode::"
+ "Failed to get the bucket index from scom address");
+ errlCommit(l_err, SBE_COMP_ID);
+ break;
+ }
+
+ l_scratch5.data32 = static_cast<uint32_t>(l_mboxScratchReg5 >> 32);
+
+ TRACFCOMP(g_trac_sbe,
+ "The MC Sync Bit is %d",
+ l_scratch5.mcSyncMode );
+
+ o_mcSyncMode = l_scratch5.mcSyncMode;
+
+ } while( 0 );
+ TRACUCOMP(g_trac_sbe,EXIT_MRK "Exit getBootMcSyncMode()");
+
+ return l_err;
+ }
} //end SBE Namespace
OpenPOWER on IntegriCloud