aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-04-11 03:58:19 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-04-11 03:58:19 +0200
commit56839a19e875e5e7b1851840c93422bafb414ef0 (patch)
tree60febaef1d469fd5558596063379fd89eb9c5d0d
parentfd43690777b19e5072f6be22eba17c0894af9e73 (diff)
downloadqemu-56839a19e875e5e7b1851840c93422bafb414ef0.zip
qemu-56839a19e875e5e7b1851840c93422bafb414ef0.tar.gz
qemu-56839a19e875e5e7b1851840c93422bafb414ef0.tar.bz2
hw/r2d: add flash memory
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--default-configs/sh4-softmmu.mak1
-rw-r--r--default-configs/sh4eb-softmmu.mak1
-rw-r--r--hw/r2d.c13
3 files changed, 15 insertions, 0 deletions
diff --git a/default-configs/sh4-softmmu.mak b/default-configs/sh4-softmmu.mak
index 15f4670..7c0d328 100644
--- a/default-configs/sh4-softmmu.mak
+++ b/default-configs/sh4-softmmu.mak
@@ -5,3 +5,4 @@ CONFIG_SERIAL=y
CONFIG_PTIMER=y
CONFIG_VIRTIO_PCI=y
CONFIG_IDE_CORE=y
+CONFIG_PFLASH_CFI02=y
diff --git a/default-configs/sh4eb-softmmu.mak b/default-configs/sh4eb-softmmu.mak
index 7fd5c47..f4c3252 100644
--- a/default-configs/sh4eb-softmmu.mak
+++ b/default-configs/sh4eb-softmmu.mak
@@ -5,3 +5,4 @@ CONFIG_SERIAL=y
CONFIG_PTIMER=y
CONFIG_VIRTIO_PCI=y
CONFIG_IDE_CORE=y
+CONFIG_PFLASH_CFI02=y
diff --git a/hw/r2d.c b/hw/r2d.c
index ec075db..961991b 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -35,6 +35,10 @@
#include "ide.h"
#include "loader.h"
#include "usb.h"
+#include "flash.h"
+
+#define FLASH_BASE 0x00000000
+#define FLASH_SIZE 0x02000000
#define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */
#define SDRAM_SIZE 0x04000000
@@ -237,6 +241,15 @@ static void r2d_init(ram_addr_t ram_size,
mmio_ide_init(0x14001000, 0x1400080c, irq[CF_IDE], 1,
dinfo, NULL);
+ /* onboard flash memory */
+ if ((dinfo = drive_get(IF_PFLASH, 0, 0)) != NULL) {
+ pflash_cfi02_register(0x0, qemu_ram_alloc(FLASH_SIZE),
+ dinfo->bdrv, (16 * 1024),
+ FLASH_SIZE >> 16,
+ 1, 4, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x555, 0x2aa, 0);
+ }
+
/* NIC: rtl8139 on-board, and 2 slots. */
for (i = 0; i < nb_nics; i++)
pci_nic_init_nofail(&nd_table[i], "rtl8139", i==0 ? "2" : NULL);