From 566528f823d1a2e9eb2d7b2ed839547cb31bfc34 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Tue, 5 Mar 2019 01:16:22 +0200 Subject: hw/arm/stellaris: Implement watchdog timer Implement the watchdog timer for the stellaris boards. This device is a close variant of the CMSDK APB watchdog device, so we can model it by subclassing that device and tweaking the behaviour of some of its registers. Signed-off-by: Michel Heily Reviewed-by: Peter Maydell [PMM: rewrote commit message, fixed a few checkpatch nits, added comment giving the URL of the spec for the Stellaris variant of the watchdog device] Signed-off-by: Peter Maydell --- include/hw/watchdog/cmsdk-apb-watchdog.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/hw/watchdog') diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog/cmsdk-apb-watchdog.h index ab8b598..6ae9531 100644 --- a/include/hw/watchdog/cmsdk-apb-watchdog.h +++ b/include/hw/watchdog/cmsdk-apb-watchdog.h @@ -38,6 +38,12 @@ #define CMSDK_APB_WATCHDOG(obj) OBJECT_CHECK(CMSDKAPBWatchdog, (obj), \ TYPE_CMSDK_APB_WATCHDOG) +/* + * This shares the same struct (and cast macro) as the base + * cmsdk-apb-watchdog device. + */ +#define TYPE_LUMINARY_WATCHDOG "luminary-watchdog" + typedef struct CMSDKAPBWatchdog { /*< private >*/ SysBusDevice parent_obj; @@ -46,6 +52,7 @@ typedef struct CMSDKAPBWatchdog { MemoryRegion iomem; qemu_irq wdogint; uint32_t wdogclk_frq; + bool is_luminary; struct ptimer_state *timer; uint32_t control; @@ -54,6 +61,7 @@ typedef struct CMSDKAPBWatchdog { uint32_t itcr; uint32_t itop; uint32_t resetstatus; + const uint32_t *id; } CMSDKAPBWatchdog; #endif -- cgit v1.1