q800: implement mac rom reset function for BIOS-less mode
commite24e58e8acdee80ecd5ee8279d56df53b0232a26
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 2 Jan 2020 12:01:50 +0000 (2 13:01 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 7 Jan 2020 12:35:53 +0000 (7 13:35 +0100)
tree2465cce8f1c5b8bffce25e906bc1bf21fa57efe6
parenteb064db94ccd62f054019f41fb8be3f268463a13
q800: implement mac rom reset function for BIOS-less mode

On Linux, calling `reboot(RB_AUTOBOOT);` will result in
arch/m68k/mac/misc.c's mac_reset function being called. That in turn
looks at the rombase (or uses 0x40800000 is there's no rombase), adds
0xa, and jumps to that address. At the moment, there's nothing there, so
the kernel just crashes when trying to reboot. So, this commit adds a
very simple implementation at that location, which just writes to via2
to power down. We also correct the value of ROMBASE while we're at it.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200102120150.281082-1-Jason@zx2c4.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/m68k/q800.c