aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-07 12:17:52 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-07 12:17:52 +0000
commit3187ef0390b049ee75bf806f13f6e5004e382c03 (patch)
treea7ec0aafe4653f096c13a542276da37cc68d26e9
parent070ce5edc39df04ffed2b002da27e69859ee01b7 (diff)
Fix firmware word endianness for Malta.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2950 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--hw/mips_malta.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index f113e5611d..7336b7b05f 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -791,6 +791,18 @@ void mips_malta_init (int ram_size, int vga_ram_size, int boot_device,
buf);
exit(1);
}
+ /* In little endian mode the 32bit words in the bios are swapped,
+ a neat trick which allows bi-endian firmware. */
+#ifndef TARGET_WORDS_BIGENDIAN
+ {
+ uint32_t *addr;
+ for (addr = (uint32_t *)(phys_ram_base + bios_offset);
+ addr < (uint32_t *)(phys_ram_base + bios_offset + ret);
+ addr++) {
+ *addr = bswap32(*addr);
+ }
+ }
+#endif
}
/* If a kernel image has been specified, write a small bootloader