xref: /openbmc/qemu/include/hw/watchdog/wdt_aspeed.h (revision efa85a4d)
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/sysbus.h"
14 
15 #define TYPE_ASPEED_WDT "aspeed.wdt"
16 #define ASPEED_WDT(obj) \
17     OBJECT_CHECK(AspeedWDTState, (obj), TYPE_ASPEED_WDT)
18 
19 #define ASPEED_WDT_REGS_MAX        (0x20 / 4)
20 
21 typedef struct AspeedWDTState {
22     /*< private >*/
23     SysBusDevice parent_obj;
24     QEMUTimer *timer;
25 
26     /*< public >*/
27     MemoryRegion iomem;
28     uint32_t regs[ASPEED_WDT_REGS_MAX];
29 
30     AspeedSCUState *scu;
31     uint32_t pclk_freq;
32     uint32_t silicon_rev;
33     uint32_t ext_pulse_width_mask;
34 } AspeedWDTState;
35 
36 #endif /* WDT_ASPEED_H */
37