aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-09-15 21:15:54 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-25 13:21:23 -0500
commitc51df70b1e14220c8fc0799f6c27b9362d9424d0 (patch)
tree3de90c9e947add1c34a986b78a2cd269976b51a9
parent13e1f0440e7892fa7041fc855d8eeffc5d6aa21a (diff)
davinci: Add RTC support for DA8xx/OMAP-L13x SoC's
Add RTC support for the da830/omap-l137 and da850/omap-l138 SoC's by leveraging existing the rtc-omap driver. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c4
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c4
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c35
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h1
4 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index fb941eb1f4da..20100370e2e6 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -228,6 +228,10 @@ static __init void da830_evm_init(void)
228 if (ret) 228 if (ret)
229 pr_warning("da830_evm_init: lcd setup failed: %d\n", ret); 229 pr_warning("da830_evm_init: lcd setup failed: %d\n", ret);
230#endif 230#endif
231
232 ret = da8xx_register_rtc();
233 if (ret)
234 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
231} 235}
232 236
233#ifdef CONFIG_SERIAL_8250_CONSOLE 237#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index da1a6fba28c1..47619a98b562 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -381,6 +381,10 @@ static __init void da850_evm_init(void)
381 if (ret) 381 if (ret)
382 pr_warning("da850_evm_init: lcdc registration failed: %d\n", 382 pr_warning("da850_evm_init: lcdc registration failed: %d\n",
383 ret); 383 ret);
384
385 ret = da8xx_register_rtc();
386 if (ret)
387 pr_warning("da850_evm_init: rtc setup failed: %d\n", ret);
384} 388}
385 389
386#ifdef CONFIG_SERIAL_8250_CONSOLE 390#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 55956135cdf4..dd0ea08bc324 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -29,6 +29,7 @@
29#define DA8XX_TPTC1_BASE 0x01c08400 29#define DA8XX_TPTC1_BASE 0x01c08400
30#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ 30#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */
31#define DA8XX_I2C0_BASE 0x01c22000 31#define DA8XX_I2C0_BASE 0x01c22000
32#define DA8XX_RTC_BASE 0x01C23000
32#define DA8XX_EMAC_CPPI_PORT_BASE 0x01e20000 33#define DA8XX_EMAC_CPPI_PORT_BASE 0x01e20000
33#define DA8XX_EMAC_CPGMACSS_BASE 0x01e22000 34#define DA8XX_EMAC_CPGMACSS_BASE 0x01e22000
34#define DA8XX_EMAC_CPGMAC_BASE 0x01e23000 35#define DA8XX_EMAC_CPGMAC_BASE 0x01e23000
@@ -453,3 +454,37 @@ int __init da8xx_register_mmcsd0(struct davinci_mmc_config *config)
453 da8xx_mmcsd0_device.dev.platform_data = config; 454 da8xx_mmcsd0_device.dev.platform_data = config;
454 return platform_device_register(&da8xx_mmcsd0_device); 455 return platform_device_register(&da8xx_mmcsd0_device);
455} 456}
457
458static struct resource da8xx_rtc_resources[] = {
459 {
460 .start = DA8XX_RTC_BASE,
461 .end = DA8XX_RTC_BASE + SZ_4K - 1,
462 .flags = IORESOURCE_MEM,
463 },
464 { /* timer irq */
465 .start = IRQ_DA8XX_RTC,
466 .end = IRQ_DA8XX_RTC,
467 .flags = IORESOURCE_IRQ,
468 },
469 { /* alarm irq */
470 .start = IRQ_DA8XX_RTC,
471 .end = IRQ_DA8XX_RTC,
472 .flags = IORESOURCE_IRQ,
473 },
474};
475
476static struct platform_device da8xx_rtc_device = {
477 .name = "omap_rtc",
478 .id = -1,
479 .num_resources = ARRAY_SIZE(da8xx_rtc_resources),
480 .resource = da8xx_rtc_resources,
481};
482
483int da8xx_register_rtc(void)
484{
485 /* Unlock the rtc's registers */
486 __raw_writel(0x83e70b13, IO_ADDRESS(DA8XX_RTC_BASE + 0x6c));
487 __raw_writel(0x95a4f1e0, IO_ADDRESS(DA8XX_RTC_BASE + 0x70));
488
489 return platform_device_register(&da8xx_rtc_device);
490}
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 375a3f7af03d..a152261c1951 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -81,6 +81,7 @@ int da8xx_register_emac(void);
81int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); 81int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
82int da8xx_register_mmcsd0(struct davinci_mmc_config *config); 82int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
83void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata); 83void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
84int da8xx_register_rtc(void);
84 85
85extern struct platform_device da8xx_serial_device; 86extern struct platform_device da8xx_serial_device;
86extern struct emac_platform_data da8xx_emac_pdata; 87extern struct emac_platform_data da8xx_emac_pdata;