aboutsummaryrefslogtreecommitdiff
path: root/hw/mainstone.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/mainstone.c
parent5f9fc5ad7efe2840d3170775768fb85686d94869 (diff)
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/mainstone.c')
-rw-r--r--hw/mainstone.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/hw/mainstone.c b/hw/mainstone.c
index 3e517f0704..a4379e3ec6 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -79,6 +79,7 @@ static void mainstone_common_init(ram_addr_t ram_size,
qemu_irq *mst_irq;
DriveInfo *dinfo;
int i;
+ int be;
if (!cpu_model)
cpu_model = "pxa270-c5";
@@ -91,6 +92,11 @@ static void mainstone_common_init(ram_addr_t ram_size,
/* Setup initial (reset) machine state */
cpu->env->regs[15] = mainstone_binfo.loader_start;
+#ifdef TARGET_WORDS_BIGENDIAN
+ be = 1;
+#else
+ be = 0;
+#endif
/* There are two 32MiB flash devices on the board */
for (i = 0; i < 2; i ++) {
dinfo = drive_get(IF_PFLASH, 0, i);
@@ -101,9 +107,10 @@ static void mainstone_common_init(ram_addr_t ram_size,
}
if (!pflash_cfi01_register(mainstone_flash_base[i],
- qemu_ram_alloc(MAINSTONE_FLASH),
- dinfo->bdrv, sector_len,
- MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0)) {
+ qemu_ram_alloc(MAINSTONE_FLASH),
+ dinfo->bdrv, sector_len,
+ MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0,
+ be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
exit(1);
}