summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bootloader/bootloader.C11
-rw-r--r--src/include/bootloader/bootloader.H5
-rw-r--r--src/include/kernel/misc.H11
-rw-r--r--src/kernel/misc.C20
4 files changed, 42 insertions, 5 deletions
diff --git a/src/bootloader/bootloader.C b/src/bootloader/bootloader.C
index 097fc0549..13e58b8b9 100644
--- a/src/bootloader/bootloader.C
+++ b/src/bootloader/bootloader.C
@@ -238,6 +238,11 @@ namespace Bootloader{
bootloader_trace_index = 0;
BOOTLOADER_TRACE(BTLDR_TRC_MAIN_START);
+ //Set core scratch 3 to say bootloader is active
+ //"bootload" = 0x626F6F746C6F6164 in ascii
+ uint64_t hostboot_string = 0x626F6F746C6F6164;
+ writeScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE, hostboot_string);
+
// @TODO RTC:138268 Support multiple sides of PNOR in bootloader
//pnorEnd is the end of flash, which is base of lpc, plus
@@ -332,6 +337,12 @@ namespace Bootloader{
}
BOOTLOADER_TRACE(BTLDR_TRC_MAIN_COPY_HBB_DONE);
+ //Set core scratch 3 to say hbb image is starting
+ //"starthbb" = 0x7374617274686262 in ascii
+ hostboot_string = 0x7374617274686262;
+ writeScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,
+ hostboot_string);
+
// Start executing HBB
enterHBB(HBB_HRMOR, HBB_RUNNING_OFFSET);
}
diff --git a/src/include/bootloader/bootloader.H b/src/include/bootloader/bootloader.H
index 3c75770de..81515d4b9 100644
--- a/src/include/bootloader/bootloader.H
+++ b/src/include/bootloader/bootloader.H
@@ -148,6 +148,11 @@ namespace Bootloader{
}
+ /**Core Scratch Register 3 which tells the state of hostboot.
+ This is passed into writeScratchReg to select which scratch
+ reg you are writing */
+#define MMIO_SCRATCH_HOSTBOOT_ACTIVE 0x18
+
/**
* @brief Pointer to bootloader scratch space
*
diff --git a/src/include/kernel/misc.H b/src/include/kernel/misc.H
index a7b1d442b..b1415089f 100644
--- a/src/include/kernel/misc.H
+++ b/src/include/kernel/misc.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -55,8 +55,11 @@ namespace KernelMisc
/** @brief Indicate whether HB is running or not */
enum HbRunning
{
- HB_RUNNING = 0,
- HB_SHUTDOWN = 1,
+ HB_RUNNING = 0,
+ HB_STARTED_PAYLOAD = 1,
+ HB_BOOTLOADER = 2,
+ HB_START_BASE_IMAGE = 3,
+ HB_SHUTDOWN = 4,
};
/** @fn setHbScratchStatus
@@ -95,7 +98,7 @@ namespace KernelMisc
*
* @param i_caller - Task calling cpu_master_winkle to be
* restored after winkle is complete.
- * @param i_fusedCores - true if using 8 threaded cores
+ * @param i_fusedCores - true if using 8 threaded cores
*/
WinkleCore(task_t* i_caller, bool i_fusedCores) :
iv_caller(i_caller), iv_timebase(0),
diff --git a/src/kernel/misc.C b/src/kernel/misc.C
index 2a4889b48..9c7ec7883 100644
--- a/src/kernel/misc.C
+++ b/src/kernel/misc.C
@@ -236,10 +236,28 @@ namespace KernelMisc
updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,
*reinterpret_cast<const uint64_t*>(hostboot_string));
}
- else
+ else if(i_status == HB_STARTED_PAYLOAD)
{
updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,0);
}
+ else if(i_status == HB_BOOTLOADER)
+ {
+ const char * hostboot_string = "bootload";
+ updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,
+ *reinterpret_cast<const uint64_t*>(hostboot_string));
+ }
+ else if(i_status == HB_START_BASE_IMAGE)
+ {
+ const char * hostboot_string = "starthbb";
+ updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,
+ *reinterpret_cast<const uint64_t*>(hostboot_string));
+ }
+ else if(i_status == HB_SHUTDOWN)
+ {
+ const char * hostboot_string = "shutdown";
+ updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,
+ *reinterpret_cast<const uint64_t*>(hostboot_string));
+ }
}
void WinkleCore::masterPreWork()
OpenPOWER on IntegriCloud