Revision 7063f49f

b/hw/pl061.c
24 24
#endif
25 25

  
26 26
static const uint8_t pl061_id[12] =
27
  { 0x00, 0x00, 0x00, 0x00, 0x61, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 };
28
static const uint8_t pl061_id_luminary[12] =
27 29
  { 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x18, 0x01, 0x0d, 0xf0, 0x05, 0xb1 };
28 30

  
29 31
typedef struct {
......
50 52
    uint8_t float_high;
51 53
    qemu_irq irq;
52 54
    qemu_irq out[8];
55
    const unsigned char *id;
53 56
} pl061_state;
54 57

  
55 58
static void pl061_update(pl061_state *s)
......
83 86
    pl061_state *s = (pl061_state *)opaque;
84 87

  
85 88
    if (offset >= 0xfd0 && offset < 0x1000) {
86
        return pl061_id[(offset - 0xfd0) >> 2];
89
        return s->id[(offset - 0xfd0) >> 2];
87 90
    }
88 91
    if (offset < 0x400) {
89 92
        return s->data & (offset >> 2);
......
291 294
    return 0;
292 295
}
293 296

  
294
static int pl061_init(SysBusDevice *dev)
297
static int pl061_init(SysBusDevice *dev, const unsigned char *id)
295 298
{
296 299
    int iomemtype;
297 300
    pl061_state *s = FROM_SYSBUS(pl061_state, dev);
298

  
301
    s->id = id;
299 302
    iomemtype = cpu_register_io_memory(pl061_readfn,
300 303
                                       pl061_writefn, s,
301 304
                                       DEVICE_NATIVE_ENDIAN);
......
308 311
    return 0;
309 312
}
310 313

  
314
static int pl061_init_luminary(SysBusDevice *dev)
315
{
316
    return pl061_init(dev, pl061_id_luminary);
317
}
318

  
319
static int pl061_init_arm(SysBusDevice *dev)
320
{
321
    return pl061_init(dev, pl061_id);
322
}
323

  
311 324
static void pl061_register_devices(void)
312 325
{
313 326
    sysbus_register_dev("pl061", sizeof(pl061_state),
314
                        pl061_init);
327
                        pl061_init_arm);
328
    sysbus_register_dev("pl061_luminary", sizeof(pl061_state),
329
                        pl061_init_luminary);
315 330
}
316 331

  
317 332
device_init(pl061_register_devices)
b/hw/stellaris.c
1338 1338

  
1339 1339
    for (i = 0; i < 7; i++) {
1340 1340
        if (board->dc4 & (1 << i)) {
1341
            gpio_dev[i] = sysbus_create_simple("pl061", gpio_addr[i],
1341
            gpio_dev[i] = sysbus_create_simple("pl061_luminary", gpio_addr[i],
1342 1342
                                               pic[gpio_irq[i]]);
1343 1343
            for (j = 0; j < 8; j++) {
1344 1344
                gpio_in[i][j] = qdev_get_gpio_in(gpio_dev[i], j);

Also available in: Unified diff