Context |
Check |
Description |
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch powerpc/merge (42159d2de18ffa66c2714d988a8c162db8b03956)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch powerpc/next (7794b1d4185e2587af46435e3e2f6696dae314c7)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch linus/master (ae4b064e2a616b545acf02b8f50cc513b32c7522)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch powerpc/fixes (249fad734a25889a4f23ed014d43634af6798063)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch linux-next (938f49c85b36076b19251b316eeaa5435c50ff6e)
|
snowpatch_ozlabs/apply_patch |
fail
|
Failed to apply to any branch
|
@@ -7,7 +7,7 @@ CORE_OBJS = relocate.o console.o stack.o init.o chip.o mem_region.o vm.o
CORE_OBJS += malloc.o lock.o cpu.o utils.o fdt.o opal.o interrupts.o timebase.o
CORE_OBJS += opal-msg.o pci.o pci-virt.o pci-slot.o pcie-slot.o
CORE_OBJS += pci-opal.o fast-reboot.o device.o exceptions.o trace.o affinity.o
-CORE_OBJS += vpd.o platform.o nvram.o nvram-format.o hmi.o mce.o
+CORE_OBJS += vpd.o platform.o nvram.o nvram-format.o hmi.o mce.o stop.o
CORE_OBJS += console-log.o ipmi.o time-utils.o pel.o pool.o errorlog.o
CORE_OBJS += timer.o i2c.o rtc.o flash.o sensor.o ipmi-opal.o
CORE_OBJS += flash-subpartition.o bitmap.o buddy.o pci-quirk.o powercap.o psr.o
@@ -444,6 +444,9 @@ static int64_t opal_register_opal_ops(struct opal_os_ops *__os_ops)
/* v4 must provide printf */
os_ops.os_printf = (void *)be64_to_cpu(__os_ops->os_printf);
+ /* v4 may provide stop (or NULL) */
+ os_ops.os_stop = (void *)be64_to_cpu(__os_ops->os_stop);
+
set_opal_console_to_raw();
checksum_romem();
new file mode 100644
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: Apache-2.0
+/*
+ * Stop idle driver
+ *
+ * Copyright 2019 IBM Corp.
+ */
+
+#define pr_fmt(fmt) "IDLE: " fmt
+
+#include <skiboot.h>
+#include <opal.h>
+#include <processor.h>
+#include <cpu.h>
+#include <cpu.h>
+
+static int64_t opal_cpu_idle(uint64_t latency, bool radix, __be64 *srr1)
+{
+ uint64_t psscr;
+
+ if (!os_ops.os_stop)
+ return OPAL_UNSUPPORTED;
+
+ if (proc_gen != proc_gen_p9)
+ return OPAL_UNSUPPORTED;
+
+ (void)latency;
+ (void)radix;
+ psscr = OPAL_PM_PSSCR_RL(0) \
+ | OPAL_PM_PSSCR_MTL(3) \
+ | OPAL_PM_PSSCR_TR(3);
+ *srr1 = os_ops.os_stop(psscr, true);
+
+ return OPAL_SUCCESS;
+}
+opal_call(OPAL_CPU_IDLE, opal_cpu_idle, 3);
@@ -231,6 +231,7 @@
#define OPAL_LOOKUP_SYMBOL 182
#define OPAL_REGISTER_OS_OPS 183
#define OPAL_HANDLE_MCE 184
+#define OPAL_CPU_IDLE 185
#define OPAL_LAST 184
#define QUIESCE_HOLD 1 /* Spin all calls at entry */
@@ -1259,10 +1260,11 @@ struct opal_mpipl_fadump {
};
struct opal_os_ops {
- __be16 version;
- __be16 reserved0;
- __be32 reserved1;
- __be64 os_printf; /* void printf(int32_t level, const char *str) */
+ __be16 version;
+ __be16 reserved0;
+ __be32 reserved1;
+ __be64 os_printf; /* void printf(int32_t level, const char *str) */
+ __be64 os_stop; /* uint64_t stop(uint64_t psscr, bool save_gprs) */
};
#define MCE_HANDLE_CORRECT 0x0001 /* Attempt to correct */
@@ -20,6 +20,7 @@ struct opal_table_entry {
struct os_ops {
void (*os_printf)(uint32_t log_level, const char *str);
+ uint64_t (*os_stop)(uint64_t psscr, bool save_gprs);
};
extern bool opal_v4_os;