[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 17/30] hw/arm/bcm2836: Only provide "enabled-cpus" property to
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 17/30] hw/arm/bcm2836: Only provide "enabled-cpus" property to multicore SoCs |
Date: |
Thu, 6 Feb 2020 02:17:43 +0100 |
It makes no sense to set enabled-cpus=0 on single core SoCs.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/arm/bcm2836.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 3b95ad11e9..caaa4b625e 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -32,6 +32,9 @@ typedef struct BCM283XClass {
#define BCM283X_GET_CLASS(obj) \
OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
+static Property bcm2836_enabled_cores_property =
+ DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, 0);
+
static void bcm2836_init(Object *obj)
{
BCM283XState *s = BCM283X(obj);
@@ -43,6 +46,10 @@ static void bcm2836_init(Object *obj)
sizeof(s->cpu[n].core), bc->cpu_type,
&error_abort, NULL);
}
+ if (bc->core_count) {
+ qdev_property_add_static(DEVICE(obj), &bcm2836_enabled_cores_property);
+ qdev_prop_set_uint32(DEVICE(obj), "enabled-cpus", bc->core_count);
+ }
sysbus_init_child_obj(obj, "control", &s->control, sizeof(s->control),
TYPE_BCM2836_CONTROL);
@@ -154,12 +161,6 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
}
}
-static Property bcm2836_props[] = {
- DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus,
- BCM283X_NCPUS),
- DEFINE_PROP_END_OF_LIST()
-};
-
static void bcm283x_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
@@ -179,7 +180,6 @@ static void bcm2836_class_init(ObjectClass *oc, void *data)
bc->ctrl_base = 0x40000000;
bc->clusterid = 0xf;
dc->realize = bcm2836_realize;
- device_class_set_props(dc, bcm2836_props);
};
#ifdef TARGET_AARCH64
@@ -194,7 +194,6 @@ static void bcm2837_class_init(ObjectClass *oc, void *data)
bc->ctrl_base = 0x40000000;
bc->clusterid = 0x0;
dc->realize = bcm2836_realize;
- device_class_set_props(dc, bcm2836_props);
};
#endif
--
2.21.1
- [PATCH v2 07/30] hw/arm/raspi: Make machines children of abstract RaspiMachineClass, (continued)
- [PATCH v2 07/30] hw/arm/raspi: Make machines children of abstract RaspiMachineClass, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 09/30] hw/arm/raspi: Let class_init() directly call raspi_machine_init(), Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 10/30] hw/arm/raspi: Set default RAM size to size encoded in board revision, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 11/30] hw/arm/raspi: Extract the board model from the board revision, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 12/30] hw/arm/raspi: Use a unique raspi_machine_class_init() method, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 13/30] hw/arm/raspi: Extract the cores count from the board revision, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 14/30] hw/arm/bcm2836: Restrict BCM283XClass declaration to C source, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 15/30] hw/arm/bcm2836: QOM'ify more by adding class_init() to each SoC type, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 16/30] hw/arm/bcm2836: Introduce BCM283XClass::core_count, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 17/30] hw/arm/bcm2836: Only provide "enabled-cpus" property to multicore SoCs,
Philippe Mathieu-Daudé <=
- [PATCH v2 18/30] hw/arm/bcm2836: Split out common realize() code, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 19/30] hw/arm/bcm2836: Introduce the BCM2835 SoC, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 20/30] hw/arm/raspi: Add the Raspberry Pi Zero machine, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 21/30] hw/arm/raspi: Add the Raspberry Pi B+ machine, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 24/30] tests/acceptance/boot_linux_console: Test the raspi1 console, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 23/30] tests/acceptance/boot_linux_console: Add raspi version=2 parameter, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 22/30] tests/acceptance/boot_linux_console: Use raspi console model as key, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 25/30] tests/acceptance/boot_linux_console: Test the raspi0 console, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 26/30] python/qemu/machine: Allow to use other serial consoles than default, Philippe Mathieu-Daudé, 2020/02/05
- [PATCH v2 27/30] tests/acceptance/boot_linux_console: Test the raspi1 AUX console, Philippe Mathieu-Daudé, 2020/02/05