2 * ASPEED Watchdog Controller
4 * Copyright (C) 2016-2017 IBM Corp.
6 * This code is licensed under the GPL version 2 or later. See the
7 * COPYING file in the top-level directory.
13 #include "hw/misc/aspeed_scu.h"
14 #include "hw/sysbus.h"
15 #include "qom/object.h"
17 #define TYPE_ASPEED_WDT "aspeed.wdt"
18 typedef struct AspeedWDTClass AspeedWDTClass
;
19 typedef struct AspeedWDTState AspeedWDTState
;
20 DECLARE_OBJ_CHECKERS(AspeedWDTState
, AspeedWDTClass
,
21 ASPEED_WDT
, TYPE_ASPEED_WDT
)
22 #define TYPE_ASPEED_2400_WDT TYPE_ASPEED_WDT "-ast2400"
23 #define TYPE_ASPEED_2500_WDT TYPE_ASPEED_WDT "-ast2500"
24 #define TYPE_ASPEED_2600_WDT TYPE_ASPEED_WDT "-ast2600"
26 #define ASPEED_WDT_REGS_MAX (0x20 / 4)
28 struct AspeedWDTState
{
30 SysBusDevice parent_obj
;
35 uint32_t regs
[ASPEED_WDT_REGS_MAX
];
42 struct AspeedWDTClass
{
43 SysBusDeviceClass parent_class
;
46 uint32_t ext_pulse_width_mask
;
47 uint32_t reset_ctrl_reg
;
48 void (*reset_pulse
)(AspeedWDTState
*s
, uint32_t property
);
49 void (*wdt_reload
)(AspeedWDTState
*s
);
52 #endif /* WDT_ASPEED_H */