summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py6
-rw-r--r--src/include/arch/ppc.H17
-rw-r--r--src/include/usr/initservice/mboxRegs.H18
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C64
4 files changed, 87 insertions, 18 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index 8dd443064..ced40566e 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -587,6 +587,12 @@ def magic_instruction_callback(user_arg, cpu, arg):
saveCommand = "%s; %s"%(cmd1,cmd2)
SIM_run_alone(run_command, saveCommand )
+ if arg == 7020: # MAGIC_PRINT_ISTEP
+ # Print current istep out to simics console
+ major_istep = cpu.r4
+ minor_istep = cpu.r5
+ print "ISTEP %d.%d" % (major_istep, minor_istep)
+
if arg == 7055: # MAGIC_CONTINUOUS_TRACE
hb_tracBinaryBuffer = cpu.r4
hb_tracBinaryBufferSz = cpu.r5
diff --git a/src/include/arch/ppc.H b/src/include/arch/ppc.H
index f945ef519..e9e6b6051 100644
--- a/src/include/arch/ppc.H
+++ b/src/include/arch/ppc.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -460,15 +460,30 @@ enum
MAGIC_BREAK_ON_ERROR = 7018, // Breakpoint in error cases if
// env var HB_BREAK_ON_ERROR
MAGIC_GET_SBE_TRACES = 7019, // Collect SBE traces
+ MAGIC_PRINT_ISTEP = 7020, // Print istep to simics console
MAGIC_CONTINUOUS_TRACE = 7055, // extract mixed trace buffer
};
+/**
+ * @brief Collect SBE traces via external debug commands
+ * @param[in] Processor number
+ * @param[in] SBE Return Code
+ */
#define MAGIC_INST_GET_SBE_TRACES(_procnum,_rc) \
asm volatile("mr 4, %0; mr 5, %1" :: \
"r" (_procnum), "r" (_rc) : "4", "5"); \
MAGIC_INSTRUCTION(MAGIC_GET_SBE_TRACES); \
+/**
+ * @brief Display istep numbers on the simics console
+ * @param[in] Major istep number
+ * @param[in] Minor istep number
+ */
+#define MAGIC_INST_PRINT_ISTEP(_major,_minor) \
+ asm volatile("mr 4, %0; mr 5, %1" :: \
+ "r" (_major), "r" (_minor) : "4", "5"); \
+ MAGIC_INSTRUCTION(MAGIC_PRINT_ISTEP); \
#endif
diff --git a/src/include/usr/initservice/mboxRegs.H b/src/include/usr/initservice/mboxRegs.H
index 00a736a6e..2b645fe1e 100644
--- a/src/include/usr/initservice/mboxRegs.H
+++ b/src/include/usr/initservice/mboxRegs.H
@@ -112,7 +112,7 @@ namespace SPLESS
// NOTE: Used for sbe comm during runtime
};
- // Mailbox Scratch Register 5
+ // Mailbox Scratch Register 5 - SBE Usage
union MboxScratch5_t
{
uint32_t data32;
@@ -128,6 +128,22 @@ namespace SPLESS
uint32_t clockPllMux :20; //12:31
} PACKED;
};
+ // Mailbox Scratch Register 5 - HB Usage
+ union MboxScratch5_HB_t
+ {
+ uint32_t data32;
+ struct
+ {
+ uint32_t magic :8; //0:7
+ uint32_t stepStart :1; //8
+ uint32_t stepFinish :1; //9
+ uint32_t reserved :2; //10:11
+ uint32_t internalStep :4; //12:15
+ uint32_t majorStep :8; //16:23
+ uint32_t minorStep :8; //24:31
+ } PACKED;
+ };
+ const uint8_t ISTEP_PROGRESS_MAGIC = 0xAA;
// Mailbox Scratch Register 6
union MboxScratch6_t
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 91306a765..942c594bf 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -73,6 +73,8 @@
#include <initservice/bootconfigif.H>
#include <trace/trace.H>
+#include <util/utilmbox_scratch.H>
+
namespace ISTEPS_TRACE
{
@@ -856,6 +858,16 @@ errlHndl_t IStepDispatcher::doIstep(uint32_t i_istep,
o_doReconfig = true;
}
+
+ //--- Mark we have finished the istep in the scratch reg
+ SPLESS::MboxScratch5_HB_t l_scratch5;
+ l_scratch5.magic = SPLESS::ISTEP_PROGRESS_MAGIC;
+ l_scratch5.stepFinish = 1;
+ l_scratch5.majorStep = iv_curIStep;
+ l_scratch5.minorStep = iv_curSubStep;
+ Util::writeScratchReg( SPLESS::MBOX_SCRATCH_REG5,
+ l_scratch5.data32 );
+
TRACFCOMP(g_trac_initsvc, EXIT_MRK"doIstep: step %d, substep %d",
i_istep, i_substep);
}
@@ -1877,17 +1889,32 @@ errlHndl_t IStepDispatcher::sendProgressCode(bool i_needsLock)
TRACDCOMP( g_trac_initsvc,ENTER_MRK"IStepDispatcher::sendProgressCode()");
errlHndl_t err = NULL;
- // Put in rolling bit RTC: 84794
- // If we send this multiple times, we may need to eliminate the console
- // write on subsequent. RTC: 84794
+ //--- Display istep in Simics console
+ MAGIC_INST_PRINT_ISTEP( iv_curIStep, iv_curSubStep );
+
+
+ //--- Save step to a scratch reg
+ SPLESS::MboxScratch5_HB_t l_scratch5;
+ l_scratch5.magic = SPLESS::ISTEP_PROGRESS_MAGIC;
+ l_scratch5.stepStart = 1;
+ l_scratch5.majorStep = iv_curIStep;
+ l_scratch5.minorStep = iv_curSubStep;
+ Util::writeScratchReg( SPLESS::MBOX_SCRATCH_REG5,
+ l_scratch5.data32 );
+
+
+ //--- Display step on serial console
#ifdef CONFIG_CONSOLE_OUTPUT_PROGRESS
+ // Note If we ever send progress codes multiple times, we may need to
+ // eliminate the console write on subsequent.
CONSOLE::displayf(NULL, "ISTEP %2d.%2d", iv_curIStep, iv_curSubStep);
CONSOLE::flush();
#endif
+
+ //--- Reset the watchdog before every istep
#ifdef CONFIG_BMC_IPMI
- //Reset the watchdog before every istep
errlHndl_t err_ipmi = IPMIWATCHDOG::resetWatchDogTimer();
if(err_ipmi)
@@ -1897,22 +1924,27 @@ errlHndl_t IStepDispatcher::sendProgressCode(bool i_needsLock)
err_ipmi->collectTrace("INITSVC", 1024);
errlCommit(err_ipmi, INITSVC_COMP_ID );
}
-
#endif
- msg_t * myMsg = msg_allocate();
- myMsg->type = IPL_PROGRESS_CODE;
- myMsg->data[0] = iv_curIStep;
- myMsg->data[1] = iv_curSubStep;
- myMsg->extra_data = NULL;
- err = MBOX::send(HWSVRQ, myMsg);
- if (err && err->sev() == ERRORLOG::ERRL_SEV_INFORMATIONAL)
+
+ //--- Send the progress code to the FSP
+ if( iv_spBaseServicesEnabled )
{
- err->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
+ msg_t * myMsg = msg_allocate();
+ myMsg->type = IPL_PROGRESS_CODE;
+ myMsg->data[0] = iv_curIStep;
+ myMsg->data[1] = iv_curSubStep;
+ myMsg->extra_data = NULL;
+ err = MBOX::send(HWSVRQ, myMsg);
+ if (err && err->sev() == ERRORLOG::ERRL_SEV_INFORMATIONAL)
+ {
+ err->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
+ }
+ clock_gettime(CLOCK_MONOTONIC, &iv_lastProgressMsgTime);
+ TRACFCOMP( g_trac_initsvc,INFO_MRK"Progress Code %d.%d Sent",
+ myMsg->data[0],myMsg->data[1]);
}
- clock_gettime(CLOCK_MONOTONIC, &iv_lastProgressMsgTime);
- TRACFCOMP( g_trac_initsvc,INFO_MRK"Progress Code %d.%d Sent",
- myMsg->data[0],myMsg->data[1]);
+
TRACDCOMP( g_trac_initsvc,EXIT_MRK"IStepDispatcher::sendProgressCode()" );
if (i_needsLock)
OpenPOWER on IntegriCloud