Revision 26883c69

b/hw/realview.c
138 138
{
139 139
    CPUState *env = NULL;
140 140
    ram_addr_t ram_offset;
141
    DeviceState *dev;
141
    DeviceState *dev, *sysctl, *gpio2;
142 142
    SysBusDevice *busdev;
143 143
    qemu_irq *irqp;
144 144
    qemu_irq pic[64];
145
    qemu_irq mmc_irq[2];
145 146
    PCIBus *pci_bus;
146 147
    NICInfo *nd;
147 148
    i2c_bus *i2c;
......
218 219
    }
219 220

  
220 221
    sys_id = is_pb ? 0x01780500 : 0xc1400400;
221
    arm_sysctl_init(0x10000000, sys_id, proc_id);
222
    sysctl = qdev_create(NULL, "realview_sysctl");
223
    qdev_prop_set_uint32(sysctl, "sys_id", sys_id);
224
    qdev_init_nofail(sysctl);
225
    qdev_prop_set_uint32(sysctl, "proc_id", proc_id);
226
    sysbus_mmio_map(sysbus_from_qdev(sysctl), 0, 0x10000000);
222 227

  
223 228
    if (is_mpcore) {
224 229
        dev = qdev_create(NULL, is_pb ? "a9mpcore_priv": "realview_mpcore");
......
257 262
    sysbus_create_simple("sp804", 0x10011000, pic[4]);
258 263
    sysbus_create_simple("sp804", 0x10012000, pic[5]);
259 264

  
265
    sysbus_create_simple("pl061", 0x10013000, pic[6]);
266
    sysbus_create_simple("pl061", 0x10014000, pic[7]);
267
    gpio2 = sysbus_create_simple("pl061", 0x10015000, pic[8]);
268

  
260 269
    sysbus_create_simple("pl110_versatile", 0x10020000, pic[23]);
261 270

  
262
    sysbus_create_varargs("pl181", 0x10005000, pic[17], pic[18], NULL);
271
    dev = sysbus_create_varargs("pl181", 0x10005000, pic[17], pic[18], NULL);
272
    /* Wire up MMC card detect and read-only signals. These have
273
     * to go to both the PL061 GPIO and the sysctl register.
274
     * Note that the PL181 orders these lines (readonly,inserted)
275
     * and the PL061 has them the other way about. Also the card
276
     * detect line is inverted.
277
     */
278
    mmc_irq[0] = qemu_irq_split(
279
        qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_WPROT),
280
        qdev_get_gpio_in(gpio2, 1));
281
    mmc_irq[1] = qemu_irq_split(
282
        qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN),
283
        qemu_irq_invert(qdev_get_gpio_in(gpio2, 0)));
284
    qdev_connect_gpio_out(dev, 0, mmc_irq[0]);
285
    qdev_connect_gpio_out(dev, 1, mmc_irq[1]);
263 286

  
264 287
    sysbus_create_simple("pl031", 0x10017000, pic[10]);
265 288

  

Also available in: Unified diff