diff options
| author | Andrew Geissler <andrewg@us.ibm.com> | 2014-02-27 15:42:27 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-03-13 15:53:08 -0500 |
| commit | 7c6a8ba7eda448b90c9e2753d18a3abbbba4accd (patch) | |
| tree | 321c99ffead916520168d98a7948cea596c52ce1 | |
| parent | 6279c2d6b6938e63243558ce60184fa3725113bb (diff) | |
| download | blackbird-hostboot-7c6a8ba7eda448b90c9e2753d18a3abbbba4accd.tar.gz blackbird-hostboot-7c6a8ba7eda448b90c9e2753d18a3abbbba4accd.zip | |
Use new scratch reg for hb_done and set early in IPL
This is to support using the scratch register for the power off
message. I moved to a new scratch register since we were sharing
with a SBE scratch reg that was needed early in HB IPL.
NOTE! This will have a co-req with an FSP track so we'll need to
coordinate.
CMVC-Coreq: 917527
Change-Id: I5f81f15126d6ad8d2c9459c5afe730554256c037
RTC: 95818
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9220
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
| -rw-r--r-- | src/include/kernel/misc.H | 15 | ||||
| -rw-r--r-- | src/include/sys/mmio.h | 10 | ||||
| -rw-r--r-- | src/kernel/kernel.C | 4 | ||||
| -rw-r--r-- | src/kernel/misc.C | 24 | ||||
| -rw-r--r-- | src/kernel/shutdown.S | 2 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.C | 5 |
6 files changed, 41 insertions, 19 deletions
diff --git a/src/include/kernel/misc.H b/src/include/kernel/misc.H index a7e40356d..19427c399 100644 --- a/src/include/kernel/misc.H +++ b/src/include/kernel/misc.H @@ -50,6 +50,21 @@ namespace KernelMisc /** @brief master host boot instance number (node) */ extern uint64_t g_masterHBInstance; + /** @brief Indicate whether HB is running or not */ + enum HbRunning + { + HB_RUNNING = 0, + HB_SHUTDOWN = 1, + }; + + /** @fn setHbScratchStatus + * @brief Set scratch register indicating HB running status + * + * @param i_status Indicates whether to say HB is running or shutdown + * @return void + */ + void setHbScratchStatus(enum HbRunning i_status); + /** @fn in_kernel_mode * @brief Determine if the code is currently in kernel mode or not. * diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h index d536b281b..29f560bd6 100644 --- a/src/include/sys/mmio.h +++ b/src/include/sys/mmio.h @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2013 */ +/* COPYRIGHT International Business Machines Corp. 2010,2014 */ /* */ /* p1 */ /* */ @@ -86,8 +86,9 @@ enum MMIO_Scratch_Register MMIO_SCRATCH_PNOR_MODE = 0x8, /** Thread2 Scratch Register - Unused */ MMIO_SCRATCH_ISTEP_MODE = 0x10, - /** Thread3 Scratch Register - Unused */ - MMIO_SCRATCH_RSVD_T3 = 0x18, + /** Thread3 Scratch Register - Identifies if Hostboot is active after + * host_start_payload. */ + MMIO_SCRATCH_HOSTBOOT_ACTIVE = 0x18, /** Thread4 Scratch Register - Unused */ MMIO_SCRATCH_RSVD_T4 = 0x20, /** Thread5 Scratch Register - Unused (unit tests may modify) */ @@ -95,9 +96,6 @@ enum MMIO_Scratch_Register /** Thread6 Scratch Register - Identifies where hostboot currently resides and how large the space is */ MMIO_SCRATCH_MEMORY_STATE = 0x30, - /** Thread7 Scratch Register - Identifies if Hostboot is active after - * host_start_payload. */ - MMIO_SCRATCH_HOSTBOOT_ACTIVE = 0x38, /** Thread7 Scratch Register - Set be SBE for reduced-threads support * for AVPs. */ MMIO_SCRATCH_AVP_THREADS = 0x38, diff --git a/src/kernel/kernel.C b/src/kernel/kernel.C index 1f5770280..291e95553 100644 --- a/src/kernel/kernel.C +++ b/src/kernel/kernel.C @@ -34,6 +34,7 @@ #include <kernel/timemgr.H> #include <sys/vfs.h> #include <kernel/deferred.H> +#include <kernel/misc.H> #include <stdlib.h> @@ -66,6 +67,9 @@ int main() kernel.memBootstrap(); kernel.cpuBootstrap(); + // Let FSP/BMC know that Hostboot is now running + KernelMisc::setHbScratchStatus(KernelMisc::HB_RUNNING); + kernel.inittaskBootstrap(); // Ready to let the other CPUs go. diff --git a/src/kernel/misc.C b/src/kernel/misc.C index cba6a152c..4588518d2 100644 --- a/src/kernel/misc.C +++ b/src/kernel/misc.C @@ -220,12 +220,26 @@ namespace KernelMisc // First indicate to the FSP that we're done by clearing out the // "hostboot_done" register. We need to do this since this is the // power off path. - updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,0); + setHbScratchStatus(HB_SHUTDOWN); terminateExecuteTI(); } } + void setHbScratchStatus(enum HbRunning i_status) + { + if(i_status == HB_RUNNING) + { + const char * hostboot_string = "hostboot"; + updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE, + *reinterpret_cast<const uint64_t*>(hostboot_string)); + } + else + { + updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE,0); + } + } + void WinkleCore::masterPreWork() { printk("Winkle threads - "); @@ -290,9 +304,7 @@ namespace KernelMisc kernel_hbDescriptor.kernelMemoryState); // Set scratch register to indicate Hostboot is [still] active. - const char * hostboot_string = "hostboot"; - updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE, - *reinterpret_cast<const uint64_t*>(hostboot_string)); + setHbScratchStatus(HB_RUNNING); // Restore caller of cpu_master_winkle(). iv_caller->state = TASK_STATE_RUNNING; @@ -393,9 +405,7 @@ namespace KernelMisc kernel_hbDescriptor.kernelMemoryState); // Set scratch register to indicate Hostboot is [still] active. - const char * hostboot_string = "hostboot"; - updateScratchReg(MMIO_SCRATCH_HOSTBOOT_ACTIVE, - *reinterpret_cast<const uint64_t*>(hostboot_string)); + setHbScratchStatus(HB_RUNNING); // Restore caller of cpu_all_winkle(). iv_caller->state = TASK_STATE_RUNNING; diff --git a/src/kernel/shutdown.S b/src/kernel/shutdown.S index bee5f0086..119a89868 100644 --- a/src/kernel/shutdown.S +++ b/src/kernel/shutdown.S @@ -142,7 +142,7 @@ kernel_shutdown_ea0_1_mode: isync 2: ;// Clear "Hostboot active" scratch register. - li r3, (0x40 + 0x38) ;// See sys/mmio.h + li r3, (0x40 + 0x18) ;// See sys/mmio.h mtspr SPRC, r3 li r3, 0x0 mtspr SPRD, r3 diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index 5ee237b88..fcbef580f 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -506,11 +506,6 @@ errlHndl_t callShutdown ( uint64_t i_masterInstance, break; } - // Set scratch register to indicate Hostboot is [still] active. - const char * hostboot_string = "hostboot"; - mmio_scratch_write(MMIO_SCRATCH_HOSTBOOT_ACTIVE, - *reinterpret_cast<const uint64_t*>(hostboot_string)); - // Get Target Service, and the system target. TargetService& tS = targetService(); TARGETING::Target* sys = NULL; |

