hw/arm/bcm2836: Introduce BCM283XClass::core_count
The BCM2835 has only one core. Introduce the core_count field to be able to use values different than BCM283X_NCPUS (4). Reviewed-by: Luc Michel <luc.michel@greensocs.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20201024170127.3592182-4-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
34d1a4f591
commit
25ea288459
@ -23,6 +23,7 @@ typedef struct BCM283XClass {
|
|||||||
/*< public >*/
|
/*< public >*/
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *cpu_type;
|
const char *cpu_type;
|
||||||
|
unsigned core_count;
|
||||||
hwaddr peri_base; /* Peripheral base address seen by the CPU */
|
hwaddr peri_base; /* Peripheral base address seen by the CPU */
|
||||||
hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */
|
hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */
|
||||||
int clusterid;
|
int clusterid;
|
||||||
@ -39,7 +40,7 @@ static void bcm2836_init(Object *obj)
|
|||||||
BCM283XClass *bc = BCM283X_GET_CLASS(obj);
|
BCM283XClass *bc = BCM283X_GET_CLASS(obj);
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
for (n = 0; n < BCM283X_NCPUS; n++) {
|
for (n = 0; n < bc->core_count; n++) {
|
||||||
object_initialize_child(obj, "cpu[*]", &s->cpu[n].core,
|
object_initialize_child(obj, "cpu[*]", &s->cpu[n].core,
|
||||||
bc->cpu_type);
|
bc->cpu_type);
|
||||||
}
|
}
|
||||||
@ -149,6 +150,7 @@ static void bcm2836_class_init(ObjectClass *oc, void *data)
|
|||||||
BCM283XClass *bc = BCM283X_CLASS(oc);
|
BCM283XClass *bc = BCM283X_CLASS(oc);
|
||||||
|
|
||||||
bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a7");
|
bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a7");
|
||||||
|
bc->core_count = BCM283X_NCPUS;
|
||||||
bc->peri_base = 0x3f000000;
|
bc->peri_base = 0x3f000000;
|
||||||
bc->ctrl_base = 0x40000000;
|
bc->ctrl_base = 0x40000000;
|
||||||
bc->clusterid = 0xf;
|
bc->clusterid = 0xf;
|
||||||
@ -163,6 +165,7 @@ static void bcm2837_class_init(ObjectClass *oc, void *data)
|
|||||||
BCM283XClass *bc = BCM283X_CLASS(oc);
|
BCM283XClass *bc = BCM283X_CLASS(oc);
|
||||||
|
|
||||||
bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a53");
|
bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a53");
|
||||||
|
bc->core_count = BCM283X_NCPUS;
|
||||||
bc->peri_base = 0x3f000000;
|
bc->peri_base = 0x3f000000;
|
||||||
bc->ctrl_base = 0x40000000;
|
bc->ctrl_base = 0x40000000;
|
||||||
bc->clusterid = 0x0;
|
bc->clusterid = 0x0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user