diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-07-23 11:25:18 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-07-30 16:54:39 -0400 |
commit | 683147254ef7e69ebbbe55280ba6a3c5ae2325d8 (patch) | |
tree | 4f242b09bcd54ab4563e9c6201dc0c8ded351fdc /arch/mips/txx9/generic | |
parent | a49297e8fc8a9a835ac4ec124aa83028abdcc7d5 (diff) |
[MIPS] TXx9: Cleanup watchdog
Unify registration of txx9wdt platform device.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/txx9/generic')
-rw-r--r-- | arch/mips/txx9/generic/setup.c | 12 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4927.c | 7 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4938.c | 7 |
3 files changed, 24 insertions, 2 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 82272e85a042..7b5705d18deb 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/platform_device.h> | ||
23 | #include <asm/bootinfo.h> | 24 | #include <asm/bootinfo.h> |
24 | #include <asm/time.h> | 25 | #include <asm/time.h> |
25 | #include <asm/reboot.h> | 26 | #include <asm/reboot.h> |
@@ -208,6 +209,17 @@ static void __noreturn txx9_machine_halt(void) | |||
208 | } | 209 | } |
209 | } | 210 | } |
210 | 211 | ||
212 | /* Watchdog support */ | ||
213 | void __init txx9_wdt_init(unsigned long base) | ||
214 | { | ||
215 | struct resource res = { | ||
216 | .start = base, | ||
217 | .end = base + 0x100 - 1, | ||
218 | .flags = IORESOURCE_MEM, | ||
219 | }; | ||
220 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
221 | } | ||
222 | |||
211 | /* wrappers */ | 223 | /* wrappers */ |
212 | void __init plat_mem_setup(void) | 224 | void __init plat_mem_setup(void) |
213 | { | 225 | { |
diff --git a/arch/mips/txx9/generic/setup_tx4927.c b/arch/mips/txx9/generic/setup_tx4927.c index 89d6e28add93..b42c85573d0d 100644 --- a/arch/mips/txx9/generic/setup_tx4927.c +++ b/arch/mips/txx9/generic/setup_tx4927.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <asm/txx9/generic.h> | 21 | #include <asm/txx9/generic.h> |
22 | #include <asm/txx9/tx4927.h> | 22 | #include <asm/txx9/tx4927.h> |
23 | 23 | ||
24 | void __init tx4927_wdr_init(void) | 24 | static void __init tx4927_wdr_init(void) |
25 | { | 25 | { |
26 | /* clear WatchDogReset (W1C) */ | 26 | /* clear WatchDogReset (W1C) */ |
27 | tx4927_ccfg_set(TX4927_CCFG_WDRST); | 27 | tx4927_ccfg_set(TX4927_CCFG_WDRST); |
@@ -29,6 +29,11 @@ void __init tx4927_wdr_init(void) | |||
29 | tx4927_ccfg_set(TX4927_CCFG_WR); | 29 | tx4927_ccfg_set(TX4927_CCFG_WR); |
30 | } | 30 | } |
31 | 31 | ||
32 | void __init tx4927_wdt_init(void) | ||
33 | { | ||
34 | txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL); | ||
35 | } | ||
36 | |||
32 | static struct resource tx4927_sdram_resource[4]; | 37 | static struct resource tx4927_sdram_resource[4]; |
33 | 38 | ||
34 | void __init tx4927_setup(void) | 39 | void __init tx4927_setup(void) |
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c index 317378d8579d..b0a3dc8863fd 100644 --- a/arch/mips/txx9/generic/setup_tx4938.c +++ b/arch/mips/txx9/generic/setup_tx4938.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <asm/txx9/generic.h> | 21 | #include <asm/txx9/generic.h> |
22 | #include <asm/txx9/tx4938.h> | 22 | #include <asm/txx9/tx4938.h> |
23 | 23 | ||
24 | void __init tx4938_wdr_init(void) | 24 | static void __init tx4938_wdr_init(void) |
25 | { | 25 | { |
26 | /* clear WatchDogReset (W1C) */ | 26 | /* clear WatchDogReset (W1C) */ |
27 | tx4938_ccfg_set(TX4938_CCFG_WDRST); | 27 | tx4938_ccfg_set(TX4938_CCFG_WDRST); |
@@ -29,6 +29,11 @@ void __init tx4938_wdr_init(void) | |||
29 | tx4938_ccfg_set(TX4938_CCFG_WR); | 29 | tx4938_ccfg_set(TX4938_CCFG_WR); |
30 | } | 30 | } |
31 | 31 | ||
32 | void __init tx4938_wdt_init(void) | ||
33 | { | ||
34 | txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL); | ||
35 | } | ||
36 | |||
32 | static struct resource tx4938_sdram_resource[4]; | 37 | static struct resource tx4938_sdram_resource[4]; |
33 | static struct resource tx4938_sram_resource; | 38 | static struct resource tx4938_sram_resource; |
34 | 39 | ||