bcm2836.c (9fc7fc4d3909817555ce0af6bcb69dff1606140d) | bcm2836.c (db873cc5d1a4aaa67eea87768d504b2f89d88738) |
---|---|
1/* 2 * Raspberry Pi emulation (c) 2012 Gregory Estrade 3 * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous 4 * 5 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft 6 * Written by Andrew Baumann 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or later. --- 42 unchanged lines hidden (view full) --- 51 const BCM283XInfo *info = bc->info; 52 int n; 53 54 for (n = 0; n < BCM283X_NCPUS; n++) { 55 object_initialize_child(obj, "cpu[*]", &s->cpu[n].core, 56 info->cpu_type); 57 } 58 | 1/* 2 * Raspberry Pi emulation (c) 2012 Gregory Estrade 3 * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous 4 * 5 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft 6 * Written by Andrew Baumann 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or later. --- 42 unchanged lines hidden (view full) --- 51 const BCM283XInfo *info = bc->info; 52 int n; 53 54 for (n = 0; n < BCM283X_NCPUS; n++) { 55 object_initialize_child(obj, "cpu[*]", &s->cpu[n].core, 56 info->cpu_type); 57 } 58 |
59 sysbus_init_child_obj(obj, "control", &s->control, sizeof(s->control), 60 TYPE_BCM2836_CONTROL); | 59 object_initialize_child(obj, "control", &s->control, TYPE_BCM2836_CONTROL); |
61 | 60 |
62 sysbus_init_child_obj(obj, "peripherals", &s->peripherals, 63 sizeof(s->peripherals), TYPE_BCM2835_PERIPHERALS); | 61 object_initialize_child(obj, "peripherals", &s->peripherals, 62 TYPE_BCM2835_PERIPHERALS); |
64 object_property_add_alias(obj, "board-rev", OBJECT(&s->peripherals), 65 "board-rev"); 66 object_property_add_alias(obj, "vcram-size", OBJECT(&s->peripherals), 67 "vcram-size"); 68} 69 70static void bcm2836_realize(DeviceState *dev, Error **errp) 71{ --- 10 unchanged lines hidden (view full) --- 82 if (obj == NULL) { 83 error_setg(errp, "%s: required ram link not found: %s", 84 __func__, error_get_pretty(err)); 85 return; 86 } 87 88 object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj); 89 | 63 object_property_add_alias(obj, "board-rev", OBJECT(&s->peripherals), 64 "board-rev"); 65 object_property_add_alias(obj, "vcram-size", OBJECT(&s->peripherals), 66 "vcram-size"); 67} 68 69static void bcm2836_realize(DeviceState *dev, Error **errp) 70{ --- 10 unchanged lines hidden (view full) --- 81 if (obj == NULL) { 82 error_setg(errp, "%s: required ram link not found: %s", 83 __func__, error_get_pretty(err)); 84 return; 85 } 86 87 object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj); 88 |
90 object_property_set_bool(OBJECT(&s->peripherals), true, "realized", &err); | 89 sysbus_realize(SYS_BUS_DEVICE(&s->peripherals), &err); |
91 if (err) { 92 error_propagate(errp, err); 93 return; 94 } 95 96 object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->peripherals), 97 "sd-bus"); 98 99 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->peripherals), 0, 100 info->peri_base, 1); 101 102 /* bcm2836 interrupt controller (and mailboxes, etc.) */ | 90 if (err) { 91 error_propagate(errp, err); 92 return; 93 } 94 95 object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->peripherals), 96 "sd-bus"); 97 98 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->peripherals), 0, 99 info->peri_base, 1); 100 101 /* bcm2836 interrupt controller (and mailboxes, etc.) */ |
103 object_property_set_bool(OBJECT(&s->control), true, "realized", &err); | 102 sysbus_realize(SYS_BUS_DEVICE(&s->control), &err); |
104 if (err) { 105 error_propagate(errp, err); 106 return; 107 } 108 109 sysbus_mmio_map(SYS_BUS_DEVICE(&s->control), 0, info->ctrl_base); 110 111 sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 0, --- 94 unchanged lines hidden --- | 103 if (err) { 104 error_propagate(errp, err); 105 return; 106 } 107 108 sysbus_mmio_map(SYS_BUS_DEVICE(&s->control), 0, info->ctrl_base); 109 110 sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 0, --- 94 unchanged lines hidden --- |