diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2007-11-23 11:20:27 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-01-29 05:14:58 -0500 |
commit | 2064ba23e58daa929eec6f5e7a2abc24574a95b9 (patch) | |
tree | 77967a6451b379f49a62c364e7ef352a0de50f5a /arch/mips | |
parent | 68efdb81c6c3b5c1df7169a4b460907198b19103 (diff) |
[MIPS] TXx9 watchdog support for rbhma3100,rbhma4200,rbhma4500
This patch adds support for txx9wdt driver to rbhma3100, rbhma4200 and
rbhma4500 platform.
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/configs/jmr3927_defconfig | 15 | ||||
-rw-r--r-- | arch/mips/configs/rbhma4200_defconfig | 15 | ||||
-rw-r--r-- | arch/mips/configs/rbhma4500_defconfig | 15 | ||||
-rw-r--r-- | arch/mips/jmr3927/rbhma3100/setup.c | 55 | ||||
-rw-r--r-- | arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | 55 | ||||
-rw-r--r-- | arch/mips/tx4938/toshiba_rbtx4938/setup.c | 25 |
6 files changed, 177 insertions, 3 deletions
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig index eb96791c33ea..4ace37838993 100644 --- a/arch/mips/configs/jmr3927_defconfig +++ b/arch/mips/configs/jmr3927_defconfig | |||
@@ -464,7 +464,6 @@ CONFIG_SERIAL_TXX9_STDSERIAL=y | |||
464 | CONFIG_LEGACY_PTYS=y | 464 | CONFIG_LEGACY_PTYS=y |
465 | CONFIG_LEGACY_PTY_COUNT=256 | 465 | CONFIG_LEGACY_PTY_COUNT=256 |
466 | # CONFIG_IPMI_HANDLER is not set | 466 | # CONFIG_IPMI_HANDLER is not set |
467 | # CONFIG_WATCHDOG is not set | ||
468 | # CONFIG_HW_RANDOM is not set | 467 | # CONFIG_HW_RANDOM is not set |
469 | # CONFIG_RTC is not set | 468 | # CONFIG_RTC is not set |
470 | # CONFIG_R3964 is not set | 469 | # CONFIG_R3964 is not set |
@@ -482,6 +481,20 @@ CONFIG_DEVPORT=y | |||
482 | # CONFIG_W1 is not set | 481 | # CONFIG_W1 is not set |
483 | # CONFIG_POWER_SUPPLY is not set | 482 | # CONFIG_POWER_SUPPLY is not set |
484 | # CONFIG_HWMON is not set | 483 | # CONFIG_HWMON is not set |
484 | CONFIG_WATCHDOG=y | ||
485 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
486 | |||
487 | # | ||
488 | # Watchdog Device Drivers | ||
489 | # | ||
490 | # CONFIG_SOFT_WATCHDOG is not set | ||
491 | CONFIG_TXX9_WDT=y | ||
492 | |||
493 | # | ||
494 | # PCI-based Watchdog Cards | ||
495 | # | ||
496 | # CONFIG_PCIPCWATCHDOG is not set | ||
497 | # CONFIG_WDTPCI is not set | ||
485 | 498 | ||
486 | # | 499 | # |
487 | # Multifunction device drivers | 500 | # Multifunction device drivers |
diff --git a/arch/mips/configs/rbhma4200_defconfig b/arch/mips/configs/rbhma4200_defconfig index 9383a598094b..a67c698a82d9 100644 --- a/arch/mips/configs/rbhma4200_defconfig +++ b/arch/mips/configs/rbhma4200_defconfig | |||
@@ -431,7 +431,6 @@ CONFIG_UNIX98_PTYS=y | |||
431 | CONFIG_LEGACY_PTYS=y | 431 | CONFIG_LEGACY_PTYS=y |
432 | CONFIG_LEGACY_PTY_COUNT=256 | 432 | CONFIG_LEGACY_PTY_COUNT=256 |
433 | # CONFIG_IPMI_HANDLER is not set | 433 | # CONFIG_IPMI_HANDLER is not set |
434 | # CONFIG_WATCHDOG is not set | ||
435 | # CONFIG_HW_RANDOM is not set | 434 | # CONFIG_HW_RANDOM is not set |
436 | # CONFIG_RTC is not set | 435 | # CONFIG_RTC is not set |
437 | # CONFIG_R3964 is not set | 436 | # CONFIG_R3964 is not set |
@@ -449,6 +448,20 @@ CONFIG_DEVPORT=y | |||
449 | # CONFIG_W1 is not set | 448 | # CONFIG_W1 is not set |
450 | # CONFIG_POWER_SUPPLY is not set | 449 | # CONFIG_POWER_SUPPLY is not set |
451 | # CONFIG_HWMON is not set | 450 | # CONFIG_HWMON is not set |
451 | CONFIG_WATCHDOG=y | ||
452 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
453 | |||
454 | # | ||
455 | # Watchdog Device Drivers | ||
456 | # | ||
457 | # CONFIG_SOFT_WATCHDOG is not set | ||
458 | CONFIG_TXX9_WDT=m | ||
459 | |||
460 | # | ||
461 | # PCI-based Watchdog Cards | ||
462 | # | ||
463 | # CONFIG_PCIPCWATCHDOG is not set | ||
464 | # CONFIG_WDTPCI is not set | ||
452 | 465 | ||
453 | # | 466 | # |
454 | # Multifunction device drivers | 467 | # Multifunction device drivers |
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig index d1b56cc0fd7c..ebc8ad4c6439 100644 --- a/arch/mips/configs/rbhma4500_defconfig +++ b/arch/mips/configs/rbhma4500_defconfig | |||
@@ -450,7 +450,6 @@ CONFIG_UNIX98_PTYS=y | |||
450 | CONFIG_LEGACY_PTYS=y | 450 | CONFIG_LEGACY_PTYS=y |
451 | CONFIG_LEGACY_PTY_COUNT=256 | 451 | CONFIG_LEGACY_PTY_COUNT=256 |
452 | # CONFIG_IPMI_HANDLER is not set | 452 | # CONFIG_IPMI_HANDLER is not set |
453 | # CONFIG_WATCHDOG is not set | ||
454 | # CONFIG_HW_RANDOM is not set | 453 | # CONFIG_HW_RANDOM is not set |
455 | # CONFIG_RTC is not set | 454 | # CONFIG_RTC is not set |
456 | # CONFIG_R3964 is not set | 455 | # CONFIG_R3964 is not set |
@@ -479,6 +478,20 @@ CONFIG_SPI_AT25=y | |||
479 | # CONFIG_W1 is not set | 478 | # CONFIG_W1 is not set |
480 | # CONFIG_POWER_SUPPLY is not set | 479 | # CONFIG_POWER_SUPPLY is not set |
481 | # CONFIG_HWMON is not set | 480 | # CONFIG_HWMON is not set |
481 | CONFIG_WATCHDOG=y | ||
482 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
483 | |||
484 | # | ||
485 | # Watchdog Device Drivers | ||
486 | # | ||
487 | # CONFIG_SOFT_WATCHDOG is not set | ||
488 | CONFIG_TXX9_WDT=m | ||
489 | |||
490 | # | ||
491 | # PCI-based Watchdog Cards | ||
492 | # | ||
493 | # CONFIG_PCIPCWATCHDOG is not set | ||
494 | # CONFIG_WDTPCI is not set | ||
482 | 495 | ||
483 | # | 496 | # |
484 | # Multifunction device drivers | 497 | # Multifunction device drivers |
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c index 75cfe6559005..c886d804d303 100644 --- a/arch/mips/jmr3927/rbhma3100/setup.c +++ b/arch/mips/jmr3927/rbhma3100/setup.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
36 | #include <linux/pm.h> | 36 | #include <linux/pm.h> |
37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
38 | #include <linux/clk.h> | ||
38 | #ifdef CONFIG_SERIAL_TXX9 | 39 | #ifdef CONFIG_SERIAL_TXX9 |
39 | #include <linux/serial_core.h> | 40 | #include <linux/serial_core.h> |
40 | #endif | 41 | #endif |
@@ -233,6 +234,8 @@ static void __init tx3927_setup(void) | |||
233 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW; | 234 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW; |
234 | /* Disable PCI snoop */ | 235 | /* Disable PCI snoop */ |
235 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP; | 236 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP; |
237 | /* do reset on watchdog */ | ||
238 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR; | ||
236 | 239 | ||
237 | #ifdef DO_WRITE_THROUGH | 240 | #ifdef DO_WRITE_THROUGH |
238 | /* Enable PCI SNOOP - with write through only */ | 241 | /* Enable PCI SNOOP - with write through only */ |
@@ -383,3 +386,55 @@ static int __init jmr3927_rtc_init(void) | |||
383 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | 386 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
384 | } | 387 | } |
385 | device_initcall(jmr3927_rtc_init); | 388 | device_initcall(jmr3927_rtc_init); |
389 | |||
390 | /* Watchdog support */ | ||
391 | |||
392 | static int __init txx9_wdt_init(unsigned long base) | ||
393 | { | ||
394 | struct resource res = { | ||
395 | .start = base, | ||
396 | .end = base + 0x100 - 1, | ||
397 | .flags = IORESOURCE_MEM, | ||
398 | }; | ||
399 | struct platform_device *dev = | ||
400 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
401 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
402 | } | ||
403 | |||
404 | static int __init jmr3927_wdt_init(void) | ||
405 | { | ||
406 | return txx9_wdt_init(TX3927_TMR_REG(2)); | ||
407 | } | ||
408 | device_initcall(jmr3927_wdt_init); | ||
409 | |||
410 | /* Minimum CLK support */ | ||
411 | |||
412 | struct clk *clk_get(struct device *dev, const char *id) | ||
413 | { | ||
414 | if (!strcmp(id, "imbus_clk")) | ||
415 | return (struct clk *)JMR3927_IMCLK; | ||
416 | return ERR_PTR(-ENOENT); | ||
417 | } | ||
418 | EXPORT_SYMBOL(clk_get); | ||
419 | |||
420 | int clk_enable(struct clk *clk) | ||
421 | { | ||
422 | return 0; | ||
423 | } | ||
424 | EXPORT_SYMBOL(clk_enable); | ||
425 | |||
426 | void clk_disable(struct clk *clk) | ||
427 | { | ||
428 | } | ||
429 | EXPORT_SYMBOL(clk_disable); | ||
430 | |||
431 | unsigned long clk_get_rate(struct clk *clk) | ||
432 | { | ||
433 | return (unsigned long)clk; | ||
434 | } | ||
435 | EXPORT_SYMBOL(clk_get_rate); | ||
436 | |||
437 | void clk_put(struct clk *clk) | ||
438 | { | ||
439 | } | ||
440 | EXPORT_SYMBOL(clk_put); | ||
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c index c29a5283237b..e466e5e711d8 100644 --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/pci.h> | 50 | #include <linux/pci.h> |
51 | #include <linux/pm.h> | 51 | #include <linux/pm.h> |
52 | #include <linux/platform_device.h> | 52 | #include <linux/platform_device.h> |
53 | #include <linux/clk.h> | ||
53 | 54 | ||
54 | #include <asm/bootinfo.h> | 55 | #include <asm/bootinfo.h> |
55 | #include <asm/io.h> | 56 | #include <asm/io.h> |
@@ -803,6 +804,8 @@ void __init plat_mem_setup(void) | |||
803 | } | 804 | } |
804 | 805 | ||
805 | /* CCFG */ | 806 | /* CCFG */ |
807 | /* do reset on watchdog */ | ||
808 | tx4927_ccfgptr->ccfg |= TX4927_CCFG_WR; | ||
806 | /* enable Timeout BusError */ | 809 | /* enable Timeout BusError */ |
807 | if (tx4927_ccfg_toeon) | 810 | if (tx4927_ccfg_toeon) |
808 | tx4927_ccfgptr->ccfg |= TX4927_CCFG_TOE; | 811 | tx4927_ccfgptr->ccfg |= TX4927_CCFG_TOE; |
@@ -944,3 +947,55 @@ static int __init rbtx4927_ne_init(void) | |||
944 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | 947 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
945 | } | 948 | } |
946 | device_initcall(rbtx4927_ne_init); | 949 | device_initcall(rbtx4927_ne_init); |
950 | |||
951 | /* Watchdog support */ | ||
952 | |||
953 | static int __init txx9_wdt_init(unsigned long base) | ||
954 | { | ||
955 | struct resource res = { | ||
956 | .start = base, | ||
957 | .end = base + 0x100 - 1, | ||
958 | .flags = IORESOURCE_MEM, | ||
959 | }; | ||
960 | struct platform_device *dev = | ||
961 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
962 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
963 | } | ||
964 | |||
965 | static int __init rbtx4927_wdt_init(void) | ||
966 | { | ||
967 | return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL); | ||
968 | } | ||
969 | device_initcall(rbtx4927_wdt_init); | ||
970 | |||
971 | /* Minimum CLK support */ | ||
972 | |||
973 | struct clk *clk_get(struct device *dev, const char *id) | ||
974 | { | ||
975 | if (!strcmp(id, "imbus_clk")) | ||
976 | return (struct clk *)50000000; | ||
977 | return ERR_PTR(-ENOENT); | ||
978 | } | ||
979 | EXPORT_SYMBOL(clk_get); | ||
980 | |||
981 | int clk_enable(struct clk *clk) | ||
982 | { | ||
983 | return 0; | ||
984 | } | ||
985 | EXPORT_SYMBOL(clk_enable); | ||
986 | |||
987 | void clk_disable(struct clk *clk) | ||
988 | { | ||
989 | } | ||
990 | EXPORT_SYMBOL(clk_disable); | ||
991 | |||
992 | unsigned long clk_get_rate(struct clk *clk) | ||
993 | { | ||
994 | return (unsigned long)clk; | ||
995 | } | ||
996 | EXPORT_SYMBOL(clk_get_rate); | ||
997 | |||
998 | void clk_put(struct clk *clk) | ||
999 | { | ||
1000 | } | ||
1001 | EXPORT_SYMBOL(clk_put); | ||
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c index 2333d9ff879d..61249f049cd6 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c | |||
@@ -724,6 +724,8 @@ void __init tx4938_board_setup(void) | |||
724 | /* CCFG */ | 724 | /* CCFG */ |
725 | /* clear WatchDogReset,BusErrorOnWrite flag (W1C) */ | 725 | /* clear WatchDogReset,BusErrorOnWrite flag (W1C) */ |
726 | tx4938_ccfgptr->ccfg |= TX4938_CCFG_WDRST | TX4938_CCFG_BEOW; | 726 | tx4938_ccfgptr->ccfg |= TX4938_CCFG_WDRST | TX4938_CCFG_BEOW; |
727 | /* do reset on watchdog */ | ||
728 | tx4938_ccfgptr->ccfg |= TX4938_CCFG_WR; | ||
727 | /* clear PCIC1 reset */ | 729 | /* clear PCIC1 reset */ |
728 | if (tx4938_ccfgptr->clkctr & TX4938_CLKCTR_PCIC1RST) | 730 | if (tx4938_ccfgptr->clkctr & TX4938_CLKCTR_PCIC1RST) |
729 | tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIC1RST; | 731 | tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIC1RST; |
@@ -1121,12 +1123,35 @@ static int __init rbtx4938_spi_init(void) | |||
1121 | } | 1123 | } |
1122 | arch_initcall(rbtx4938_spi_init); | 1124 | arch_initcall(rbtx4938_spi_init); |
1123 | 1125 | ||
1126 | /* Watchdog support */ | ||
1127 | |||
1128 | static int __init txx9_wdt_init(unsigned long base) | ||
1129 | { | ||
1130 | struct resource res = { | ||
1131 | .start = base, | ||
1132 | .end = base + 0x100 - 1, | ||
1133 | .flags = IORESOURCE_MEM, | ||
1134 | .parent = &tx4938_reg_resource, | ||
1135 | }; | ||
1136 | struct platform_device *dev = | ||
1137 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
1138 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
1139 | } | ||
1140 | |||
1141 | static int __init rbtx4938_wdt_init(void) | ||
1142 | { | ||
1143 | return txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL); | ||
1144 | } | ||
1145 | device_initcall(rbtx4938_wdt_init); | ||
1146 | |||
1124 | /* Minimum CLK support */ | 1147 | /* Minimum CLK support */ |
1125 | 1148 | ||
1126 | struct clk *clk_get(struct device *dev, const char *id) | 1149 | struct clk *clk_get(struct device *dev, const char *id) |
1127 | { | 1150 | { |
1128 | if (!strcmp(id, "spi-baseclk")) | 1151 | if (!strcmp(id, "spi-baseclk")) |
1129 | return (struct clk *)(txx9_gbus_clock / 2 / 4); | 1152 | return (struct clk *)(txx9_gbus_clock / 2 / 4); |
1153 | if (!strcmp(id, "imbus_clk")) | ||
1154 | return (struct clk *)(txx9_gbus_clock / 2); | ||
1130 | return ERR_PTR(-ENOENT); | 1155 | return ERR_PTR(-ENOENT); |
1131 | } | 1156 | } |
1132 | EXPORT_SYMBOL(clk_get); | 1157 | EXPORT_SYMBOL(clk_get); |