summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichel Heily <michelheily@gmail.com>2019-03-05 01:16:22 +0200
committerPeter Maydell <peter.maydell@linaro.org>2019-03-05 15:55:09 +0000
commit566528f823d1a2e9eb2d7b2ed839547cb31bfc34 (patch)
tree6053513cce22b4be037227e99a16f1487e711307 /include
parent50a17297e2f0c4d621c7bb23fee239c0a3fd3128 (diff)
downloadqemu-566528f823d1a2e9eb2d7b2ed839547cb31bfc34.zip
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 <michelheily@gmail.com> Reviewed-by: Peter Maydell <petser.maydell@linaro.org> [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 <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/watchdog/cmsdk-apb-watchdog.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog/cmsdk-apb-watchdog.h
index ab8b5987a1..6ae9531370 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