aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-07-23 11:25:18 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-07-30 16:54:39 -0400
commit683147254ef7e69ebbbe55280ba6a3c5ae2325d8 (patch)
tree4f242b09bcd54ab4563e9c6201dc0c8ded351fdc /arch/mips
parenta49297e8fc8a9a835ac4ec124aa83028abdcc7d5 (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')
-rw-r--r--arch/mips/txx9/generic/setup.c12
-rw-r--r--arch/mips/txx9/generic/setup_tx4927.c7
-rw-r--r--arch/mips/txx9/generic/setup_tx4938.c7
-rw-r--r--arch/mips/txx9/jmr3927/setup.c20
-rw-r--r--arch/mips/txx9/rbtx4927/setup.c21
-rw-r--r--arch/mips/txx9/rbtx4938/setup.c21
6 files changed, 29 insertions, 59 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 */
213void __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 */
212void __init plat_mem_setup(void) 224void __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
24void __init tx4927_wdr_init(void) 24static 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
32void __init tx4927_wdt_init(void)
33{
34 txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
35}
36
32static struct resource tx4927_sdram_resource[4]; 37static struct resource tx4927_sdram_resource[4];
33 38
34void __init tx4927_setup(void) 39void __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
24void __init tx4938_wdr_init(void) 24static 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
32void __init tx4938_wdt_init(void)
33{
34 txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
35}
36
32static struct resource tx4938_sdram_resource[4]; 37static struct resource tx4938_sdram_resource[4];
33static struct resource tx4938_sram_resource; 38static struct resource tx4938_sram_resource;
34 39
diff --git a/arch/mips/txx9/jmr3927/setup.c b/arch/mips/txx9/jmr3927/setup.c
index fa0503efc840..ae34e9a4a8ac 100644
--- a/arch/mips/txx9/jmr3927/setup.c
+++ b/arch/mips/txx9/jmr3927/setup.c
@@ -308,30 +308,16 @@ static int __init jmr3927_rtc_init(void)
308 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 308 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
309} 309}
310 310
311/* Watchdog support */ 311static void __init tx3927_wdt_init(void)
312
313static int __init txx9_wdt_init(unsigned long base)
314{
315 struct resource res = {
316 .start = base,
317 .end = base + 0x100 - 1,
318 .flags = IORESOURCE_MEM,
319 };
320 struct platform_device *dev =
321 platform_device_register_simple("txx9wdt", -1, &res, 1);
322 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
323}
324
325static int __init jmr3927_wdt_init(void)
326{ 312{
327 return txx9_wdt_init(TX3927_TMR_REG(2)); 313 txx9_wdt_init(TX3927_TMR_REG(2));
328} 314}
329 315
330static void __init jmr3927_device_init(void) 316static void __init jmr3927_device_init(void)
331{ 317{
332 __swizzle_addr_b = jmr3927_swizzle_addr_b; 318 __swizzle_addr_b = jmr3927_swizzle_addr_b;
333 jmr3927_rtc_init(); 319 jmr3927_rtc_init();
334 jmr3927_wdt_init(); 320 tx3927_wdt_init();
335} 321}
336 322
337struct txx9_board_vec jmr3927_vec __initdata = { 323struct txx9_board_vec jmr3927_vec __initdata = {
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c
index 54c33c3e9f7d..f01af382e9a8 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -328,30 +328,11 @@ static int __init rbtx4927_ne_init(void)
328 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 328 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
329} 329}
330 330
331/* Watchdog support */
332
333static int __init txx9_wdt_init(unsigned long base)
334{
335 struct resource res = {
336 .start = base,
337 .end = base + 0x100 - 1,
338 .flags = IORESOURCE_MEM,
339 };
340 struct platform_device *dev =
341 platform_device_register_simple("txx9wdt", -1, &res, 1);
342 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
343}
344
345static int __init rbtx4927_wdt_init(void)
346{
347 return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
348}
349
350static void __init rbtx4927_device_init(void) 331static void __init rbtx4927_device_init(void)
351{ 332{
352 toshiba_rbtx4927_rtc_init(); 333 toshiba_rbtx4927_rtc_init();
353 rbtx4927_ne_init(); 334 rbtx4927_ne_init();
354 rbtx4927_wdt_init(); 335 tx4927_wdt_init();
355} 336}
356 337
357struct txx9_board_vec rbtx4927_vec __initdata = { 338struct txx9_board_vec rbtx4927_vec __initdata = {
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c
index e1177b3b9103..ff5fda2151f2 100644
--- a/arch/mips/txx9/rbtx4938/setup.c
+++ b/arch/mips/txx9/rbtx4938/setup.c
@@ -352,30 +352,11 @@ static void __init rbtx4938_arch_init(void)
352 rbtx4938_spi_init(); 352 rbtx4938_spi_init();
353} 353}
354 354
355/* Watchdog support */
356
357static int __init txx9_wdt_init(unsigned long base)
358{
359 struct resource res = {
360 .start = base,
361 .end = base + 0x100 - 1,
362 .flags = IORESOURCE_MEM,
363 };
364 struct platform_device *dev =
365 platform_device_register_simple("txx9wdt", -1, &res, 1);
366 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
367}
368
369static int __init rbtx4938_wdt_init(void)
370{
371 return txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
372}
373
374static void __init rbtx4938_device_init(void) 355static void __init rbtx4938_device_init(void)
375{ 356{
376 rbtx4938_ethaddr_init(); 357 rbtx4938_ethaddr_init();
377 rbtx4938_ne_init(); 358 rbtx4938_ne_init();
378 rbtx4938_wdt_init(); 359 tx4938_wdt_init();
379} 360}
380 361
381struct txx9_board_vec rbtx4938_vec __initdata = { 362struct txx9_board_vec rbtx4938_vec __initdata = {