From 3d08ff698b938613699682b5c5432547a7ebe898 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Mon, 29 Mar 2010 19:23:56 +0000 Subject: Compile pflash_cfi01 only once Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl --- hw/mainstone.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'hw/mainstone.c') 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); } -- cgit v1.2.3