Revision e4bcb14c hw/pxa2xx.c

b/hw/pxa2xx.c
2036 2036
    struct pxa2xx_state_s *s;
2037 2037
    struct pxa2xx_ssp_s *ssp;
2038 2038
    int iomemtype, i;
2039
    int index;
2039 2040
    s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s));
2040 2041

  
2041 2042
    if (revision && strncmp(revision, "pxa27", 5)) {
......
2070 2071

  
2071 2072
    s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121);
2072 2073

  
2073
    s->mmc = pxa2xx_mmci_init(0x41100000, sd_bdrv, s->pic[PXA2XX_PIC_MMC],
2074
                              s->dma);
2074
    index = drive_get_index(IF_SD, 0, 0);
2075
    if (index == -1) {
2076
        fprintf(stderr, "qemu: missing SecureDigital device\n");
2077
        exit(1);
2078
    }
2079
    s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv,
2080
                              s->pic[PXA2XX_PIC_MMC], s->dma);
2075 2081

  
2076 2082
    for (i = 0; pxa270_serial[i].io_base; i ++)
2077 2083
        if (serial_hds[i])
......
2160 2166
    struct pxa2xx_state_s *s;
2161 2167
    struct pxa2xx_ssp_s *ssp;
2162 2168
    int iomemtype, i;
2169
    int index;
2163 2170

  
2164 2171
    s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s));
2165 2172

  
......
2187 2194

  
2188 2195
    s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85);
2189 2196

  
2190
    s->mmc = pxa2xx_mmci_init(0x41100000, sd_bdrv, s->pic[PXA2XX_PIC_MMC],
2191
                              s->dma);
2197
    index = drive_get_index(IF_SD, 0, 0);
2198
    if (index == -1) {
2199
        fprintf(stderr, "qemu: missing SecureDigital device\n");
2200
        exit(1);
2201
    }
2202
    s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv,
2203
                              s->pic[PXA2XX_PIC_MMC], s->dma);
2192 2204

  
2193 2205
    for (i = 0; pxa255_serial[i].io_base; i ++)
2194 2206
        if (serial_hds[i])

Also available in: Unified diff