summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-05-09 13:21:18 +0200
committerWolfgang Denk <wd@denx.de>2009-06-12 20:39:52 +0200
commitc358d9c3f16571e8f825e81b75eaf32e228cb669 (patch)
tree6d71594207568353965053aff1e009eefed80cdb
parent10a451cd57cffbca875c97bbd8929059c5627ec6 (diff)
arm: unify interrupt init
all arm init the IRQ stack the same way so unify it in lib_arm/interrupts.c and then call arch specific interrupt init Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-rw-r--r--cpu/arm1136/cpu.c11
-rw-r--r--cpu/arm720t/cpu.c7
-rw-r--r--cpu/arm720t/interrupts.c2
-rw-r--r--cpu/arm920t/cpu.c11
-rw-r--r--cpu/arm925t/cpu.c11
-rw-r--r--cpu/arm926ejs/cpu.c11
-rw-r--r--cpu/arm946es/cpu.c11
-rw-r--r--cpu/arm_cortexa8/cpu.c12
-rw-r--r--cpu/arm_intcm/cpu.c11
-rw-r--r--cpu/ixp/cpu.c12
-rw-r--r--cpu/ixp/interrupts.c2
-rw-r--r--cpu/lh7a40x/cpu.c11
-rw-r--r--cpu/pxa/cpu.c11
-rw-r--r--cpu/sa1100/cpu.c7
-rw-r--r--include/asm-arm/u-boot-arm.h1
-rw-r--r--lib_arm/interrupts.c13
16 files changed, 16 insertions, 128 deletions
diff --git a/cpu/arm1136/cpu.c b/cpu/arm1136/cpu.c
index 7381da092c6..6104f9e38f4 100644
--- a/cpu/arm1136/cpu.c
+++ b/cpu/arm1136/cpu.c
@@ -35,21 +35,10 @@
#include <command.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm720t/cpu.c b/cpu/arm720t/cpu.c
index 6c40903b7db..7a2b9c37bc5 100644
--- a/cpu/arm720t/cpu.c
+++ b/cpu/arm720t/cpu.c
@@ -42,13 +42,6 @@ static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm720t/interrupts.c b/cpu/arm720t/interrupts.c
index ff21314d8e2..91d552cd28a 100644
--- a/cpu/arm720t/interrupts.c
+++ b/cpu/arm720t/interrupts.c
@@ -111,7 +111,7 @@ static ulong timestamp;
static ulong lastdec;
#if defined(CONFIG_USE_IRQ) && defined(CONFIG_S3C4510B)
-int interrupt_init (void)
+int arch_interrupt_init (void)
{
int i;
diff --git a/cpu/arm920t/cpu.c b/cpu/arm920t/cpu.c
index b6ef6bb8f5d..e4a8adb2d71 100644
--- a/cpu/arm920t/cpu.c
+++ b/cpu/arm920t/cpu.c
@@ -33,21 +33,10 @@
#include <command.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm925t/cpu.c b/cpu/arm925t/cpu.c
index 62828b174e2..e48f34151e4 100644
--- a/cpu/arm925t/cpu.c
+++ b/cpu/arm925t/cpu.c
@@ -34,21 +34,10 @@
#include <arm925t.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm926ejs/cpu.c b/cpu/arm926ejs/cpu.c
index 1f70a3603a8..0a3267385cf 100644
--- a/cpu/arm926ejs/cpu.c
+++ b/cpu/arm926ejs/cpu.c
@@ -33,21 +33,10 @@
#include <command.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm946es/cpu.c b/cpu/arm946es/cpu.c
index d3195f9a22f..e0f91d36c68 100644
--- a/cpu/arm946es/cpu.c
+++ b/cpu/arm946es/cpu.c
@@ -33,21 +33,10 @@
#include <command.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm_cortexa8/cpu.c b/cpu/arm_cortexa8/cpu.c
index ca6bf4f2342..b91cc4f3b3e 100644
--- a/cpu/arm_cortexa8/cpu.c
+++ b/cpu/arm_cortexa8/cpu.c
@@ -36,10 +36,6 @@
#include <asm/arch/sys_proto.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
#ifndef CONFIG_L2_OFF
void l2cache_disable(void);
#endif
@@ -48,14 +44,6 @@ static void cache_flush(void);
int cpu_init(void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START =
- _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/arm_intcm/cpu.c b/cpu/arm_intcm/cpu.c
index b137f766492..488bd0c5a2d 100644
--- a/cpu/arm_intcm/cpu.c
+++ b/cpu/arm_intcm/cpu.c
@@ -33,19 +33,8 @@
#include <common.h>
#include <command.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/ixp/cpu.c b/cpu/ixp/cpu.c
index 42c62f6e397..5cfc39dafad 100644
--- a/cpu/ixp/cpu.c
+++ b/cpu/ixp/cpu.c
@@ -38,10 +38,6 @@
ulong loops_per_jiffy;
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
#if defined(CONFIG_DISPLAY_CPUINFO)
@@ -81,14 +77,6 @@ int print_cpuinfo (void)
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
-
return 0;
}
diff --git a/cpu/ixp/interrupts.c b/cpu/ixp/interrupts.c
index a05e439fdb5..06a826af63e 100644
--- a/cpu/ixp/interrupts.c
+++ b/cpu/ixp/interrupts.c
@@ -67,7 +67,7 @@ void irq_install_handler (int irq, interrupt_handler_t handle_irq, void *data)
IRQ_HANDLER[irq].m_func = handle_irq;
}
-int interrupt_init (void)
+int arch_interrupt_init (void)
{
int i;
diff --git a/cpu/lh7a40x/cpu.c b/cpu/lh7a40x/cpu.c
index be92f708b90..3cf0824c458 100644
--- a/cpu/lh7a40x/cpu.c
+++ b/cpu/lh7a40x/cpu.c
@@ -33,21 +33,10 @@
#include <command.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/pxa/cpu.c b/cpu/pxa/cpu.c
index 3a1be57f44a..8edb44eb45d 100644
--- a/cpu/pxa/cpu.c
+++ b/cpu/pxa/cpu.c
@@ -35,21 +35,10 @@
#include <asm/arch/pxa-regs.h>
#include <asm/system.h>
-#ifdef CONFIG_USE_IRQ
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/cpu/sa1100/cpu.c b/cpu/sa1100/cpu.c
index ed1a6f7cd30..39285a0ccaa 100644
--- a/cpu/sa1100/cpu.c
+++ b/cpu/sa1100/cpu.c
@@ -42,13 +42,6 @@ static void cache_flush(void);
int cpu_init (void)
{
- /*
- * setup up stacks if necessary
- */
-#ifdef CONFIG_USE_IRQ
- IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
- FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
-#endif
return 0;
}
diff --git a/include/asm-arm/u-boot-arm.h b/include/asm-arm/u-boot-arm.h
index 238d4085419..76f1ffa5a2c 100644
--- a/include/asm-arm/u-boot-arm.h
+++ b/include/asm-arm/u-boot-arm.h
@@ -58,6 +58,7 @@ void setup_revision_tag (struct tag **params);
int setenv (char *, char *);
/* cpu/.../interrupt.c */
+int arch_interrupt_init (void);
void reset_timer_masked (void);
ulong get_timer_masked (void);
void udelay_masked (unsigned long usec);
diff --git a/lib_arm/interrupts.c b/lib_arm/interrupts.c
index 8bb950b12bc..1f2b815611c 100644
--- a/lib_arm/interrupts.c
+++ b/lib_arm/interrupts.c
@@ -39,6 +39,19 @@
#include <asm/proc-armv/ptrace.h>
#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+
+int interrupt_init (void)
+{
+ /*
+ * setup up stacks if necessary
+ */
+ IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
+ FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
+
+ return arch_interrupt_init();
+}
+
/* enable IRQ interrupts */
void enable_interrupts (void)
{