X-Git-Url: http://git.maemo.org/git/?p=qemu;a=blobdiff_plain;f=hw%2Fspitz.c;fp=hw%2Fspitz.c;h=48b0c398df50fb2ff9bbbfda387bc1dfde86f56a;hp=aa1487b20aba91c5f81ff0629da7b02e6b0aa45d;hb=d7fe95afcb248ae4abd613472e340756b9343a93;hpb=c657e7366a67af59b2939b628095e5f2377cb50f diff --git a/hw/spitz.c b/hw/spitz.c index aa1487b..48b0c39 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -173,10 +173,14 @@ static void sl_flash_register(PXA2xxState *cpu, int size) s = (SLNANDState *) qemu_mallocz(sizeof(SLNANDState)); s->ctl = 0; + BlockDriverState *bdrv = NULL; + if (drive_get_index(IF_MTD, 0, 0) >= 0) { + bdrv = drives_table[drive_get_index(IF_MTD, 0, 0)].bdrv; + } if (size == FLASH_128M) - s->nand = nand_init(NAND_MFR_SAMSUNG, 0x73); + s->nand = nand_init(NAND_MFR_SAMSUNG, 0x73, bdrv); else if (size == FLASH_1024M) - s->nand = nand_init(NAND_MFR_SAMSUNG, 0xf1); + s->nand = nand_init(NAND_MFR_SAMSUNG, 0xf1, bdrv); iomemtype = cpu_register_io_memory(0, sl_readfn, sl_writefn, s);