From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-devel] [PATCH 16/23] hw/arm/armsse: Add unimplemented-device stubs for PPUs
Date: Mon, 21 Jan 2019 18:51:11 +0000 [thread overview]
Message-ID: <20190121185118.18550-17-peter.maydell@linaro.org> (raw)
In-Reply-To: <20190121185118.18550-1-peter.maydell@linaro.org>
Add unimplemented-device stubs for the various Power Policy Unit
devices that the SSE-200 has.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/arm/armsse.h | 11 ++++++++
hw/arm/armsse.c | 58 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h
index dbfcb280605..9855ec5f269 100644
--- a/include/hw/arm/armsse.h
+++ b/include/hw/arm/armsse.h
@@ -106,6 +106,16 @@
#define SSE_MAX_CPUS 2
+/* These define what each PPU in the ppu[] index is for */
+#define CPU0CORE_PPU 0
+#define CPU1CORE_PPU 1
+#define DBG_PPU 2
+#define RAM0_PPU 3
+#define RAM1_PPU 4
+#define RAM2_PPU 5
+#define RAM3_PPU 6
+#define NUM_PPUS 7
+
typedef struct ARMSSE {
/*< private >*/
SysBusDevice parent_obj;
@@ -139,6 +149,7 @@ typedef struct ARMSSE {
IoTKitSysCtl sysinfo;
UnimplementedDeviceState mhu[2];
+ UnimplementedDeviceState ppu[NUM_PPUS];
/*
* 'container' holds all devices seen by all CPUs.
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 1f3dc89c8e8..280ba5c78be 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -31,6 +31,7 @@ struct ARMSSEInfo {
uint32_t sys_version;
SysConfigFormat sys_config_format;
bool has_mhus;
+ bool has_ppus;
};
static const ARMSSEInfo armsse_variants[] = {
@@ -41,6 +42,7 @@ static const ARMSSEInfo armsse_variants[] = {
.sys_version = 0x41743,
.sys_config_format = IoTKitFormat,
.has_mhus = false,
+ .has_ppus = false,
},
};
@@ -265,6 +267,29 @@ static void armsse_init(Object *obj)
sysbus_init_child_obj(obj, "mhu1", &s->mhu[1], sizeof(s->mhu[1]),
TYPE_UNIMPLEMENTED_DEVICE);
}
+ if (info->has_ppus) {
+ for (i = 0; i < info->num_cpus; i++) {
+ char *name = g_strdup_printf("CPU%dCORE_PPU", i);
+ int ppuidx = CPU0CORE_PPU + i;
+
+ sysbus_init_child_obj(obj, name, &s->ppu[ppuidx],
+ sizeof(s->ppu[ppuidx]),
+ TYPE_UNIMPLEMENTED_DEVICE);
+ g_free(name);
+ }
+ sysbus_init_child_obj(obj, "DBG_PPU", &s->ppu[DBG_PPU],
+ sizeof(s->ppu[DBG_PPU]),
+ TYPE_UNIMPLEMENTED_DEVICE);
+ for (i = 0; i < info->sram_banks; i++) {
+ char *name = g_strdup_printf("RAM%d_PPU", i);
+ int ppuidx = RAM0_PPU + i;
+
+ sysbus_init_child_obj(obj, name, &s->ppu[ppuidx],
+ sizeof(s->ppu[ppuidx]),
+ TYPE_UNIMPLEMENTED_DEVICE);
+ g_free(name);
+ }
+ }
object_initialize_child(obj, "nmi-orgate", &s->nmi_orgate,
sizeof(s->nmi_orgate), TYPE_OR_IRQ,
&error_abort, NULL);
@@ -329,6 +354,17 @@ static qemu_irq armsse_get_common_irq_in(ARMSSE *s, int irqno)
}
}
+static void map_ppu(ARMSSE *s, int ppuidx, const char *name, hwaddr addr)
+{
+ /* Map a PPU unimplemented device stub */
+ DeviceState *dev = DEVICE(&s->ppu[ppuidx]);
+
+ qdev_prop_set_string(dev, "name", name);
+ qdev_prop_set_uint64(dev, "size", 0x1000);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->ppu[ppuidx]), 0, addr);
+}
+
static void armsse_realize(DeviceState *dev, Error **errp)
{
ARMSSE *s = ARMSSE(dev);
@@ -833,6 +869,28 @@ static void armsse_realize(DeviceState *dev, Error **errp)
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctl), 0, 0x50021000);
+ if (info->has_ppus) {
+ /* CPUnCORE_PPU for each CPU */
+ for (i = 0; i < info->num_cpus; i++) {
+ char *name = g_strdup_printf("CPU%dCORE_PPU", i);
+
+ map_ppu(s, CPU0CORE_PPU + i, name, 0x50023000 + i * 0x2000);
+ /*
+ * We don't support CPU debug so don't create the
+ * CPU0DEBUG_PPU at 0x50024000 and 0x50026000.
+ */
+ g_free(name);
+ }
+ map_ppu(s, DBG_PPU, "DBG_PPU", 0x50029000);
+
+ for (i = 0; i < info->sram_banks; i++) {
+ char *name = g_strdup_printf("RAM%d_PPU", i);
+
+ map_ppu(s, RAM0_PPU + i, name, 0x5002a000 + i * 0x1000);
+ g_free(name);
+ }
+ }
+
/* This OR gate wires together outputs from the secure watchdogs to NMI */
object_property_set_int(OBJECT(&s->nmi_orgate), 2, "num-lines", &err);
if (err) {
--
2.20.1
next prev parent reply other threads:[~2019-01-21 19:08 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 18:50 [Qemu-devel] [PATCH 00/23] arm: Implement MPS2 AN521 FPGA image Peter Maydell
2019-01-21 18:50 ` [Qemu-devel] [PATCH 01/23] armv7m: Don't assume the NVIC's CPU is CPU 0 Peter Maydell
2019-01-21 20:26 ` Philippe Mathieu-Daudé
2019-01-23 23:44 ` Richard Henderson
2019-01-21 18:50 ` [Qemu-devel] [PATCH 02/23] armv7m: Make cpu object a child of the armv7m container Peter Maydell
2019-01-21 20:30 ` Philippe Mathieu-Daudé
2019-01-23 23:44 ` Richard Henderson
2019-01-21 18:50 ` [Qemu-devel] [PATCH 03/23] armv7m: Pass through start-powered-off CPU property Peter Maydell
2019-01-23 23:45 ` Richard Henderson
2019-01-21 18:50 ` [Qemu-devel] [PATCH 04/23] hw/arm/iotkit: Rename IoTKit to ARMSSE Peter Maydell
2019-01-21 20:32 ` Philippe Mathieu-Daudé
2019-01-25 23:46 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 05/23] hw/arm/iotkit: Refactor into abstract base class and subclass Peter Maydell
2019-01-22 11:01 ` Philippe Mathieu-Daudé
2019-01-25 23:52 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 06/23] hw/arm/iotkit: Rename 'iotkit' local variables and functions Peter Maydell
2019-01-22 11:02 ` Philippe Mathieu-Daudé
2019-01-25 23:52 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 07/23] hw/arm/iotkit: Rename files to hw/arm/armsse.[ch] Peter Maydell
2019-01-22 11:03 ` Philippe Mathieu-Daudé
2019-01-26 0:01 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 08/23] hw/misc/iotkit-secctl: Support 4 internal MPCs Peter Maydell
2019-01-26 0:04 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 09/23] hw/arm/armsse: Make number of SRAM banks parameterised Peter Maydell
2019-01-26 0:06 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 10/23] hw/arm/armsse: Make SRAM bank size configurable Peter Maydell
2019-01-26 0:09 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 11/23] hw/arm/armsse: Support dual-CPU configuration Peter Maydell
2019-01-26 0:14 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 12/23] hw/arm/armsse: Give each CPU its own view of memory Peter Maydell
2019-01-26 0:24 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 13/23] hw/arm/armsse: Put each CPU in its own cluster object Peter Maydell
2019-01-26 0:29 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 14/23] iotkit-sysinfo: Make SYS_VERSION and SYS_CONFIG configurable Peter Maydell
2019-01-26 0:32 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 15/23] hw/arm/armsse: Add unimplemented-device stubs for MHUs Peter Maydell
2019-01-26 0:36 ` Richard Henderson
2019-01-21 18:51 ` Peter Maydell [this message]
2019-01-28 16:17 ` [Qemu-devel] [PATCH 16/23] hw/arm/armsse: Add unimplemented-device stubs for PPUs Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 17/23] hw/arm/armsse: Add unimplemented-device stub for cache control registers Peter Maydell
2019-01-28 16:24 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 18/23] hw/arm/armsse: Add unimplemented-device stub for CPU local " Peter Maydell
2019-01-28 16:25 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 19/23] hw/misc/armsse-cpuid: Implement SSE-200 CPU_IDENTITY register block Peter Maydell
2019-01-28 16:26 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 20/23] hw/arm/armsse: Add CPU_IDENTITY block to SSE-200 Peter Maydell
2019-01-28 16:27 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 21/23] hw/arm/armsse: Add SSE-200 model Peter Maydell
2019-01-28 16:28 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 22/23] hw/arm/mps2-tz: Add IRQ infrastructure to support SSE-200 Peter Maydell
2019-01-28 16:31 ` Richard Henderson
2019-01-21 18:51 ` [Qemu-devel] [PATCH 23/23] hw/arm/mps2-tz: Add mps2-an521 model Peter Maydell
2019-01-28 16:33 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190121185118.18550-17-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).