summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/mips/bootloader.c28
-rw-r--r--hw/mips/boston.c5
-rw-r--r--hw/mips/fuloong2e.c8
3 files changed, 31 insertions, 10 deletions
diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 99991f8b2b..f5f42f2bf2 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -165,15 +165,29 @@ void bl_gen_jump_to(uint32_t **p, target_ulong jump_addr)
bl_gen_nop(p); /* delay slot */
}
-void bl_gen_jump_kernel(uint32_t **p, target_ulong sp, target_ulong a0,
- target_ulong a1, target_ulong a2, target_ulong a3,
+void bl_gen_jump_kernel(uint32_t **p,
+ bool set_sp, target_ulong sp,
+ bool set_a0, target_ulong a0,
+ bool set_a1, target_ulong a1,
+ bool set_a2, target_ulong a2,
+ bool set_a3, target_ulong a3,
target_ulong kernel_addr)
{
- bl_gen_load_ulong(p, BL_REG_SP, sp);
- bl_gen_load_ulong(p, BL_REG_A0, a0);
- bl_gen_load_ulong(p, BL_REG_A1, a1);
- bl_gen_load_ulong(p, BL_REG_A2, a2);
- bl_gen_load_ulong(p, BL_REG_A3, a3);
+ if (set_sp) {
+ bl_gen_load_ulong(p, BL_REG_SP, sp);
+ }
+ if (set_a0) {
+ bl_gen_load_ulong(p, BL_REG_A0, a0);
+ }
+ if (set_a1) {
+ bl_gen_load_ulong(p, BL_REG_A1, a1);
+ }
+ if (set_a2) {
+ bl_gen_load_ulong(p, BL_REG_A2, a2);
+ }
+ if (set_a3) {
+ bl_gen_load_ulong(p, BL_REG_A3, a3);
+ }
bl_gen_jump_to(p, kernel_addr);
}
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 2333bb67b4..edda87e23c 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -352,7 +352,10 @@ static void gen_firmware(uint32_t *p, hwaddr kernel_entry, hwaddr fdt_addr)
* a2/$6 = 0
* a3/$7 = 0
*/
- bl_gen_jump_kernel(&p, 0, (int32_t)-2, fdt_addr, 0, 0, kernel_entry);
+ bl_gen_jump_kernel(&p,
+ true, 0, true, (int32_t)-2,
+ true, fdt_addr, true, 0, true, 0,
+ kernel_entry);
}
static const void *boston_fdt_filter(void *opaque, const void *fdt_orig,
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 50c61f0e4a..34befa5dd5 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -179,8 +179,12 @@ static void write_bootloader(CPUMIPSState *env, uint8_t *base,
/* Second part of the bootloader */
p = (uint32_t *)(base + 0x040);
- bl_gen_jump_kernel(&p, ENVP_VADDR - 64, 2, ENVP_VADDR, ENVP_VADDR + 8,
- loaderparams.ram_size, kernel_addr);
+ bl_gen_jump_kernel(&p,
+ true, ENVP_VADDR - 64,
+ true, 2, true, ENVP_VADDR,
+ true, ENVP_VADDR + 8,
+ true, loaderparams.ram_size,
+ kernel_addr);
}
static void main_cpu_reset(void *opaque)