diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-30 20:45:36 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-04-01 12:08:14 +1100 |
commit | efc1ddab688720063a882f0939e9c6eff91387b1 (patch) | |
tree | ab449d6f57893d11387c5dc49730e689fed0b921 /core/platform.c | |
parent | 16f965ed2ce85eed76592a82f89964fb20bbe5c9 (diff) | |
download | talos-skiboot-efc1ddab688720063a882f0939e9c6eff91387b1.tar.gz talos-skiboot-efc1ddab688720063a882f0939e9c6eff91387b1.zip |
core: Add support for cec_power_down() on mambo
Currently when running on mambo OPAL_CEC_POWER_DOWN doesn't work, the
simulator keeps running.
We can use the magic mambo support instruction with the right opcode to
ask mambo to stop the simulation.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/platform.c')
-rw-r--r-- | core/platform.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/platform.c b/core/platform.c index f93b1418..541fc6c1 100644 --- a/core/platform.c +++ b/core/platform.c @@ -21,6 +21,7 @@ #include <console.h> #include <timebase.h> #include <cpu.h> +#include <chip.h> struct platform platform; @@ -59,9 +60,18 @@ static void generic_platform_init(void) fake_rtc_init(); } +static int64_t generic_cec_power_down(uint64_t request __unused) +{ + if (chip_quirk(QUIRK_MAMBO_CALLOUTS)) + mambo_sim_exit(); + + return OPAL_UNSUPPORTED; +} + static struct platform generic_platform = { - .name = "generic", - .init = generic_platform_init, + .name = "generic", + .init = generic_platform_init, + .cec_power_down = generic_cec_power_down, }; void probe_platform(void) |