summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorBrian Stegmiller <bjs@us.ibm.com>2015-11-15 10:52:28 -0600
committerPatrick Williams <iawillia@us.ibm.com>2015-12-11 15:30:29 -0600
commitcb1f5614326054b025774dae1a37ad5bdf07902d (patch)
tree4b5ef74fd7aac1b7bba91da711da867ccb870920 /src/include
parentbedb0a1a1818ebe6d683028926ccaec14fdb9f8d (diff)
downloadtalos-hostboot-cb1f5614326054b025774dae1a37ad5bdf07902d.tar.gz
talos-hostboot-cb1f5614326054b025774dae1a37ad5bdf07902d.zip
HOSTBOOT: Support fused cores
Change-Id: I2ad133be733ee9e41590b3b8bd60bd6abe69d1a9 RTC: 126786 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22054 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/arch/ppc.H34
-rw-r--r--src/include/kernel/cpumgr.H13
-rw-r--r--src/include/kernel/misc.H13
-rw-r--r--src/include/sys/misc.h4
-rw-r--r--src/include/usr/isteps/istep16list.H4
-rw-r--r--src/include/usr/targeting/common/util.H11
6 files changed, 67 insertions, 12 deletions
diff --git a/src/include/arch/ppc.H b/src/include/arch/ppc.H
index 8402f743c..455728500 100644
--- a/src/include/arch/ppc.H
+++ b/src/include/arch/ppc.H
@@ -339,6 +339,29 @@ inline void nap()
{
// @todo-RTC:130186 Add new stop command support
//asm volatile("nap");
+
+ // Nap should be equivalent to 'stop 1' (no state loss)
+ // 855 reg for HYPV, 823 reg otherwise
+ // using EC(bit43) as 1 here (system reset or LPCR event)
+ // PHYP uses bit 42 as 1 also
+// register uint64_t psscr = 0x0000000000310001;
+// asm volatile("mtspr 823, %0; isync" :: "r" (psscr));
+// asm volatile(".long 0x4C0002E4"); // When GCC supports 'stop', use it
+}
+
+ALWAYS_INLINE
+inline void setPSSCR(uint64_t _psscr)
+{
+ register uint64_t psscr = _psscr;
+ asm volatile("mtspr 855, %0; isync" :: "r" (psscr));
+}
+
+ALWAYS_INLINE
+inline uint64_t getPSSCR()
+{
+ register uint64_t psscr = 0;
+ asm volatile("mfspr %0, 855" : "=r" (psscr));
+ return psscr;
}
ALWAYS_INLINE
@@ -426,6 +449,10 @@ enum
// some state from the core doing the
// wakeup to apply into the woken one.
+ MAGIC_SIMICS_FUSEDCOREWAKE = 11, // Indicate to the PHYP model of simics
+ // that we are waking up and expecting
+ // CORES to become fused.
+
MAGIC_SHUTDOWN = 7006, // KernelMisc::shutdown() called.
MAGIC_BREAK = 7007, // hard-code a breakpoint
MAGIC_RANDOM = 7008, // generate random number
@@ -433,6 +460,13 @@ enum
MAGIC_FAKEPAYLOAD_ENTER = 7010, // Entered the fake payload.
MAGIC_SIMICS_CHECK = 7011, // Check if system is running on simics
MAGIC_LOAD_PAYLOAD = 7012, // load payload from flash
+
+ // These are used for getting threads
+ // going after doing 'stop/winkle'
+ MAGIC_WAKE_MASTER_THREAD = 7015, // Wake master thread
+ MAGIC_WAKE_OTHER_THREADS = 7016, // Wake other threads on initial CORE
+ MAGIC_WAKE_FUSED_THREADS = 7017, // Wake up fused core threads
+
MAGIC_CONTINUOUS_TRACE = 7055, // extract mixed trace buffer
};
diff --git a/src/include/kernel/cpumgr.H b/src/include/kernel/cpumgr.H
index 68f897278..30009da73 100644
--- a/src/include/kernel/cpumgr.H
+++ b/src/include/kernel/cpumgr.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -184,14 +186,15 @@ class CpuManager
*/
static const uint64_t WAKEUP_RPR_VALUE = 0x0001032021223F;
- protected:
- CpuManager();
- ~CpuManager() {}
-
/** @fn startCPU
* Starts the requested CPU. Default of -1 implies current CPU.
*/
void startCPU(ssize_t i = -1);
+
+ protected:
+ CpuManager();
+ ~CpuManager() {}
+
void startSlaveCPU(cpu_t*);
private:
diff --git a/src/include/kernel/misc.H b/src/include/kernel/misc.H
index 2d24c9d85..802df9090 100644
--- a/src/include/kernel/misc.H
+++ b/src/include/kernel/misc.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -93,9 +95,11 @@ 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
*/
- WinkleCore(task_t* i_caller) :
- iv_caller(i_caller), iv_timebase(0) {};
+ WinkleCore(task_t* i_caller, bool i_fusedCores) :
+ iv_caller(i_caller), iv_timebase(0),
+ iv_fusedCores(i_fusedCores) {};
void masterPreWork();
void activeMainWork();
@@ -107,6 +111,9 @@ namespace KernelMisc
task_t* iv_caller;
/** Current time-base value for restore after winkle. */
uint64_t iv_timebase;
+ /** Fused core has 8 threads per core (normal is 4). */
+ /** So when winkling core, we need a 2nd core started. */
+ bool iv_fusedCores;
};
/** @class WinkleAll
diff --git a/src/include/sys/misc.h b/src/include/sys/misc.h
index 625b1a78b..74f5ac46a 100644
--- a/src/include/sys/misc.h
+++ b/src/include/sys/misc.h
@@ -191,13 +191,15 @@ uint64_t cpu_spr_value(CpuSprNames spr);
* Will execute the winkle instruction on all running threads and return when
* an IPI is receieved on the master thread of the core.
*
+ * @param[in] i_fusedCores - Fused cores if true, Regular cores if false
+ *
* @retval 0 - Success
* @retval -EDEADLK - Cores other than the master are already running.
*
* @note This function will migrate the task to the master thread and in the
* process will unset any task affinity. See task_affinity_unpin().
*/
-int cpu_master_winkle();
+int cpu_master_winkle(bool i_fusedCores);
/** @fn cpu_all_winkle
* @brief Winkle all the threads.
diff --git a/src/include/usr/isteps/istep16list.H b/src/include/usr/isteps/istep16list.H
index 3effb1adf..4f5ab931c 100644
--- a/src/include/usr/isteps/istep16list.H
+++ b/src/include/usr/isteps/istep16list.H
@@ -111,13 +111,13 @@ namespace INITSERVICE
NULL,
{ NONE, EXT_IMAGE, IPL_NOOP, false }
},
-// @todo RTC:137389 - removed for P9 bringup
-#if (0)
{
ISTEPNAME(16,01,"host_activate_master"),
ISTEP_16::call_host_activate_master,
{ START_FN, EXT_IMAGE, NORMAL_IPL_OP | MPIPL_OP, true }
},
+// @todo RTC:137389 - removed for P9 bringup
+#if 0
{
ISTEPNAME(16,02,"host_activate_slave_cores"),
ISTEP_16::call_host_activate_slave_cores,
diff --git a/src/include/usr/targeting/common/util.H b/src/include/usr/targeting/common/util.H
index 29028cc80..1ec88be61 100644
--- a/src/include/usr/targeting/common/util.H
+++ b/src/include/usr/targeting/common/util.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -161,6 +163,13 @@ uint64_t get_bottom_mem_addr(void);
bool orderByNodeAndPosition( Target* i_firstProc,
Target* i_secondProc);
+/**
+ * @brief Checks if we want to be in FUSED mode or not.
+ * @description Fused mode is when 2 cores merge to produce
+ * a core with 8 threads versus 4 threaded cores.
+ * @return Non-zero if FUSED mode, 0 if non-FUSED mode
+ */
+uint8_t is_fused_mode( );
}
OpenPOWER on IntegriCloud