Commit d52fff710acfeaad0102c9a0c04bfb614441dcac

Authored by ths
1 parent 74563c16

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
Showing 1 changed file with 5 additions and 4 deletions
hw/mips_malta.c
@@ -535,13 +535,14 @@ static void write_bootloader (CPUState *env, unsigned long bios_offset, int64_t @@ -535,13 +535,14 @@ static void write_bootloader (CPUState *env, unsigned long bios_offset, int64_t
535 535
536 /* Small bootloader */ 536 /* Small bootloader */
537 p = (uint32_t *) (phys_ram_base + bios_offset); 537 p = (uint32_t *) (phys_ram_base + bios_offset);
538 - stl_raw(p++, 0x0bf00010); /* j 0x1fc00040 */ 538 + stl_raw(p++, 0x0bf00006); /* j 0x1fc00018 */
539 stl_raw(p++, 0x00000000); /* nop */ 539 stl_raw(p++, 0x00000000); /* nop */
540 540
541 /* Second part of the bootloader */ 541 /* Second part of the bootloader */
542 - p = (uint32_t *) (phys_ram_base + bios_offset + 0x040);  
543 - stl_raw(p++, 0x3c040000); /* lui a0, 0 */  
544 - stl_raw(p++, 0x34840002); /* ori a0, a0, 2 */ 542 + p = (uint32_t *) (phys_ram_base + bios_offset + 0x018);
  543 + stl_raw(p++, 0x24040002); /* addiu a0, zero, 2 */
  544 + stl_raw(p++, 0x3c1d0000 | (((ENVP_ADDR - 64) >> 16) & 0xffff)); /* lui sp, high(ENVP_ADDR) */
  545 + stl_raw(p++, 0x37bd0000 | ((ENVP_ADDR - 64) & 0xffff)); /* ori sp, a0, low(ENVP_ADDR) */
545 stl_raw(p++, 0x3c050000 | ((ENVP_ADDR >> 16) & 0xffff)); /* lui a1, high(ENVP_ADDR) */ 546 stl_raw(p++, 0x3c050000 | ((ENVP_ADDR >> 16) & 0xffff)); /* lui a1, high(ENVP_ADDR) */
546 stl_raw(p++, 0x34a50000 | (ENVP_ADDR & 0xffff)); /* ori a1, a0, low(ENVP_ADDR) */ 547 stl_raw(p++, 0x34a50000 | (ENVP_ADDR & 0xffff)); /* ori a1, a0, low(ENVP_ADDR) */
547 stl_raw(p++, 0x3c060000 | (((ENVP_ADDR + 8) >> 16) & 0xffff)); /* lui a2, high(ENVP_ADDR + 8) */ 548 stl_raw(p++, 0x3c060000 | (((ENVP_ADDR + 8) >> 16) & 0xffff)); /* lui a2, high(ENVP_ADDR + 8) */