summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-08-12 07:20:36 -0700
committerAurelien Jarno <aurelien@aurel32.net>2015-09-13 23:08:51 +0200
commitcdd14a8cf25c34ff8d0777530e8d16565f6bf7a1 (patch)
tree0d07d9525a3c76286ef541b204421cfbb2e805c7
parentbe654c83608eaba199ed45444debf2dd46a88fe6 (diff)
downloadhqemu-cdd14a8cf25c34ff8d0777530e8d16565f6bf7a1.zip
hqemu-cdd14a8cf25c34ff8d0777530e8d16565f6bf7a1.tar.gz
sh4: Fix initramfs initialization for endiannes-mismatched targets
If host and target endianness does not match, loding an initramfs does not work. Fix by writing boot parameters with appropriate endianness conversion. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--hw/sh4/r2d.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 5e22ed7..3b0b2ec 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -338,9 +338,9 @@ static void r2d_init(MachineState *machine)
}
/* initialization which should be done by firmware */
- boot_params.loader_type = 1;
- boot_params.initrd_start = INITRD_LOAD_OFFSET;
- boot_params.initrd_size = initrd_size;
+ boot_params.loader_type = tswap32(1);
+ boot_params.initrd_start = tswap32(INITRD_LOAD_OFFSET);
+ boot_params.initrd_size = tswap32(initrd_size);
}
if (kernel_cmdline) {
OpenPOWER on IntegriCloud