aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2009-01-20 09:07:41 -0500
committerRalf Baechle <ralf@linux-mips.org>2009-01-30 16:32:58 -0500
commit65655b5a94f6fc7e6450e3e07f2687c523c71c08 (patch)
tree8c910583005dba2f4574340a3e6e79a2b6184d12 /arch/mips
parent42fe7ee31ff904b2419f02864938966c8f0b6edc (diff)
MIPS: TXx9: Add support for TX4939 internal RTC
Add platform support to use rtc-tx4939 driver. 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/include/asm/txx9/tx4939.h1
-rw-r--r--arch/mips/txx9/generic/setup_tx4939.c22
-rw-r--r--arch/mips/txx9/rbtx4939/setup.c1
3 files changed, 24 insertions, 0 deletions
diff --git a/arch/mips/include/asm/txx9/tx4939.h b/arch/mips/include/asm/txx9/tx4939.h
index 88badb423010..964ef7ede268 100644
--- a/arch/mips/include/asm/txx9/tx4939.h
+++ b/arch/mips/include/asm/txx9/tx4939.h
@@ -541,5 +541,6 @@ void tx4939_irq_init(void);
541int tx4939_irq(void); 541int tx4939_irq(void);
542void tx4939_mtd_init(int ch); 542void tx4939_mtd_init(int ch);
543void tx4939_ata_init(void); 543void tx4939_ata_init(void);
544void tx4939_rtc_init(void);
544 545
545#endif /* __ASM_TXX9_TX4939_H */ 546#endif /* __ASM_TXX9_TX4939_H */
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index 6c0049a5bbc1..55440967b3a8 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -435,6 +435,28 @@ void __init tx4939_ata_init(void)
435 platform_device_register(&ata1_dev); 435 platform_device_register(&ata1_dev);
436} 436}
437 437
438void __init tx4939_rtc_init(void)
439{
440 static struct resource res[] = {
441 {
442 .start = TX4939_RTC_REG & 0xfffffffffULL,
443 .end = (TX4939_RTC_REG & 0xfffffffffULL) + 0x100 - 1,
444 .flags = IORESOURCE_MEM,
445 }, {
446 .start = TXX9_IRQ_BASE + TX4939_IR_RTC,
447 .flags = IORESOURCE_IRQ,
448 },
449 };
450 static struct platform_device rtc_dev = {
451 .name = "tx4939rtc",
452 .id = -1,
453 .num_resources = ARRAY_SIZE(res),
454 .resource = res,
455 };
456
457 platform_device_register(&rtc_dev);
458}
459
438static void __init tx4939_stop_unused_modules(void) 460static void __init tx4939_stop_unused_modules(void)
439{ 461{
440 __u64 pcfg, rst = 0, ckd = 0; 462 __u64 pcfg, rst = 0, ckd = 0;
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 98fbd9391bf8..656603b85b71 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -336,6 +336,7 @@ static void __init rbtx4939_device_init(void)
336 rbtx4939_led_setup(); 336 rbtx4939_led_setup();
337 tx4939_wdt_init(); 337 tx4939_wdt_init();
338 tx4939_ata_init(); 338 tx4939_ata_init();
339 tx4939_rtc_init();
339} 340}
340 341
341static void __init rbtx4939_setup(void) 342static void __init rbtx4939_setup(void)