aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/jmr3927
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2007-11-23 11:20:27 -0500
committerRalf Baechle <ralf@linux-mips.org>2008-01-29 05:14:58 -0500
commit2064ba23e58daa929eec6f5e7a2abc24574a95b9 (patch)
tree77967a6451b379f49a62c364e7ef352a0de50f5a /arch/mips/jmr3927
parent68efdb81c6c3b5c1df7169a4b460907198b19103 (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/jmr3927')
-rw-r--r--arch/mips/jmr3927/rbhma3100/setup.c55
1 files changed, 55 insertions, 0 deletions
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}
385device_initcall(jmr3927_rtc_init); 388device_initcall(jmr3927_rtc_init);
389
390/* Watchdog support */
391
392static 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
404static int __init jmr3927_wdt_init(void)
405{
406 return txx9_wdt_init(TX3927_TMR_REG(2));
407}
408device_initcall(jmr3927_wdt_init);
409
410/* Minimum CLK support */
411
412struct 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}
418EXPORT_SYMBOL(clk_get);
419
420int clk_enable(struct clk *clk)
421{
422 return 0;
423}
424EXPORT_SYMBOL(clk_enable);
425
426void clk_disable(struct clk *clk)
427{
428}
429EXPORT_SYMBOL(clk_disable);
430
431unsigned long clk_get_rate(struct clk *clk)
432{
433 return (unsigned long)clk;
434}
435EXPORT_SYMBOL(clk_get_rate);
436
437void clk_put(struct clk *clk)
438{
439}
440EXPORT_SYMBOL(clk_put);