aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/include
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/include
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/include')
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h13
-rw-r--r--arch/arm/mach-davinci/include/mach/time.h34
2 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 838ae13595a..90b43be1174 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -25,6 +25,18 @@ extern void setup_usb(unsigned mA, unsigned potpgt_msec);
25/* parameters describe VBUS sourcing for host mode */ 25/* parameters describe VBUS sourcing for host mode */
26extern void setup_usb(unsigned mA, unsigned potpgt_msec); 26extern void setup_usb(unsigned mA, unsigned potpgt_msec);
27 27
28struct davinci_timer_instance {
29 void __iomem *base;
30 u32 bottom_irq;
31 u32 top_irq;
32};
33
34struct davinci_timer_info {
35 struct davinci_timer_instance *timers;
36 unsigned int clockevent_id;
37 unsigned int clocksource_id;
38};
39
28/* SoC specific init support */ 40/* SoC specific init support */
29struct davinci_soc_info { 41struct davinci_soc_info {
30 struct map_desc *io_desc; 42 struct map_desc *io_desc;
@@ -44,6 +56,7 @@ struct davinci_soc_info {
44 int intc_type; 56 int intc_type;
45 u8 *intc_irq_prios; 57 u8 *intc_irq_prios;
46 unsigned long intc_irq_num; 58 unsigned long intc_irq_num;
59 struct davinci_timer_info *timer_info;
47}; 60};
48 61
49extern struct davinci_soc_info davinci_soc_info; 62extern struct davinci_soc_info davinci_soc_info;
diff --git a/arch/arm/mach-davinci/include/mach/time.h b/arch/arm/mach-davinci/include/mach/time.h
new file mode 100644
index 00000000000..1428d77c989
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/time.h
@@ -0,0 +1,34 @@
1/*
2 * Local header file for DaVinci time code.
3 *
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ARCH_ARM_MACH_DAVINCI_TIME_H
12#define __ARCH_ARM_MACH_DAVINCI_TIME_H
13
14#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
15#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
16
17enum {
18 T0_BOT,
19 T0_TOP,
20 T1_BOT,
21 T1_TOP,
22 NUM_TIMERS
23};
24
25#define IS_TIMER1(id) (id & 0x2)
26#define IS_TIMER0(id) (!IS_TIMER1(id))
27#define IS_TIMER_TOP(id) ((id & 0x1))
28#define IS_TIMER_BOT(id) (!IS_TIMER_TOP(id))
29
30#define ID_TO_TIMER(id) (IS_TIMER1(id) != 0)
31
32extern struct davinci_timer_instance davinci_timer_instance[];
33
34#endif /* __ARCH_ARM_MACH_DAVINCI_TIME_H */