mirror of https://github.com/xemu-project/xemu.git
hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524
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> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210215115138.20465-23-peter.maydell@linaro.org
This commit is contained in:
parent
a9597753d1
commit
41745d2053
|
@ -60,6 +60,7 @@
|
||||||
#include "hw/misc/tz-msc.h"
|
#include "hw/misc/tz-msc.h"
|
||||||
#include "hw/arm/armsse.h"
|
#include "hw/arm/armsse.h"
|
||||||
#include "hw/dma/pl080.h"
|
#include "hw/dma/pl080.h"
|
||||||
|
#include "hw/rtc/pl031.h"
|
||||||
#include "hw/ssi/pl022.h"
|
#include "hw/ssi/pl022.h"
|
||||||
#include "hw/i2c/arm_sbcon_i2c.h"
|
#include "hw/i2c/arm_sbcon_i2c.h"
|
||||||
#include "hw/net/lan9118.h"
|
#include "hw/net/lan9118.h"
|
||||||
|
@ -132,8 +133,8 @@ struct MPS2TZMachineState {
|
||||||
UnimplementedDeviceState gpio[4];
|
UnimplementedDeviceState gpio[4];
|
||||||
UnimplementedDeviceState gfx;
|
UnimplementedDeviceState gfx;
|
||||||
UnimplementedDeviceState cldc;
|
UnimplementedDeviceState cldc;
|
||||||
UnimplementedDeviceState rtc;
|
|
||||||
UnimplementedDeviceState usb;
|
UnimplementedDeviceState usb;
|
||||||
|
PL031State rtc;
|
||||||
PL080State dma[4];
|
PL080State dma[4];
|
||||||
TZMSC msc[4];
|
TZMSC msc[4];
|
||||||
CMSDKAPBUART uart[6];
|
CMSDKAPBUART uart[6];
|
||||||
|
@ -606,6 +607,23 @@ static MemoryRegion *make_i2c(MPS2TZMachineState *mms, void *opaque,
|
||||||
return sysbus_mmio_get_region(s, 0);
|
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)
|
static void create_non_mpc_ram(MPS2TZMachineState *mms)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -856,7 +874,7 @@ static void mps2tz_common_init(MachineState *machine)
|
||||||
|
|
||||||
{ /* port 9 reserved */ },
|
{ /* port 9 reserved */ },
|
||||||
{ "clcd", make_unimp_dev, &mms->cldc, 0x4130a000, 0x1000 },
|
{ "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",
|
.name = "ahb_ppcexp0",
|
||||||
|
|
Loading…
Reference in New Issue