summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2004-02-06 17:36:13 +0000
committerRussell King <rmk@flint.arm.linux.org.uk>2004-02-06 17:36:13 +0000
commit29052ebaf250cb8809f5f1ac8343b65cd97d4364 (patch)
tree6acce8d571121f908850d8898a533f29d0560e47 /include
parentbe12ab23d4bc4be7c092bb44d966cb152e60f08a (diff)
[ARM] Add Integrator/CP platform support.
This cset adds platform support for the ARM Integrator/CP platform.
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-integrator/irqs.h25
-rw-r--r--include/asm-arm/arch-integrator/time.h38
2 files changed, 51 insertions, 12 deletions
diff --git a/include/asm-arm/arch-integrator/irqs.h b/include/asm-arm/arch-integrator/irqs.h
index a36789ad20f8..ba7b3afee445 100644
--- a/include/asm-arm/arch-integrator/irqs.h
+++ b/include/asm-arm/arch-integrator/irqs.h
@@ -45,6 +45,13 @@
#define IRQ_AP_CPINT1 19
#define IRQ_AP_LBUSTIMEOUT 20
#define IRQ_AP_APCINT 21
+#define IRQ_CP_CLCDCINT 22
+#define IRQ_CP_MMCIINT0 23
+#define IRQ_CP_MMCIINT1 24
+#define IRQ_CP_AACIINT 25
+#define IRQ_CP_CPPLDINT 26
+#define IRQ_CP_ETHINT 27
+#define IRQ_CP_TSPENINT 28
#define IRQ_PIC_END 31
#define IRQ_CIC_START 32
@@ -53,5 +60,23 @@
#define IRQ_CM_COMMTX 34
#define IRQ_CIC_END 34
+/*
+ * IntegratorCP only
+ */
+#define IRQ_SIC_START 35
+#define IRQ_SIC_CP_SOFTINT 35
+#define IRQ_SIC_CP_RI0 36
+#define IRQ_SIC_CP_RI1 37
+#define IRQ_SIC_CP_CARDIN 38
+#define IRQ_SIC_CP_LMINT0 39
+#define IRQ_SIC_CP_LMINT1 40
+#define IRQ_SIC_CP_LMINT2 41
+#define IRQ_SIC_CP_LMINT3 42
+#define IRQ_SIC_CP_LMINT4 43
+#define IRQ_SIC_CP_LMINT5 44
+#define IRQ_SIC_CP_LMINT6 45
+#define IRQ_SIC_CP_LMINT7 46
+#define IRQ_SIC_END 46
+
#define NR_IRQS 47
diff --git a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h
index e361e947f151..2ecbfa7f1259 100644
--- a/include/asm-arm/arch-integrator/time.h
+++ b/include/asm-arm/arch-integrator/time.h
@@ -17,6 +17,7 @@
*/
#include <asm/system.h>
#include <asm/leds.h>
+#include <asm/mach-types.h>
/*
* Where is the timer (VA)?
@@ -31,19 +32,15 @@
*/
#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
#if TIMER_INTERVAL >= 0x100000
-#define TIMER_RELOAD (TIMER_INTERVAL >> 8) /* Divide by 256 */
-#define TIMER_CTRL 0x88 /* Enable, Clock / 256 */
#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
#elif TIMER_INTERVAL >= 0x10000
-#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
-#define TIMER_CTRL 0x84 /* Enable, Clock / 16 */
#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
#else
-#define TIMER_RELOAD (TIMER_INTERVAL)
-#define TIMER_CTRL 0x80 /* Enable */
#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
#endif
+#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */
+
/*
* What does it look like?
*/
@@ -56,6 +53,8 @@ typedef struct TimerStruct {
extern unsigned long (*gettimeoffset)(void);
+static unsigned long timer_reload;
+
/*
* Returns number of ms since last clock interrupt. Note that interrupts
* will have been disabled by do_gettimeoffset()
@@ -81,13 +80,13 @@ static unsigned long integrator_gettimeoffset(void)
/*
* Number of ticks since last interrupt.
*/
- ticks1 = TIMER_RELOAD - ticks2;
+ ticks1 = timer_reload - ticks2;
/*
* Interrupt pending? If so, we've reloaded once already.
*/
if (status & (1 << IRQ_TIMERINT1))
- ticks1 += TIMER_RELOAD;
+ ticks1 += timer_reload;
/*
* Convert the ticks to usecs
@@ -121,8 +120,21 @@ void __init time_init(void)
volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
-
- timer_irq.handler = integrator_timer_interrupt;
+ unsigned int timer_ctrl = 0x80 | 0x40; /* periodic */
+
+ if (machine_is_integrator()) {
+ timer_reload = 1000000 * TICKS_PER_uSEC / HZ;
+ } else if (machine_is_cintegrator()) {
+ timer_reload = 1000000 / HZ;
+ timer_ctrl |= TIMER_CTRL_IE;
+ }
+ if (timer_reload > 0x100000) {
+ timer_reload >>= 8;
+ timer_ctrl |= 0x08; /* /256 */
+ } else if (timer_reload > 0x010000) {
+ timer_reload >>= 4;
+ timer_ctrl |= 0x04; /* /16 */
+ }
/*
* Initialise to a known state (all timers off)
@@ -131,12 +143,14 @@ void __init time_init(void)
timer1->TimerControl = 0;
timer2->TimerControl = 0;
- timer1->TimerLoad = TIMER_RELOAD;
- timer1->TimerControl = TIMER_CTRL | 0x40; /* periodic */
+ timer1->TimerLoad = timer_reload;
+ timer1->TimerValue = timer_reload;
+ timer1->TimerControl = timer_ctrl;
/*
* Make irqs happen for the system timer
*/
+ timer_irq.handler = integrator_timer_interrupt;
setup_irq(IRQ_TIMERINT1, &timer_irq);
gettimeoffset = integrator_gettimeoffset;
}