Revision 522f253c hw/tc6393xb.c

b/hw/tc6393xb.c
12 12
#include "flash.h"
13 13
#include "console.h"
14 14
#include "pixel_ops.h"
15
#include "blockdev.h"
15 16

  
16 17
#define IRQ_TC6393_NAND		0
17 18
#define IRQ_TC6393_MMC		1
......
566 567
{
567 568
    int iomemtype;
568 569
    TC6393xbState *s;
570
    DriveInfo *nand;
569 571
    CPUReadMemoryFunc * const tc6393xb_readfn[] = {
570 572
        tc6393xb_readb,
571 573
        tc6393xb_readw,
......
586 588

  
587 589
    s->sub_irqs = qemu_allocate_irqs(tc6393xb_sub_irq, s, TC6393XB_NR_IRQS);
588 590

  
589
    s->flash = nand_init(NAND_MFR_TOSHIBA, 0x76);
591
    nand = drive_get(IF_MTD, 0, 0);
592
    s->flash = nand_init(nand ? nand->bdrv : NULL, NAND_MFR_TOSHIBA, 0x76);
590 593

  
591 594
    iomemtype = cpu_register_io_memory(tc6393xb_readfn,
592 595
                    tc6393xb_writefn, s, DEVICE_NATIVE_ENDIAN);

Also available in: Unified diff