diff options
author | Michel Heily | 2019-03-05 00:16:22 +0100 |
---|---|---|
committer | Peter Maydell | 2019-03-05 16:55:09 +0100 |
commit | 566528f823d1a2e9eb2d7b2ed839547cb31bfc34 (patch) | |
tree | 6053513cce22b4be037227e99a16f1487e711307 /include/hw/watchdog | |
parent | hw/arm/virt: Bump the 255GB initial RAM limit (diff) | |
download | qemu-566528f823d1a2e9eb2d7b2ed839547cb31bfc34.tar.gz qemu-566528f823d1a2e9eb2d7b2ed839547cb31bfc34.tar.xz qemu-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/hw/watchdog')
-rw-r--r-- | include/hw/watchdog/cmsdk-apb-watchdog.h | 8 |
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 |