summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 12:40:11 -0700
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 08:19:04 -0700
commitf64691b3ab795268072e76ddb89290b6277cdf33 (patch)
treecc8de5ab3c90674905f6d8e141bcf345a81121f4 /arch/arm/mach-davinci/devices.c
parent673dd36f0d0cf8893d6b46d524ad80e81076b885 (diff)
downloadtalos-op-linux-f64691b3ab795268072e76ddb89290b6277cdf33.tar.gz
talos-op-linux-f64691b3ab795268072e76ddb89290b6277cdf33.zip
davinci: Add base address and timer flexibility
The davinci timer code currently hardcodes the timer register base addresses, the timer irq numbers, and the timers to use for clock events and clocksource. This won't work for some a new SoC so put those values into the soc_info structure and set them up in the SoC-specific files. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices.c')
-rw-r--r--arch/arm/mach-davinci/devices.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 56c19319a7d2..36c528ff30f9 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -25,6 +25,7 @@
#include <mach/mux.h>
#include <mach/edma.h>
#include <mach/mmc.h>
+#include <mach/time.h>
#define DAVINCI_I2C_BASE 0x01C21000
#define DAVINCI_MMCSD0_BASE 0x01E10000
@@ -235,6 +236,52 @@ static void davinci_init_wdt(void)
/*-------------------------------------------------------------------------*/
+struct davinci_timer_instance davinci_timer_instance[2] = {
+ {
+ .base = IO_ADDRESS(DAVINCI_TIMER0_BASE),
+ .bottom_irq = IRQ_TINT0_TINT12,
+ .top_irq = IRQ_TINT0_TINT34,
+ },
+ {
+ .base = IO_ADDRESS(DAVINCI_TIMER1_BASE),
+ .bottom_irq = IRQ_TINT1_TINT12,
+ .top_irq = IRQ_TINT1_TINT34,
+ },
+};
+
+/*-------------------------------------------------------------------------*/
+
+#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
+
+void davinci_init_emac(struct emac_platform_data *pdata)
+{
+ DECLARE_MAC_BUF(buf);
+
+ if (cpu_is_davinci_dm644x())
+ dm644x_init_emac(pdata);
+ else if (cpu_is_davinci_dm646x())
+ dm646x_init_emac(pdata);
+
+ /* if valid MAC exists, don't re-register */
+ if (is_valid_ether_addr(pdata->mac_addr))
+ return;
+ else {
+ /* Use random MAC if none passed */
+ random_ether_addr(pdata->mac_addr);
+
+ printk(KERN_WARNING "%s: using random MAC addr: %s\n",
+ __func__, print_mac(buf, pdata->mac_addr));
+ }
+}
+
+#else
+
+void davinci_init_emac(struct emac_platform_data *unused) {}
+
+#endif
+
+/*-------------------------------------------------------------------------*/
+
static int __init davinci_init_devices(void)
{
/* please keep these calls, and their implementations above,
OpenPOWER on IntegriCloud