diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-05 12:06:41 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-05 12:24:04 +0200 |
commit | 797bc5d911282f7a80f6ba1acdf9bda36a1a70fa (patch) | |
tree | 905801b202e83051ec7ee62109aa79be44531808 /arch | |
parent | 83f87b14eb8e0f2551c183ec3299e9c02f2c38ae (diff) | |
download | barebox-797bc5d911282f7a80f6ba1acdf9bda36a1a70fa.tar.gz barebox-797bc5d911282f7a80f6ba1acdf9bda36a1a70fa.tar.xz |
ARM i.MX/watchdog: Make i.MX watchdog driver the reset source on i.MX
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/clocksource.c | 37 |
2 files changed, 1 insertions, 37 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8278c82e3a..dc90c02e76 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -42,6 +42,7 @@ config ARCH_IMX select GPIOLIB select COMMON_CLK select CLKDEV_LOOKUP + select WATCHDOG_IMX_RESET_SOURCE config ARCH_MXS bool "Freescale i.MX23/28 (mxs) based" diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c index 69a688c09d..e482fad624 100644 --- a/arch/arm/mach-imx/clocksource.c +++ b/arch/arm/mach-imx/clocksource.c @@ -179,40 +179,3 @@ static int imx_gpt_init(void) return platform_driver_register(&imx_gpt_driver); } coredevice_initcall(imx_gpt_init); - -/* - * Watchdog Registers - */ -#ifdef CONFIG_ARCH_IMX1 -#define WDOG_WCR 0x00 /* Watchdog Control Register */ -#define WDOG_WSR 0x04 /* Watchdog Service Register */ -#define WDOG_WSTR 0x08 /* Watchdog Status Register */ -#define WDOG_WCR_WDE (1 << 0) -#else -#define WDOG_WCR 0x00 /* Watchdog Control Register */ -#define WDOG_WSR 0x02 /* Watchdog Service Register */ -#define WDOG_WSTR 0x04 /* Watchdog Status Register */ -#define WDOG_WCR_WDE (1 << 2) -#endif - -/* - * Reset the cpu by setting up the watchdog timer and let it time out - */ -void __noreturn reset_cpu (unsigned long addr) -{ - void __iomem *wdt = IOMEM(IMX_WDT_BASE); - - /* Disable watchdog and set Time-Out field to 0 */ - writew(0x0, wdt + WDOG_WCR); - - /* Write Service Sequence */ - writew(0x5555, wdt + WDOG_WSR); - writew(0xaaaa, wdt + WDOG_WSR); - - /* Enable watchdog */ - writew(WDOG_WCR_WDE, wdt + WDOG_WCR); - - while (1); - /*NOTREACHED*/ -} -EXPORT_SYMBOL(reset_cpu); |