summary refs log tree commit diff stats
path: root/hw/axis_dev88.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-07-29 16:35:19 +0100
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-07-30 06:00:45 +0200
commit522f253ca8c731aafc8e53087a18f6015c4e776e (patch)
tree894cdc4ed1e39119e6315a7add5fdb6a95cfa094 /hw/axis_dev88.c
parentc4f05c8cf715fa613e1985421080e62a7b169284 (diff)
downloadfocaccia-qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.gz
focaccia-qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.zip
hw/nand: Pass block device state to init function
Pass the BlockDeviceState to the nand_init() function rather
than having it look it up via drive_get() itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/axis_dev88.c')
-rw-r--r--hw/axis_dev88.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 0e2135afd0..de1f5a5fce 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -30,6 +30,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "cris-boot.h"
+#include "blockdev.h"
 
 #define D(x)
 #define DNAND(x)
@@ -251,6 +252,7 @@ void axisdev88_init (ram_addr_t ram_size,
     CPUState *env;
     DeviceState *dev;
     SysBusDevice *s;
+    DriveInfo *nand;
     qemu_irq irq[30], nmi[2], *cpu_irq;
     void *etraxfs_dmac;
     struct etraxfs_dma_client *eth[2] = {NULL, NULL};
@@ -278,7 +280,9 @@ void axisdev88_init (ram_addr_t ram_size,
 
 
       /* Attach a NAND flash to CS1.  */
-    nand_state.nand = nand_init(NAND_MFR_STMICRO, 0x39);
+    nand = drive_get(IF_MTD, 0, 0);
+    nand_state.nand = nand_init(nand ? nand->bdrv : NULL,
+                                NAND_MFR_STMICRO, 0x39);
     nand_regs = cpu_register_io_memory(nand_read, nand_write, &nand_state,
                                        DEVICE_NATIVE_ENDIAN);
     cpu_register_physical_memory(0x10000000, 0x05000000, nand_regs);