diff options
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap1/devices.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-omap1/reset.c | 9 |
3 files changed, 23 insertions, 9 deletions
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h index d6ac18d04da..ecd0bb664da 100644 --- a/arch/arm/mach-omap1/common.h +++ b/arch/arm/mach-omap1/common.h @@ -94,6 +94,6 @@ extern int ocpi_enable(void); static inline int ocpi_enable(void) { return 0; } #endif -extern int omap1_get_reset_sources(void); +extern u32 omap1_get_reset_sources(void); #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */ diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index 645668e2b1d..745031870ce 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c @@ -17,6 +17,8 @@ #include <linux/platform_device.h> #include <linux/spi/spi.h> +#include <linux/platform_data/omap-wd-timer.h> + #include <asm/mach/map.h> #include <mach/tc.h> @@ -448,18 +450,31 @@ static struct resource wdt_resources[] = { }; static struct platform_device omap_wdt_device = { - .name = "omap_wdt", - .id = -1, + .name = "omap_wdt", + .id = -1, .num_resources = ARRAY_SIZE(wdt_resources), .resource = wdt_resources, }; static int __init omap_init_wdt(void) { + struct omap_wd_timer_platform_data pdata; + int ret; + if (!cpu_is_omap16xx()) return -ENODEV; - return platform_device_register(&omap_wdt_device); + pdata.read_reset_sources = omap1_get_reset_sources; + + ret = platform_device_register(&omap_wdt_device); + if (!ret) { + ret = platform_device_add_data(&omap_wdt_device, &pdata, + sizeof(pdata)); + if (ret) + platform_device_del(&omap_wdt_device); + } + + return ret; } subsys_initcall(omap_init_wdt); #endif diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c index a0a9f97772e..5eebd7e889d 100644 --- a/arch/arm/mach-omap1/reset.c +++ b/arch/arm/mach-omap1/reset.c @@ -4,10 +4,9 @@ #include <linux/kernel.h> #include <linux/io.h> -#include <plat/prcm.h> - #include <mach/hardware.h> +#include "iomap.h" #include "common.h" /* ARM_SYSST bit shifts related to SoC reset sources */ @@ -43,12 +42,12 @@ void omap1_restart(char mode, const char *cmd) * Returns bits that represent the last reset source for the SoC. The * format is standardized across OMAPs for use by the OMAP watchdog. */ -int omap1_get_reset_sources(void) +u32 omap1_get_reset_sources(void) { - int ret = 0; + u32 ret = 0; u16 rs; - rs = __raw_readw(ARM_SYSST); + rs = __raw_readw(OMAP1_IO_ADDRESS(ARM_SYSST)); if (rs & (1 << ARM_SYSST_POR_SHIFT)) ret |= 1 << OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT; |