@@ -17,6 +17,27 @@
#include "hw/timer/a9gtimer.h"
#include "hw/timer/arm_mptimer.h"
+/*
+ * This is a model of the Arm Cortex-A MPCore family of hardware.
+ *
+ * The A7 and A15 MPCore contain:
+ * up to 4 Cortex-A cores
+ * a GIC
+ * The A9 MPCore additionally contains:
+ * a System Control Unit
+ * some timers and watchdogs
+ */
+#define TYPE_CORTEX_MPCORE_PRIV "cortex_mpcore_priv"
+OBJECT_DECLARE_TYPE(CortexMPPrivState, CortexMPPrivClass, CORTEX_MPCORE_PRIV)
+
+struct CortexMPPrivClass {
+ SysBusDeviceClass parent_class;
+};
+
+struct CortexMPPrivState {
+ SysBusDevice parent_obj;
+};
+
#define TYPE_A9MPCORE_PRIV "a9mpcore_priv"
OBJECT_DECLARE_SIMPLE_TYPE(A9MPPrivState, A9MPCORE_PRIV)
new file mode 100644
@@ -0,0 +1,22 @@
+/*
+ * Cortex-MPCore internal peripheral emulation.
+ *
+ * Copyright (c) 2023 Linaro Limited.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "hw/cpu/cortex_mpcore.h"
+
+static const TypeInfo cortex_mpcore_types[] = {
+ {
+ .name = TYPE_CORTEX_MPCORE_PRIV,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(CortexMPPrivState),
+ .class_size = sizeof(CortexMPPrivClass),
+ .abstract = true,
+ },
+};
+
+DEFINE_TYPES(cortex_mpcore_types)
@@ -643,6 +643,9 @@ config ZAURUS
select NAND
select ECC
+config CORTEX_MPCORE
+ bool
+
config A9MPCORE
bool
select A9_GTIMER
@@ -2,5 +2,6 @@ system_ss.add(files('core.c', 'cluster.c'))
system_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c'))
system_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
+specific_ss.add(when: 'CONFIG_CORTEX_MPCORE', if_true: files('cortex_mpcore.c'))
specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
This type will be common to A9MPCORE/A15MPCORE devices. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/hw/cpu/cortex_mpcore.h | 21 +++++++++++++++++++++ hw/cpu/cortex_mpcore.c | 22 ++++++++++++++++++++++ hw/arm/Kconfig | 3 +++ hw/cpu/meson.build | 1 + 4 files changed, 47 insertions(+) create mode 100644 hw/cpu/cortex_mpcore.c