Commit 65655b5a authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Ralf Baechle

MIPS: TXx9: Add support for TX4939 internal RTC

Add platform support to use rtc-tx4939 driver.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 42fe7ee3
...@@ -541,5 +541,6 @@ void tx4939_irq_init(void); ...@@ -541,5 +541,6 @@ void tx4939_irq_init(void);
int tx4939_irq(void); int tx4939_irq(void);
void tx4939_mtd_init(int ch); void tx4939_mtd_init(int ch);
void tx4939_ata_init(void); void tx4939_ata_init(void);
void tx4939_rtc_init(void);
#endif /* __ASM_TXX9_TX4939_H */ #endif /* __ASM_TXX9_TX4939_H */
...@@ -435,6 +435,28 @@ void __init tx4939_ata_init(void) ...@@ -435,6 +435,28 @@ void __init tx4939_ata_init(void)
platform_device_register(&ata1_dev); platform_device_register(&ata1_dev);
} }
void __init tx4939_rtc_init(void)
{
static struct resource res[] = {
{
.start = TX4939_RTC_REG & 0xfffffffffULL,
.end = (TX4939_RTC_REG & 0xfffffffffULL) + 0x100 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = TXX9_IRQ_BASE + TX4939_IR_RTC,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device rtc_dev = {
.name = "tx4939rtc",
.id = -1,
.num_resources = ARRAY_SIZE(res),
.resource = res,
};
platform_device_register(&rtc_dev);
}
static void __init tx4939_stop_unused_modules(void) static void __init tx4939_stop_unused_modules(void)
{ {
__u64 pcfg, rst = 0, ckd = 0; __u64 pcfg, rst = 0, ckd = 0;
......
...@@ -336,6 +336,7 @@ static void __init rbtx4939_device_init(void) ...@@ -336,6 +336,7 @@ static void __init rbtx4939_device_init(void)
rbtx4939_led_setup(); rbtx4939_led_setup();
tx4939_wdt_init(); tx4939_wdt_init();
tx4939_ata_init(); tx4939_ata_init();
tx4939_rtc_init();
} }
static void __init rbtx4939_setup(void) static void __init rbtx4939_setup(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment