summaryrefslogtreecommitdiffstats
path: root/cpu/at32ap/interrupts.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2007-04-23 15:58:17 -0500
committerKim Phillips <kim.phillips@freescale.com>2007-04-23 15:58:17 -0500
commit396955fed24c301701c83558fc6f7eadd909397b (patch)
treee022bf6f768718ce06a29280f3dfa3a0a60f90f3 /cpu/at32ap/interrupts.c
parent6fbf261f8df294e589cfadebebe5468e3c0f29e9 (diff)
parent14da5f7675bbb427c469e3f45006e027b6e21db9 (diff)
downloadu-boot-396955fed24c301701c83558fc6f7eadd909397b.tar.gz
u-boot-396955fed24c301701c83558fc6f7eadd909397b.tar.xz
u-boot-396955fed24c301701c83558fc6f7eadd909397b.zip
Merge git://www.denx.de/git/u-boot
Diffstat (limited to 'cpu/at32ap/interrupts.c')
-rw-r--r--cpu/at32ap/interrupts.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/cpu/at32ap/interrupts.c b/cpu/at32ap/interrupts.c
index d720cfa942..c9e04993c7 100644
--- a/cpu/at32ap/interrupts.c
+++ b/cpu/at32ap/interrupts.c
@@ -27,7 +27,7 @@
#include <asm/processor.h>
#include <asm/sysreg.h>
-#include <asm/arch/platform.h>
+#include <asm/arch/memory-map.h>
#define HANDLER_MASK 0x00ffffff
#define INTLEV_SHIFT 30
@@ -44,8 +44,6 @@ volatile unsigned long timer_overflow;
*/
static unsigned long tb_factor;
-static const struct device *intc_dev;
-
unsigned long get_tbclk(void)
{
return gd->cpu_hz;
@@ -117,16 +115,19 @@ void udelay(unsigned long usec)
static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
unsigned int priority)
{
+ extern void _evba(void);
unsigned long intpr;
unsigned long handler_addr = (unsigned long)handler;
+ handler_addr -= (unsigned long)&_evba;
+
if ((handler_addr & HANDLER_MASK) != handler_addr
|| (priority & INTLEV_MASK) != priority)
return -EINVAL;
intpr = (handler_addr & HANDLER_MASK);
intpr |= (priority & INTLEV_MASK) << INTLEV_SHIFT;
- writel(intpr, intc_dev->regs + 4 * nr);
+ writel(intpr, (void *)INTC_BASE + 4 * nr);
return 0;
}
@@ -143,10 +144,7 @@ void timer_init(void)
do_div(tmp, gd->cpu_hz);
tb_factor = (u32)tmp;
- intc_dev = get_device(DEVICE_INTC);
-
- if (!intc_dev
- || set_interrupt_handler(0, &timer_interrupt_handler, 3))
+ if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
return;
/* For all practical purposes, this gives us an overflow interrupt */