ARM: fiq: change FIQ_START to a variable
authorShawn Guo <shawn.guo@linaro.org>
Thu, 28 Jun 2012 06:42:08 +0000 (14:42 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Sun, 1 Jul 2012 13:59:19 +0000 (21:59 +0800)
The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
a nubmer of platforms have FIQ_START defined in mach/irqs.h for FIQ
support.

  arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
  arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
  arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0

If SPARSE_IRQ is enabled for any of these platforms, the following
compile error will be seen.

  arch/arm/kernel/fiq.c: In function ‘enable_fiq’:
  arch/arm/kernel/fiq.c:127:19: error: ‘FIQ_START’ undeclared (first use in this function)
  arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
  arch/arm/kernel/fiq.c: In function ‘disable_fiq’:
  arch/arm/kernel/fiq.c:132:20: error: ‘FIQ_START’ undeclared (first use in this function)

The patch changes fiq code to have init_FIQ take FIQ_START from
platforms as a parameter and assign it to variable fiq_start which
is to replace FIQ_START uses in enable_fiq/disable_fiq.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/mach/irq.h
arch/arm/kernel/fiq.c
arch/arm/mach-rpc/irq.c
arch/arm/plat-mxc/avic.c
arch/arm/plat-mxc/tzic.c
arch/arm/plat-s3c24xx/irq.c

index febe495d0c6e15777b9e393a50cc08d7fbdd917c..15cb035309f754ca4c5b3e4c4fa718e6a27252ac 100644 (file)
@@ -17,7 +17,7 @@ struct seq_file;
 /*
  * This is internal.  Do not use it.
  */
-extern void init_FIQ(void);
+extern void init_FIQ(int);
 extern int show_fiq_list(struct seq_file *, int);
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
index c32f8456aa094115b8c28a92df83fc643a15188c..2adda11f712fe02fa2fdaa63e944e17199bd3748 100644 (file)
@@ -122,14 +122,16 @@ void release_fiq(struct fiq_handler *f)
        while (current_fiq->fiq_op(current_fiq->dev_id, 0));
 }
 
+static int fiq_start;
+
 void enable_fiq(int fiq)
 {
-       enable_irq(fiq + FIQ_START);
+       enable_irq(fiq + fiq_start);
 }
 
 void disable_fiq(int fiq)
 {
-       disable_irq(fiq + FIQ_START);
+       disable_irq(fiq + fiq_start);
 }
 
 EXPORT_SYMBOL(set_fiq_handler);
@@ -140,7 +142,8 @@ EXPORT_SYMBOL(release_fiq);
 EXPORT_SYMBOL(enable_fiq);
 EXPORT_SYMBOL(disable_fiq);
 
-void __init init_FIQ(void)
+void __init init_FIQ(int start)
 {
        no_fiq_insn = *(unsigned long *)0xffff001c;
+       fiq_start = start;
 }
index cf0e669eaf1a2be156abf3bf448a0759ddfc4bcc..3e4fa849c64dbc7de6c3a441124396c77c39f58d 100644 (file)
@@ -163,6 +163,6 @@ void __init rpc_init_irq(void)
                }
        }
 
-       init_FIQ();
+       init_FIQ(FIQ_START);
 }
 
index e612cc1edede63bd5f37d8f805f1783fd02c33e7..f3d671ff7f1be5008b86e19ae0ae082609c6d412 100644 (file)
@@ -217,7 +217,7 @@ void __init mxc_init_irq(void __iomem *irqbase)
 
 #ifdef CONFIG_FIQ
        /* Initialize FIQ */
-       init_FIQ();
+       init_FIQ(FIQ_START);
 #endif
 
        printk(KERN_INFO "MXC IRQ initialized\n");
index abc90e4116f5ef02115c6415b139197f2f662e21..c60a7e4163850e0e029152a88f87eed25489b860 100644 (file)
@@ -192,7 +192,7 @@ void __init tzic_init_irq(void __iomem *irqbase)
 
 #ifdef CONFIG_FIQ
        /* Initialize FIQ */
-       init_FIQ();
+       init_FIQ(FIQ_START);
 #endif
 
        pr_info("TrustZone Interrupt Controller (TZIC) initialized\n");
index bc42c04091fdfc90c7c346279a61e284830afd35..fe57bbbf166bae61ccb21203e185b6e7e64c827c 100644 (file)
@@ -533,7 +533,7 @@ void __init s3c24xx_init_irq(void)
        int i;
 
 #ifdef CONFIG_FIQ
-       init_FIQ();
+       init_FIQ(FIQ_START);
 #endif
 
        irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");