summaryrefslogtreecommitdiff
path: root/cpu/at32ap/interrupts.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2006-11-19 18:06:53 +0100
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-04-14 15:20:27 +0200
commitdf548d3c3e2bbc40258713167859ffc2ce99a900 (patch)
tree63759a73724848ba192874aa552861e03faf1058 /cpu/at32ap/interrupts.c
parent03d1e1365796cd15d1726e8a51fd8b5be50b2fe9 (diff)
downloadu-boot-imx-df548d3c3e2bbc40258713167859ffc2ce99a900.zip
u-boot-imx-df548d3c3e2bbc40258713167859ffc2ce99a900.tar.gz
u-boot-imx-df548d3c3e2bbc40258713167859ffc2ce99a900.tar.bz2
AVR32: Resource management rewrite
Rewrite the resource management code (i.e. I/O memory, clock gating, gpio) so it doesn't depend on any global state. This is necessary because this code is heavily used before relocation to RAM, so we can't write to any global variables. As an added bonus, this makes u-boot's memory footprint a bit smaller, although some functionality has been left out; all clocks are enabled all the time, and there's no checking for gpio line conflicts. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'cpu/at32ap/interrupts.c')
-rw-r--r--cpu/at32ap/interrupts.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/cpu/at32ap/interrupts.c b/cpu/at32ap/interrupts.c
index d720cfa..85420a4 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;
@@ -126,7 +124,7 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
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 +141,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 */