aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-24 22:57:37 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-24 22:57:37 +0000
commitd52fff710acfeaad0102c9a0c04bfb614441dcac (patch)
tree3a83ae5bc8133e21bac3e8571140350b7a1dccb3 /hw
parent74563c166108d296d9c7531d89f2da064e45c258 (diff)
downloadqemu-d52fff710acfeaad0102c9a0c04bfb614441dcac.zip
qemu-d52fff710acfeaad0102c9a0c04bfb614441dcac.tar.gz
qemu-d52fff710acfeaad0102c9a0c04bfb614441dcac.tar.bz2
Improved mini-bootloader, based on a patch by Alec Voropay.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2725 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/mips_malta.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 4f50901..3a11503 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -535,13 +535,14 @@ static void write_bootloader (CPUState *env, unsigned long bios_offset, int64_t
/* Small bootloader */
p = (uint32_t *) (phys_ram_base + bios_offset);
- stl_raw(p++, 0x0bf00010); /* j 0x1fc00040 */
+ stl_raw(p++, 0x0bf00006); /* j 0x1fc00018 */
stl_raw(p++, 0x00000000); /* nop */
/* Second part of the bootloader */
- p = (uint32_t *) (phys_ram_base + bios_offset + 0x040);
- stl_raw(p++, 0x3c040000); /* lui a0, 0 */
- stl_raw(p++, 0x34840002); /* ori a0, a0, 2 */
+ p = (uint32_t *) (phys_ram_base + bios_offset + 0x018);
+ stl_raw(p++, 0x24040002); /* addiu a0, zero, 2 */
+ stl_raw(p++, 0x3c1d0000 | (((ENVP_ADDR - 64) >> 16) & 0xffff)); /* lui sp, high(ENVP_ADDR) */
+ stl_raw(p++, 0x37bd0000 | ((ENVP_ADDR - 64) & 0xffff)); /* ori sp, a0, low(ENVP_ADDR) */
stl_raw(p++, 0x3c050000 | ((ENVP_ADDR >> 16) & 0xffff)); /* lui a1, high(ENVP_ADDR) */
stl_raw(p++, 0x34a50000 | (ENVP_ADDR & 0xffff)); /* ori a1, a0, low(ENVP_ADDR) */
stl_raw(p++, 0x3c060000 | (((ENVP_ADDR + 8) >> 16) & 0xffff)); /* lui a2, high(ENVP_ADDR + 8) */