xref: /openbmc/u-boot/arch/arm/include/asm/ti-common/omap_wdt.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2d7ebbe9dSLukasz Majewski /*
3d7ebbe9dSLukasz Majewski  * omap_wdt.h
4d7ebbe9dSLukasz Majewski  *
5d7ebbe9dSLukasz Majewski  * OMAP Watchdog header file
6d7ebbe9dSLukasz Majewski  *
7d7ebbe9dSLukasz Majewski  * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
8d7ebbe9dSLukasz Majewski  */
9d7ebbe9dSLukasz Majewski 
10d7ebbe9dSLukasz Majewski #ifndef __OMAP_WDT_H__
11d7ebbe9dSLukasz Majewski #define __OMAP_WDT_H__
12d7ebbe9dSLukasz Majewski 
13d7ebbe9dSLukasz Majewski /*
14d7ebbe9dSLukasz Majewski  * Watchdog:
15d7ebbe9dSLukasz Majewski  * Using the prescaler, the OMAP watchdog could go for many
16d7ebbe9dSLukasz Majewski  * months before firing.  These limits work without scaling,
17d7ebbe9dSLukasz Majewski  * with the 60 second default assumed by most tools and docs.
18d7ebbe9dSLukasz Majewski  */
19d7ebbe9dSLukasz Majewski #define TIMER_MARGIN_MAX	(24 * 60 * 60)	/* 1 day */
20d7ebbe9dSLukasz Majewski #define TIMER_MARGIN_DEFAULT	60	/* 60 secs */
21d7ebbe9dSLukasz Majewski #define TIMER_MARGIN_MIN	1
22d7ebbe9dSLukasz Majewski 
23d7ebbe9dSLukasz Majewski #define PTV			0	/* prescale */
24d7ebbe9dSLukasz Majewski #define GET_WLDR_VAL(secs)	(0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
25d7ebbe9dSLukasz Majewski #define WDT_WWPS_PEND_WCLR	BIT(0)
26d7ebbe9dSLukasz Majewski #define WDT_WWPS_PEND_WLDR	BIT(2)
27d7ebbe9dSLukasz Majewski #define WDT_WWPS_PEND_WTGR	BIT(3)
28d7ebbe9dSLukasz Majewski #define WDT_WWPS_PEND_WSPR	BIT(4)
29d7ebbe9dSLukasz Majewski 
30d7ebbe9dSLukasz Majewski #define WDT_WCLR_PRE		BIT(5)
31d7ebbe9dSLukasz Majewski #define WDT_WCLR_PTV_OFF	2
32d7ebbe9dSLukasz Majewski 
33d7ebbe9dSLukasz Majewski /* Watchdog timer registers */
34d7ebbe9dSLukasz Majewski struct wd_timer {
35d7ebbe9dSLukasz Majewski 	unsigned int resv1[4];
36d7ebbe9dSLukasz Majewski 	unsigned int wdtwdsc;	/* offset 0x010 */
37d7ebbe9dSLukasz Majewski 	unsigned int wdtwdst;	/* offset 0x014 */
38d7ebbe9dSLukasz Majewski 	unsigned int wdtwisr;	/* offset 0x018 */
39d7ebbe9dSLukasz Majewski 	unsigned int wdtwier;	/* offset 0x01C */
40d7ebbe9dSLukasz Majewski 	unsigned int wdtwwer;	/* offset 0x020 */
41d7ebbe9dSLukasz Majewski 	unsigned int wdtwclr;	/* offset 0x024 */
42d7ebbe9dSLukasz Majewski 	unsigned int wdtwcrr;	/* offset 0x028 */
43d7ebbe9dSLukasz Majewski 	unsigned int wdtwldr;	/* offset 0x02C */
44d7ebbe9dSLukasz Majewski 	unsigned int wdtwtgr;	/* offset 0x030 */
45d7ebbe9dSLukasz Majewski 	unsigned int wdtwwps;	/* offset 0x034 */
46d7ebbe9dSLukasz Majewski 	unsigned int resv2[3];
47d7ebbe9dSLukasz Majewski 	unsigned int wdtwdly;	/* offset 0x044 */
48d7ebbe9dSLukasz Majewski 	unsigned int wdtwspr;	/* offset 0x048 */
49d7ebbe9dSLukasz Majewski 	unsigned int resv3[1];
50d7ebbe9dSLukasz Majewski 	unsigned int wdtwqeoi;	/* offset 0x050 */
51d7ebbe9dSLukasz Majewski 	unsigned int wdtwqstar;	/* offset 0x054 */
52d7ebbe9dSLukasz Majewski 	unsigned int wdtwqsta;	/* offset 0x058 */
53d7ebbe9dSLukasz Majewski 	unsigned int wdtwqens;	/* offset 0x05C */
54d7ebbe9dSLukasz Majewski 	unsigned int wdtwqenc;	/* offset 0x060 */
55d7ebbe9dSLukasz Majewski 	unsigned int resv4[39];
56d7ebbe9dSLukasz Majewski 	unsigned int wdt_unfr;	/* offset 0x100 */
57d7ebbe9dSLukasz Majewski };
58d7ebbe9dSLukasz Majewski 
59d7ebbe9dSLukasz Majewski #endif /* __OMAP_WDT_H__ */
60