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/tx4938 | |
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/tx4938')
-rw-r--r-- | arch/mips/tx4938/toshiba_rbtx4938/setup.c | 25 |
1 files changed, 25 insertions, 0 deletions
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); |