ARM: rpc: make default fiq handler run-time installed
authorRob Herring <rob.herring@calxeda.com>
Thu, 9 Feb 2012 00:24:23 +0000 (18:24 -0600)
committerRob Herring <rob.herring@calxeda.com>
Tue, 21 Feb 2012 23:04:33 +0000 (17:04 -0600)
Only rpc uses disable_fiq macro. Change it to a run-time installed
default FIQ handler. The handler is installed before FIQ is enabled
so the behavior should be unchanged.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
arch/arm/mach-rpc/Makefile
arch/arm/mach-rpc/fiq.S [new file with mode: 0644]
arch/arm/mach-rpc/irq.c

index aa77bc9efbbbe0e9ee71cea36b6e3730c99b9d89..dfa405c0cfde10b356579c8fec842d76c98a301d 100644 (file)
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y                  := dma.o irq.o riscpc.o
+obj-y                  := dma.o fiq.o irq.o riscpc.o
 obj-m                  :=
 obj-n                  :=
 obj-                   :=
diff --git a/arch/arm/mach-rpc/fiq.S b/arch/arm/mach-rpc/fiq.S
new file mode 100644 (file)
index 0000000..48ddd57
--- /dev/null
@@ -0,0 +1,16 @@
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+#include <mach/hardware.h>
+#include <mach/entry-macro.S>
+
+       .text
+
+       .global rpc_default_fiq_end
+ENTRY(rpc_default_fiq_start)
+       mov     r12, #ioc_base_high
+       .if     ioc_base_low
+       orr     r12, r12, #ioc_base_low
+       .endif
+       strb    r12, [r12, #0x38]       @ Disable FIQ register
+       subs    pc, lr, #4
+rpc_default_fiq_end:
index 2e1b5309fbab54a32d7df58f2193244a17b7cee8..cf0e669eaf1a2be156abf3bf448a0759ddfc4bcc 100644 (file)
@@ -5,6 +5,7 @@
 #include <asm/mach/irq.h>
 #include <asm/hardware/iomd.h>
 #include <asm/irq.h>
+#include <asm/fiq.h>
 
 static void iomd_ack_irq_a(struct irq_data *d)
 {
@@ -112,6 +113,8 @@ static struct irq_chip iomd_fiq_chip = {
        .irq_unmask     = iomd_unmask_irq_fiq,
 };
 
+extern unsigned char rpc_default_fiq_start, rpc_default_fiq_end;
+
 void __init rpc_init_irq(void)
 {
        unsigned int irq, flags;
@@ -121,6 +124,9 @@ void __init rpc_init_irq(void)
        iomd_writeb(0, IOMD_FIQMASK);
        iomd_writeb(0, IOMD_DMAMASK);
 
+       set_fiq_handler(&rpc_default_fiq_start,
+               &rpc_default_fiq_end - &rpc_default_fiq_start);
+
        for (irq = 0; irq < NR_IRQS; irq++) {
                flags = IRQF_VALID;