summaryrefslogtreecommitdiff
path: root/hw/pxa2xx.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-02 04:51:10 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-02 04:51:10 +0000
commite4bcb14c79fb63a35aef3eb39e02c16c19b8b28d (patch)
tree06bee4b9dbf4c7b50e20c9996924d7d132cdfec2 /hw/pxa2xx.c
parent7233b355571ad2a8e7aec7eb19db5f530e81f052 (diff)
downloadqemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.tar.gz
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/pxa2xx.c')
-rw-r--r--hw/pxa2xx.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 00cb2370ae..a67ffefd0d 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -2036,6 +2036,7 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
struct pxa2xx_state_s *s;
struct pxa2xx_ssp_s *ssp;
int iomemtype, i;
+ int index;
s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s));
if (revision && strncmp(revision, "pxa27", 5)) {
@@ -2070,8 +2071,13 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121);
- s->mmc = pxa2xx_mmci_init(0x41100000, sd_bdrv, s->pic[PXA2XX_PIC_MMC],
- s->dma);
+ index = drive_get_index(IF_SD, 0, 0);
+ if (index == -1) {
+ fprintf(stderr, "qemu: missing SecureDigital device\n");
+ exit(1);
+ }
+ s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv,
+ s->pic[PXA2XX_PIC_MMC], s->dma);
for (i = 0; pxa270_serial[i].io_base; i ++)
if (serial_hds[i])
@@ -2160,6 +2166,7 @@ struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size,
struct pxa2xx_state_s *s;
struct pxa2xx_ssp_s *ssp;
int iomemtype, i;
+ int index;
s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s));
@@ -2187,8 +2194,13 @@ struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size,
s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85);
- s->mmc = pxa2xx_mmci_init(0x41100000, sd_bdrv, s->pic[PXA2XX_PIC_MMC],
- s->dma);
+ index = drive_get_index(IF_SD, 0, 0);
+ if (index == -1) {
+ fprintf(stderr, "qemu: missing SecureDigital device\n");
+ exit(1);
+ }
+ s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv,
+ s->pic[PXA2XX_PIC_MMC], s->dma);
for (i = 0; pxa255_serial[i].io_base; i ++)
if (serial_hds[i])