aboutsummaryrefslogtreecommitdiff
path: root/hw/omap_sx1.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/omap_sx1.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/omap_sx1.c')
-rw-r--r--hw/omap_sx1.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/hw/omap_sx1.c b/hw/omap_sx1.c
index 255dcbd74d..2a8419e0b2 100644
--- a/hw/omap_sx1.c
+++ b/hw/omap_sx1.c
@@ -130,6 +130,7 @@ static void sx1_init(ram_addr_t ram_size,
DriveInfo *dinfo;
int fl_idx;
uint32_t flash_size = flash0_size;
+ int be;
if (version == 2) {
flash_size = flash2_size;
@@ -150,11 +151,17 @@ static void sx1_init(ram_addr_t ram_size,
cpu_register_physical_memory(OMAP_CS3_BASE, OMAP_CS3_SIZE, io);
fl_idx = 0;
+#ifdef TARGET_WORDS_BIGENDIAN
+ be = 1;
+#else
+ be = 0;
+#endif
if ((dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
if (!pflash_cfi01_register(OMAP_CS0_BASE, qemu_ram_alloc(flash_size),
- dinfo->bdrv, sector_size, flash_size / sector_size,
- 4, 0, 0, 0, 0)) {
+ dinfo->bdrv, sector_size,
+ flash_size / sector_size,
+ 4, 0, 0, 0, 0, be)) {
fprintf(stderr, "qemu: Error registering flash memory %d.\n",
fl_idx);
}
@@ -171,8 +178,9 @@ static void sx1_init(ram_addr_t ram_size,
OMAP_CS1_SIZE - flash1_size, io);
if (!pflash_cfi01_register(OMAP_CS1_BASE, qemu_ram_alloc(flash1_size),
- dinfo->bdrv, sector_size, flash1_size / sector_size,
- 4, 0, 0, 0, 0)) {
+ dinfo->bdrv, sector_size,
+ flash1_size / sector_size,
+ 4, 0, 0, 0, 0, be)) {
fprintf(stderr, "qemu: Error registering flash memory %d.\n",
fl_idx);
}