aboutsummaryrefslogtreecommitdiff
path: root/hw/mips_r4k.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-03-29 19:23:56 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-03-29 19:23:56 +0000
commit3d08ff698b938613699682b5c5432547a7ebe898 (patch)
treed5613c54e9bb1ce20d5e26db288d99d2a00ad128 /hw/mips_r4k.c
parent5f9fc5ad7efe2840d3170775768fb85686d94869 (diff)
downloadqemu-3d08ff698b938613699682b5c5432547a7ebe898.zip
qemu-3d08ff698b938613699682b5c5432547a7ebe898.tar.gz
qemu-3d08ff698b938613699682b5c5432547a7ebe898.tar.bz2
Compile pflash_cfi01 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/mips_r4k.c')
-rw-r--r--hw/mips_r4k.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index 34b4506..0d5e2a6 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -170,6 +170,7 @@ void mips_r4k_init (ram_addr_t ram_size,
qemu_irq *i8259;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
DriveInfo *dinfo;
+ int be;
/* init CPUs */
if (cpu_model == NULL) {
@@ -218,6 +219,11 @@ void mips_r4k_init (ram_addr_t ram_size,
} else {
bios_size = -1;
}
+#ifdef TARGET_WORDS_BIGENDIAN
+ be = 1;
+#else
+ be = 0;
+#endif
if ((bios_size > 0) && (bios_size <= BIOS_SIZE)) {
bios_offset = qemu_ram_alloc(BIOS_SIZE);
cpu_register_physical_memory(0x1fc00000, BIOS_SIZE,
@@ -228,8 +234,9 @@ void mips_r4k_init (ram_addr_t ram_size,
uint32_t mips_rom = 0x00400000;
bios_offset = qemu_ram_alloc(mips_rom);
if (!pflash_cfi01_register(0x1fc00000, bios_offset,
- dinfo->bdrv, sector_len, mips_rom / sector_len,
- 4, 0, 0, 0, 0)) {
+ dinfo->bdrv, sector_len,
+ mips_rom / sector_len,
+ 4, 0, 0, 0, 0, be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
}
}