mips_ranchu.c: Implement reboot and power-off sequences
In order to implement functional reboot sequence for MIPS Ranchu emulator,
small bootloader was written and it is placed in a read-only memory
region represented as BIOS. Its responsibility is to prepare the boot
arguments a0-a3 with appropriate values before jumping to the kernel entry point.
The registers a0 to a3 should contain the following values:
a0 - 32-bit address of the command line
a1 - RAM size in bytes (ram_size)
a2 - RAM size in bytes (highmen_size)
a3 - 0
The virtual power management device is located at 0x1f00d000 and it
is responsible for responding to kernel reboot and power-off triggers.
In case of a reboot sys_req() kernel will trigger an event coded
with value 0x42 into pm device register, which in turn should trigger
qemu_system_reset_request() following by a cpu reset callback.
Afterwards, bootloader is executed from the default address 0xbfc00000.
In case of a shutdown request (it can be issued with "reboot -p" from
the guest) kernel will send command coded with 0x43 which will result
in a call to qemu_system_shutdown_request() thus effectively exiting
the emulator.
Change-Id: Iab6694794ddfd829a9825b4374a2901d4d113036
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Fix Mingw build.
The compiler was complaining about the printf() parameter type.
Change-Id: Ia1759a2d52f275acf62bf30d126fb3b0ab1050ea
1 file changed