xref: /qemu/include/hw/watchdog/wdt_aspeed.h (revision 6402cbbb)
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 } AspeedWDTState;
31 
32 #endif  /* ASPEED_WDT_H */
33