Guenter Roeck | d017327 | 2019-06-20 09:28:46 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Komal Shah | 7768a13 | 2006-09-29 01:59:18 -0700 | [diff] [blame] | 2 | /* |
| 3 | * linux/drivers/char/watchdog/omap_wdt.h |
| 4 | * |
| 5 | * BRIEF MODULE DESCRIPTION |
| 6 | * OMAP Watchdog timer register definitions |
| 7 | * |
| 8 | * Copyright (C) 2004 Texas Instruments. |
Komal Shah | 7768a13 | 2006-09-29 01:59:18 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef _OMAP_WATCHDOG_H |
| 12 | #define _OMAP_WATCHDOG_H |
| 13 | |
Felipe Balbi | 2817142 | 2008-09-20 04:14:01 +0300 | [diff] [blame] | 14 | #define OMAP_WATCHDOG_REV (0x00) |
| 15 | #define OMAP_WATCHDOG_SYS_CONFIG (0x10) |
| 16 | #define OMAP_WATCHDOG_STATUS (0x14) |
| 17 | #define OMAP_WATCHDOG_CNTRL (0x24) |
| 18 | #define OMAP_WATCHDOG_CRR (0x28) |
| 19 | #define OMAP_WATCHDOG_LDR (0x2c) |
| 20 | #define OMAP_WATCHDOG_TGR (0x30) |
| 21 | #define OMAP_WATCHDOG_WPS (0x34) |
| 22 | #define OMAP_WATCHDOG_SPR (0x48) |
Komal Shah | 7768a13 | 2006-09-29 01:59:18 -0700 | [diff] [blame] | 23 | |
| 24 | /* Using the prescaler, the OMAP watchdog could go for many |
| 25 | * months before firing. These limits work without scaling, |
| 26 | * with the 60 second default assumed by most tools and docs. |
| 27 | */ |
Wim Van Sebroeck | 5f3b275 | 2011-02-23 20:04:38 +0000 | [diff] [blame] | 28 | #define TIMER_MARGIN_MAX (24 * 60 * 60) /* 1 day */ |
Komal Shah | 7768a13 | 2006-09-29 01:59:18 -0700 | [diff] [blame] | 29 | #define TIMER_MARGIN_DEFAULT 60 /* 60 secs */ |
| 30 | #define TIMER_MARGIN_MIN 1 |
| 31 | |
| 32 | #define PTV 0 /* prescale */ |
| 33 | #define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1) |
Lars Poeschel | 452fafe | 2015-06-17 10:58:59 +0200 | [diff] [blame] | 34 | #define GET_WCCR_SECS(val) ((0xffffffff - (val) + 1) / (32768/(1<<PTV))) |
Komal Shah | 7768a13 | 2006-09-29 01:59:18 -0700 | [diff] [blame] | 35 | |
| 36 | #endif /* _OMAP_WATCHDOG_H */ |