aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-01-14 16:58:00 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-02-15 14:10:07 +0000
commit02284009afc5375cbece4816cea05242ab5ac8d7 (patch)
tree18a19c4700b49cd296b4aa2b0b33a88ee2e4d108
parent3d4bd25283b29f3dfe6334217b2b7accaec98994 (diff)
downloadqemu-arm-02284009afc5375cbece4816cea05242ab5ac8d7.tar.gz
hw/arm/armsse: Add support for TYPE_SSE_TIMER in ARMSSEDeviceInfo
The SSE-300 has four timers of type TYPE_SSE_TIMER; add support in the code for having these in an ARMSSEDeviceInfo array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/arm/armsse.c13
-rw-r--r--include/hw/arm/armsse.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index b316fe6957..4cfb2602b1 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -575,6 +575,11 @@ static void armsse_init(Object *obj)
assert(devinfo->index == 0);
object_initialize_child(obj, devinfo->name, &s->dualtimer,
TYPE_CMSDK_APB_DUALTIMER);
+ } else if (!strcmp(devinfo->type, TYPE_SSE_TIMER)) {
+ assert(devinfo->index < ARRAY_SIZE(s->sse_timer));
+ object_initialize_child(obj, devinfo->name,
+ &s->sse_timer[devinfo->index],
+ TYPE_SSE_TIMER);
} else if (!strcmp(devinfo->type, TYPE_CMSDK_APB_WATCHDOG)) {
assert(devinfo->index < ARRAY_SIZE(s->cmsdk_watchdog));
object_initialize_child(obj, devinfo->name,
@@ -1031,6 +1036,14 @@ static void armsse_realize(DeviceState *dev, Error **errp)
return;
}
mr = sysbus_mmio_get_region(sbd, 0);
+ } else if (!strcmp(devinfo->type, TYPE_SSE_TIMER)) {
+ sbd = SYS_BUS_DEVICE(&s->sse_timer[devinfo->index]);
+
+ qdev_connect_clock_in(DEVICE(sbd), "CLK", s->mainclk);
+ if (!sysbus_realize(sbd, errp)) {
+ return;
+ }
+ mr = sysbus_mmio_get_region(sbd, 0);
} else if (!strcmp(devinfo->type, TYPE_CMSDK_APB_WATCHDOG)) {
sbd = SYS_BUS_DEVICE(&s->cmsdk_watchdog[devinfo->index]);
diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h
index 104ba8d26e..533ce329f6 100644
--- a/include/hw/arm/armsse.h
+++ b/include/hw/arm/armsse.h
@@ -97,6 +97,7 @@
#include "hw/misc/tz-mpc.h"
#include "hw/timer/cmsdk-apb-timer.h"
#include "hw/timer/cmsdk-apb-dualtimer.h"
+#include "hw/timer/sse-timer.h"
#include "hw/watchdog/cmsdk-apb-watchdog.h"
#include "hw/misc/iotkit-sysctl.h"
#include "hw/misc/iotkit-sysinfo.h"
@@ -164,6 +165,8 @@ struct ARMSSE {
CMSDKAPBWatchdog cmsdk_watchdog[3];
+ SSETimer sse_timer[4];
+
IoTKitSysCtl sysctl;
IoTKitSysCtl sysinfo;