xref: /openbmc/qemu/include/hw/watchdog/wdt_aspeed.h (revision 6a0acfff)
1 /*
2  * ASPEED Watchdog Controller
3  *
4  * Copyright (C) 2016-2017 IBM Corp.
5  *
6  * This code is licensed under the GPL version 2 or later. See the
7  * COPYING file in the top-level directory.
8  */
9 
10 #ifndef WDT_ASPEED_H
11 #define WDT_ASPEED_H
12 
13 #include "hw/misc/aspeed_scu.h"
14 #include "hw/sysbus.h"
15 
16 #define TYPE_ASPEED_WDT "aspeed.wdt"
17 #define ASPEED_WDT(obj) \
18     OBJECT_CHECK(AspeedWDTState, (obj), TYPE_ASPEED_WDT)
19 
20 #define ASPEED_WDT_REGS_MAX        (0x20 / 4)
21 
22 typedef struct AspeedWDTState {
23     /*< private >*/
24     SysBusDevice parent_obj;
25     QEMUTimer *timer;
26 
27     /*< public >*/
28     MemoryRegion iomem;
29     uint32_t regs[ASPEED_WDT_REGS_MAX];
30 
31     AspeedSCUState *scu;
32     uint32_t pclk_freq;
33     uint32_t silicon_rev;
34     uint32_t ext_pulse_width_mask;
35 } AspeedWDTState;
36 
37 #endif /* WDT_ASPEED_H */
38