#include "flash.h"
#include "console.h"
#include "pixel_ops.h"
+#include "sysemu.h"
#define IRQ_TC6393_NAND 0
#define IRQ_TC6393_MMC 1
s->sub_irqs = qemu_allocate_irqs(tc6393xb_sub_irq, s, TC6393XB_NR_IRQS);
- s->flash = nand_init(NAND_MFR_TOSHIBA, 0x76);
+ BlockDriverState *bdrv = NULL;
+ if (drive_get_index(IF_MTD, 0, 0) >= 0) {
+ bdrv = drives_table[drive_get_index(IF_MTD, 0, 0)].bdrv;
+ }
+ s->flash = nand_init(NAND_MFR_TOSHIBA, 0x76, bdrv);
iomemtype = cpu_register_io_memory(0, tc6393xb_readfn,
tc6393xb_writefn, s);