diff options
author | Peter Maydell | 2021-08-12 11:33:32 +0200 |
---|---|---|
committer | Peter Maydell | 2021-09-01 12:08:18 +0200 |
commit | 2f9db77ea8330db9d038603055e0543512365283 (patch) | |
tree | eb8850a1bcf7d1aca9a8f30e2a6a38ca305b4f5c /hw/arm/armv7m.c | |
parent | tests/arm-cpu-features: Add A64FX processor related tests (diff) | |
download | qemu-2f9db77ea8330db9d038603055e0543512365283.tar.gz qemu-2f9db77ea8330db9d038603055e0543512365283.tar.xz qemu-2f9db77ea8330db9d038603055e0543512365283.zip |
arm: Move M-profile RAS register block into its own device
Currently we implement the RAS register block within the NVIC device.
It isn't really very tightly coupled with the NVIC proper, so instead
move it out into a sysbus device of its own and have the top level
ARMv7M container create it and map it into memory at the right
address.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alexandre Iooss <erdnaxe@crans.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Message-id: 20210812093356.1946-2-peter.maydell@linaro.org
Diffstat (limited to 'hw/arm/armv7m.c')
-rw-r--r-- | hw/arm/armv7m.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 9ce5c30cd5..8964730d15 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -231,6 +231,18 @@ static void armv7m_realize(DeviceState *dev, Error **errp) memory_region_add_subregion(&s->container, 0xe0000000, sysbus_mmio_get_region(sbd, 0)); + /* If the CPU has RAS support, create the RAS register block */ + if (cpu_isar_feature(aa32_ras, s->cpu)) { + object_initialize_child(OBJECT(dev), "armv7m-ras", + &s->ras, TYPE_ARMV7M_RAS); + sbd = SYS_BUS_DEVICE(&s->ras); + if (!sysbus_realize(sbd, errp)) { + return; + } + memory_region_add_subregion_overlap(&s->container, 0xe0005000, + sysbus_mmio_get_region(sbd, 0), 1); + } + for (i = 0; i < ARRAY_SIZE(s->bitband); i++) { if (s->enable_bitband) { Object *obj = OBJECT(&s->bitband[i]); |