From 4ea81210af681a20d425b52d42285e8c729b6f75 Mon Sep 17 00:00:00 2001 From: J. Aaron Gamble Date: Wed, 22 Sep 2010 11:20:03 -0400 Subject: [PATCH] qemu/powerpc: Added qemu_restart() function qemu_restart code taken from: http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg03147.html Updated qemu machine description to use this function Signed-off-by: J. Aaron Gamble --- arch/powerpc/platforms/qemu/setup.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/qemu/setup.c b/arch/powerpc/platforms/qemu/setup.c index 2d1ecf2..1f37f71 100644 --- a/arch/powerpc/platforms/qemu/setup.c +++ b/arch/powerpc/platforms/qemu/setup.c @@ -159,6 +159,22 @@ static int __init qemu_probe(void) return 1; } +void qemu_restart(char *cmd) +{ + local_irq_disable(); /* no interrupts */ + /* set exception prefix high - to the prom */ + mtmsr(mfmsr() | MSR_IP); + + /* make sure bit 0 (reset) is a 0 */ + outb(inb(0x92) & ~1L, 0x92); + /* signal a reset to system control port A - soft reset */ + outb(inb(0x92) | 1, 0x92); + + while(1); + + /* not reached */ +} + define_machine(qemu) { .name = "QEMU", .probe = qemu_probe, @@ -167,7 +183,7 @@ define_machine(qemu) { .show_cpuinfo = qemu_ibm_cpuinfo, .init_IRQ = qemu_init_IRQ, /* .pcibios_fixup = qemu_pcibios_fixup, */ -/* .restart = qemu_restart, */ + .restart = qemu_restart, /* .power_off = qemu_halt, */ /* .halt = qemu_halt, */ /* .time_init = todc_time_init, */ -- 1.6.5.2