aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 15:40:11 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 11:19:04 -0400
commitf64691b3ab795268072e76ddb89290b6277cdf33 (patch)
treecc8de5ab3c90674905f6d8e141bcf345a81121f4 /arch/arm/mach-davinci/devices.c
parent673dd36f0d0cf8893d6b46d524ad80e81076b885 (diff)
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 @@
25#include <mach/mux.h> 25#include <mach/mux.h>
26#include <mach/edma.h> 26#include <mach/edma.h>
27#include <mach/mmc.h> 27#include <mach/mmc.h>
28#include <mach/time.h>
28 29
29#define DAVINCI_I2C_BASE 0x01C21000 30#define DAVINCI_I2C_BASE 0x01C21000
30#define DAVINCI_MMCSD0_BASE 0x01E10000 31#define DAVINCI_MMCSD0_BASE 0x01E10000
@@ -235,6 +236,52 @@ static void davinci_init_wdt(void)
235 236
236/*-------------------------------------------------------------------------*/ 237/*-------------------------------------------------------------------------*/
237 238
239struct davinci_timer_instance davinci_timer_instance[2] = {
240 {
241 .base = IO_ADDRESS(DAVINCI_TIMER0_BASE),
242 .bottom_irq = IRQ_TINT0_TINT12,
243 .top_irq = IRQ_TINT0_TINT34,
244 },
245 {
246 .base = IO_ADDRESS(DAVINCI_TIMER1_BASE),
247 .bottom_irq = IRQ_TINT1_TINT12,
248 .top_irq = IRQ_TINT1_TINT34,
249 },
250};
251
252/*-------------------------------------------------------------------------*/
253
254#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
255
256void davinci_init_emac(struct emac_platform_data *pdata)
257{
258 DECLARE_MAC_BUF(buf);
259
260 if (cpu_is_davinci_dm644x())
261 dm644x_init_emac(pdata);
262 else if (cpu_is_davinci_dm646x())
263 dm646x_init_emac(pdata);
264
265 /* if valid MAC exists, don't re-register */
266 if (is_valid_ether_addr(pdata->mac_addr))
267 return;
268 else {
269 /* Use random MAC if none passed */
270 random_ether_addr(pdata->mac_addr);
271
272 printk(KERN_WARNING "%s: using random MAC addr: %s\n",
273 __func__, print_mac(buf, pdata->mac_addr));
274 }
275}
276
277#else
278
279void davinci_init_emac(struct emac_platform_data *unused) {}
280
281#endif
282
283/*-------------------------------------------------------------------------*/
284
238static int __init davinci_init_devices(void) 285static int __init davinci_init_devices(void)
239{ 286{
240 /* please keep these calls, and their implementations above, 287 /* please keep these calls, and their implementations above,