[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 22/24] hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524
From: |
Peter Maydell |
Subject: |
[PATCH v2 22/24] hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524 |
Date: |
Mon, 15 Feb 2021 11:51:36 +0000 |
The AN524 has a PL031 RTC, which we have a model of; provide it
rather than an unimplemented-device stub.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/mps2-tz.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index 183c3920903..2c385422373 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -60,6 +60,7 @@
#include "hw/misc/tz-msc.h"
#include "hw/arm/armsse.h"
#include "hw/dma/pl080.h"
+#include "hw/rtc/pl031.h"
#include "hw/ssi/pl022.h"
#include "hw/i2c/arm_sbcon_i2c.h"
#include "hw/net/lan9118.h"
@@ -132,8 +133,8 @@ struct MPS2TZMachineState {
UnimplementedDeviceState gpio[4];
UnimplementedDeviceState gfx;
UnimplementedDeviceState cldc;
- UnimplementedDeviceState rtc;
UnimplementedDeviceState usb;
+ PL031State rtc;
PL080State dma[4];
TZMSC msc[4];
CMSDKAPBUART uart[6];
@@ -596,6 +597,23 @@ static MemoryRegion *make_i2c(MPS2TZMachineState *mms,
void *opaque,
return sysbus_mmio_get_region(s, 0);
}
+static MemoryRegion *make_rtc(MPS2TZMachineState *mms, void *opaque,
+ const char *name, hwaddr size,
+ const int *irqs)
+{
+ PL031State *pl031 = opaque;
+ SysBusDevice *s;
+
+ object_initialize_child(OBJECT(mms), name, pl031, TYPE_PL031);
+ s = SYS_BUS_DEVICE(pl031);
+ sysbus_realize(s, &error_fatal);
+ /*
+ * The board docs don't give an IRQ number for the PL031, so
+ * presumably it is not connected.
+ */
+ return sysbus_mmio_get_region(s, 0);
+}
+
static void create_non_mpc_ram(MPS2TZMachineState *mms)
{
/*
@@ -846,7 +864,7 @@ static void mps2tz_common_init(MachineState *machine)
{ /* port 9 reserved */ },
{ "clcd", make_unimp_dev, &mms->cldc, 0x4130a000, 0x1000 },
- { "rtc", make_unimp_dev, &mms->rtc, 0x4130b000, 0x1000 },
+ { "rtc", make_rtc, &mms->rtc, 0x4130b000, 0x1000 },
},
}, {
.name = "ahb_ppcexp0",
--
2.20.1
- [PATCH v2 12/24] hw/arm/mps2-tz: Allow PPCPortInfo structures to specify device interrupts, (continued)
- [PATCH v2 12/24] hw/arm/mps2-tz: Allow PPCPortInfo structures to specify device interrupts, Peter Maydell, 2021/02/15
- [PATCH v2 13/24] hw/arm/mps2-tz: Move device IRQ info to data structures, Peter Maydell, 2021/02/15
- [PATCH v2 14/24] hw/arm/mps2-tz: Size the uart-irq-orgate based on the number of UARTs, Peter Maydell, 2021/02/15
- [PATCH v2 15/24] hw/arm/mps2-tz: Allow boards to have different PPCInfo data, Peter Maydell, 2021/02/15
- [PATCH v2 16/24] hw/arm/mps2-tz: Make RAM arrangement board-specific, Peter Maydell, 2021/02/15
- [PATCH v2 17/24] hw/arm/mps2-tz: Set MachineClass default_ram info from RAMInfo data, Peter Maydell, 2021/02/15
- [PATCH v2 18/24] hw/arm/mps2-tz: Support ROMs as well as RAMs, Peter Maydell, 2021/02/15
- [PATCH v2 19/24] hw/arm/mps2-tz: Get armv7m_load_kernel() size argument from RAMInfo, Peter Maydell, 2021/02/15
- [PATCH v2 20/24] hw/arm/mps2-tz: Add new mps3-an524 board, Peter Maydell, 2021/02/15
- [PATCH v2 21/24] hw/arm/mps2-tz: Stub out USB controller for mps3-an524, Peter Maydell, 2021/02/15
- [PATCH v2 22/24] hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524,
Peter Maydell <=
- [PATCH v2 23/24] docs/system/arm/mps2.rst: Document the new mps3-an524 board, Peter Maydell, 2021/02/15
- [PATCH v2 24/24] hw/arm/mps2: Update old infocenter.arm.com URLs, Peter Maydell, 2021/02/15
- Re: [PATCH v2 00/24] hw/arm: New board model mps3-an524, no-reply, 2021/02/15