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