aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-11-29 15:37:07 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-03 22:10:56 -0600
commitacf2c345a98d47c85a5d836a9cca0257c3adc890 (patch)
treecffcc3e2e8a0af0701cb3a032b012ab5ef55eefd
parentd0e44ad2a9633c9d49504f4a0c69ac730cdc0561 (diff)
downloadskiboot-acf2c345a98d47c85a5d836a9cca0257c3adc890.zip
skiboot-acf2c345a98d47c85a5d836a9cca0257c3adc890.tar.gz
skiboot-acf2c345a98d47c85a5d836a9cca0257c3adc890.tar.bz2
direct-controls: enable fast reboot direct controls for mambo
Add mambo direct controls to stop threads, which is required for reliable fast-reboot. Enable direct controls by default on mambo. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/chip.c2
-rw-r--r--core/direct-controls.c20
-rw-r--r--hw/xive.c7
3 files changed, 25 insertions, 4 deletions
diff --git a/core/chip.c b/core/chip.c
index 7de00e2..d2ff3f4 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -109,7 +109,7 @@ void init_chips(void)
if (dt_find_by_path(dt_root, "/mambo")) {
proc_chip_quirks |= QUIRK_NO_CHIPTOD | QUIRK_MAMBO_CALLOUTS
| QUIRK_NO_F000F | QUIRK_NO_PBA | QUIRK_NO_OCC_IRQ
- | QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
+ | QUIRK_NO_RNG;
enable_mambo_console();
diff --git a/core/direct-controls.c b/core/direct-controls.c
index 486d2e8..ba3e4d1 100644
--- a/core/direct-controls.c
+++ b/core/direct-controls.c
@@ -33,7 +33,17 @@ static void mambo_sreset_cpu(struct cpu_thread *cpu)
uint32_t thread_id = pir_to_thread_id(cpu->pir);
char tcl_cmd[50];
- snprintf(tcl_cmd, sizeof(tcl_cmd), "mysim cpu %i:%i set spr pc 0x100", core_id, thread_id);
+ snprintf(tcl_cmd, sizeof(tcl_cmd), "mysim cpu 0:%i:%i start_thread 0x100", core_id, thread_id);
+ callthru_tcl(tcl_cmd, strlen(tcl_cmd));
+}
+
+static void mambo_stop_cpu(struct cpu_thread *cpu)
+{
+ uint32_t core_id = pir_to_core_id(cpu->pir);
+ uint32_t thread_id = pir_to_thread_id(cpu->pir);
+ char tcl_cmd[50];
+
+ snprintf(tcl_cmd, sizeof(tcl_cmd), "mysim cpu 0:%i:%i stop_thread", core_id, thread_id);
callthru_tcl(tcl_cmd, strlen(tcl_cmd));
}
@@ -629,8 +639,14 @@ int sreset_all_prepare(void)
prlog(PR_DEBUG, "RESET: Resetting from cpu: 0x%x (core 0x%x)\n",
this_cpu()->pir, pir_to_core_id(this_cpu()->pir));
- if (chip_quirk(QUIRK_MAMBO_CALLOUTS))
+ if (chip_quirk(QUIRK_MAMBO_CALLOUTS)) {
+ for_each_ungarded_cpu(cpu) {
+ if (cpu == this_cpu())
+ continue;
+ mambo_stop_cpu(cpu);
+ }
return OPAL_SUCCESS;
+ }
/* Assert special wakup on all cores. Only on operational cores. */
for_each_ungarded_primary(cpu) {
diff --git a/hw/xive.c b/hw/xive.c
index c7d6e62..c0ee2ab 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -239,7 +239,8 @@
static enum {
XIVE_MODE_EMU = OPAL_XIVE_MODE_EMU,
XIVE_MODE_EXPL = OPAL_XIVE_MODE_EXPL,
-} xive_mode;
+ XIVE_MODE_NONE,
+} xive_mode = XIVE_MODE_NONE;
/* Each source controller has one of these. There's one embedded
@@ -4660,6 +4661,8 @@ static int64_t __xive_reset(uint64_t version)
/* Called by fast reboot */
int64_t xive_reset(void)
{
+ if (xive_mode == XIVE_MODE_NONE)
+ return OPAL_SUCCESS;
return __xive_reset(XIVE_MODE_EMU);
}
@@ -5201,6 +5204,8 @@ void init_xive(void)
if (first)
return;
+ xive_mode = XIVE_MODE_EMU;
+
/* Init VP allocator */
xive_init_vp_allocator();