2 * Copyright (c) 2020 Linaro Limited
5 * Shashi Mallela <shashi.mallela@linaro.org>
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at your
8 * option) any later version. See the COPYING file in the top-level directory.
12 #ifndef WDT_SBSA_GWDT_H
13 #define WDT_SBSA_GWDT_H
15 #include "qemu/bitops.h"
16 #include "hw/sysbus.h"
19 #define TYPE_WDT_SBSA "sbsa_gwdt"
20 #define SBSA_GWDT(obj) \
21 OBJECT_CHECK(SBSA_GWDTState, (obj), TYPE_WDT_SBSA)
22 #define SBSA_GWDT_CLASS(klass) \
23 OBJECT_CLASS_CHECK(SBSA_GWDTClass, (klass), TYPE_WDT_SBSA)
24 #define SBSA_GWDT_GET_CLASS(obj) \
25 OBJECT_GET_CLASS(SBSA_GWDTClass, (obj), TYPE_WDT_SBSA)
27 /* SBSA Generic Watchdog register definitions */
29 #define SBSA_GWDT_WRR 0x000
32 #define SBSA_GWDT_WCS 0x000
33 #define SBSA_GWDT_WOR 0x008
34 #define SBSA_GWDT_WORU 0x00C
35 #define SBSA_GWDT_WCV 0x010
36 #define SBSA_GWDT_WCVU 0x014
38 /* Watchdog Interface Identification Register */
39 #define SBSA_GWDT_W_IIDR 0xFCC
41 /* Watchdog Control and Status Register Bits */
42 #define SBSA_GWDT_WCS_EN BIT(0)
43 #define SBSA_GWDT_WCS_WS0 BIT(1)
44 #define SBSA_GWDT_WCS_WS1 BIT(2)
46 #define SBSA_GWDT_WOR_MASK 0x0000FFFF
49 * Watchdog Interface Identification Register definition
50 * considering JEP106 code for ARM in Bits [11:0]
52 #define SBSA_GWDT_ID 0x1043B
54 /* 2 Separate memory regions for each of refresh & control register frames */
55 #define SBSA_GWDT_RMMIO_SIZE 0x1000
56 #define SBSA_GWDT_CMMIO_SIZE 0x1000
58 #define SBSA_TIMER_FREQ 62500000 /* Hz */
60 typedef struct SBSA_GWDTState
{
62 SysBusDevice parent_obj
;
79 #endif /* WDT_SBSA_GWDT_H */