diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-12-02 04:51:10 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-12-02 04:51:10 +0000 |
commit | e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d (patch) | |
tree | 06bee4b9dbf4c7b50e20c9996924d7d132cdfec2 /hw/nand.c | |
parent | 7233b355571ad2a8e7aec7eb19db5f530e81f052 (diff) | |
download | qemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.zip qemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.tar.gz qemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.tar.bz2 |
Add -drive parameter, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/nand.c')
-rw-r--r-- | hw/nand.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -444,14 +444,20 @@ struct nand_flash_s *nand_init(int manf_id, int chip_id) { int pagesize; struct nand_flash_s *s; + int index; if (nand_flash_ids[chip_id].size == 0) { cpu_abort(cpu_single_env, "%s: Unsupported NAND chip ID.\n", __FUNCTION__); } + index = drive_get_index(IF_MTD, 0, 0); + if (index == -1) { + cpu_abort(cpu_single_env, "%s: missing MTD device\n", + __FUNCTION__); + } s = (struct nand_flash_s *) qemu_mallocz(sizeof(struct nand_flash_s)); - s->bdrv = mtd_bdrv; + s->bdrv = drives_table[index].bdrv; s->manf_id = manf_id; s->chip_id = chip_id; s->size = nand_flash_ids[s->chip_id].size << 20; |