@@ -118,4 +118,6 @@ struct A9MPPrivState {
#define TYPE_A15MPCORE_PRIV "a15mpcore_priv"
+#define TYPE_A7MPCORE_PRIV "a7mpcore_priv"
+
#endif
@@ -171,8 +171,7 @@ static void aspeed_soc_ast2600_init(Object *obj)
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
"hw-prot-key");
- object_initialize_child(obj, "a7mpcore", &a->a7mpcore,
- TYPE_A15MPCORE_PRIV);
+ object_initialize_child(obj, "a7mpcore", &a->a7mpcore, TYPE_A7MPCORE_PRIV);
object_initialize_child(obj, "rtc", &s->rtc, TYPE_ASPEED_RTC);
@@ -40,8 +40,7 @@ static void fsl_imx6ul_init(Object *obj)
/*
* A7MPCORE
*/
- object_initialize_child(obj, "a7mpcore", &s->a7mpcore,
- TYPE_A15MPCORE_PRIV);
+ object_initialize_child(obj, "a7mpcore", &s->a7mpcore, TYPE_A7MPCORE_PRIV);
/*
* CCM
@@ -48,8 +48,7 @@ static void fsl_imx7_init(Object *obj)
/*
* A7MPCORE
*/
- object_initialize_child(obj, "a7mpcore", &s->a7mpcore,
- TYPE_A15MPCORE_PRIV);
+ object_initialize_child(obj, "a7mpcore", &s->a7mpcore, TYPE_A7MPCORE_PRIV);
/*
* GPIOs
@@ -121,6 +121,30 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data)
/* We currently have no saveable state */
}
+static void a7mp_priv_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ CortexMPPrivClass *cc = CORTEX_MPCORE_PRIV_CLASS(klass);
+
+ cc->container_size = 0x8000;
+
+ cc->gic_class_name = gic_class_name();
+ cc->gic_revision = 2;
+ /*
+ * The Cortex-A7MP may have anything from 0 to 480 external interrupt
+ * IRQ lines (with another 32 internal). We default to 128+32, which
+ * is the number provided by the Cortex-A15MP test chip in the
+ * Versatile Express A15 development board.
+ * Other boards may differ and should set this property appropriately.
+ */
+ cc->gic_spi_default = 160;
+ cc->gic_spi_max = 480;
+
+ device_class_set_parent_realize(dc, a15mp_priv_realize,
+ &cc->parent_realize);
+ /* We currently have no saveable state */
+}
+
static const TypeInfo a15mp_types[] = {
{
.name = TYPE_A15MPCORE_PRIV,
@@ -128,6 +152,12 @@ static const TypeInfo a15mp_types[] = {
.instance_size = sizeof(CortexMPPrivState),
.class_init = a15mp_priv_class_init,
},
+ {
+ .name = TYPE_A7MPCORE_PRIV,
+ .parent = TYPE_CORTEX_MPCORE_PRIV,
+ .instance_size = sizeof(CortexMPPrivState),
+ .class_init = a7mp_priv_class_init,
+ },
};
DEFINE_TYPES(a15mp_types)
For QEMU modelling, the only difference between the A15 and A7 MPCore is the latter can have up to 480 SPIs. In particular, since commit b151de69f6 ("hw/arm: ast2600: Set AST2600_MAX_IRQ to value from datasheet") the AST2600 machine initializes its GIC with 256 SPIs, which is more than the 224 maximum of the A15. Since the A7 was not available, few boards were using the A15. Replace them by a A7 MPCore. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- The comment in a7mp_priv_class_init() is a bit off. --- include/hw/cpu/cortex_mpcore.h | 2 ++ hw/arm/aspeed_ast2600.c | 3 +-- hw/arm/fsl-imx6ul.c | 3 +-- hw/arm/fsl-imx7.c | 3 +-- hw/cpu/a15mpcore.c | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 6 deletions(-)