From ad06ead062967be31d9474e202263bffe792dee6 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Thu, 22 Jan 2015 08:42:22 -0800 Subject: [PATCH] nrf51: add the watchdog registers. The definitions for the watchdog registers are needed for hard reset. BRANCH=NONE BUG=None TEST=make buildall -j Change-Id: Ief73b98fbe6fc198c3eda28394e76bdf05568fef Signed-off-by: Myles Watson Reviewed-on: https://chromium-review.googlesource.com/242900 Reviewed-by: Randall Spangler --- chip/nrf51/registers.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/chip/nrf51/registers.h b/chip/nrf51/registers.h index 3e8180bd0a..0619c2b409 100644 --- a/chip/nrf51/registers.h +++ b/chip/nrf51/registers.h @@ -354,6 +354,36 @@ #define NRF51_TIMER0_BITMODE_32 3 +/* + * Watchdog Timer (WDT) + */ +#define NRF51_WDT_BASE 0x40010000 +/* Tasks */ +#define NRF51_WDT_START REG32(NRF51_WDT_BASE + 0x000) +/* Events */ +#define NRF51_WDT_TIMEOUT REG32(NRF51_WDT_BASE + 0x100) +/* Registers */ +#define NRF51_WDT_INTENSET REG32(NRF51_WDT_BASE + 0x304) +#define NRF51_WDT_INTENCLR REG32(NRF51_WDT_BASE + 0x308) +#define NRF51_WDT_RUNSTATUS REG32(NRF51_WDT_BASE + 0x400) +#define NRF51_WDT_REQSTATUS REG32(NRF51_WDT_BASE + 0x404) +#define NRF51_WDT_CRV REG32(NRF51_WDT_BASE + 0x504) +#define NRF51_WDT_RREN REG32(NRF51_WDT_BASE + 0x508) +#define NRF51_WDT_CONFIG REG32(NRF51_WDT_BASE + 0x50C) +#define NRF51_WDT_RR(n) REG32(NRF51_WDT_BASE + 0x600 + ((n) * 4)) +#define NRF51_WDT_POWER REG32(NRF51_WDT_BASE + 0xFFC) +/* Bitfields */ +#define NRF51_WDT_RUNSTATUS_RUNNING 1 +#define NRF51_WDT_REQSTATUS_BIT(n) (1<<(n)) +#define NRF51_WDT_RREN_BIT(n) (1<<(n)) +#define NRF51_WDT_CONFIG_SLEEP_PAUSE 0 +#define NRF51_WDT_CONFIG_SLEEP_RUN 1 +#define NRF51_WDT_CONFIG_HALT_PAUSE (0<<4) +#define NRF51_WDT_CONFIG_HALT_RUN (1<<4) + +#define NRF51_WDT_RELOAD_VAL 0x6E524635 + + /* * GPIO */