ARM: footbridge: convert to sparse IRQs
Subsystems (7)
PATCH 1/1 ARM: footbridge: convert to sparse IRQs
To improve future maintainability, change the interrupt handling for mach-footbridge to use sparse IRQs.
Since the number of possible interrupts is already fixed and relatively small, just make it use all legacy interrupts preallocated using the .nr_irqs field in the machine descriptor, rather than actually allocating domains on the fly.
Many files had to be adjusted to include <mach/irqs.h> explicitly because it is no longer implicitly included with sparse IRQs.
Description adapted from commit c78a41fc04f0 ("ARM: s3c24xx: convert to sparse-irq").
---
This commit depends on my previous submission "ARM: <asm/floppy.h>: fix build with sparse IRQs".
arch/arm/Kconfig | 2 +- arch/arm/include/asm/irq.h | 4 +++- arch/arm/mach-footbridge/dc21285-timer.c | 2 +- arch/arm/mach-footbridge/dc21285.c | 2 +- arch/arm/mach-footbridge/ebsa285-pci.c | 2 +- arch/arm/mach-footbridge/ebsa285.c | 2 ++ arch/arm/mach-footbridge/include/mach/irqs.h | 4 +--- arch/arm/mach-footbridge/isa-irq.c | 2 +- arch/arm/mach-footbridge/isa-timer.c | 2 +- arch/arm/mach-footbridge/isa.c | 2 +- arch/arm/mach-footbridge/netwinder-hw.c | 2 ++ arch/arm/mach-footbridge/netwinder-pci.c | 2 +- drivers/char/nwbutton.c | 2 +- drivers/input/serio/i8042-io.h | 6 +++--- drivers/tty/serial/21285.c | 2 +- 15 files changed, 21 insertions(+), 17 deletions(-)
arch/arm/Kconfig +1 -1
@@ -153,7 +153,7 @@ config ARM select PCI_SYSCALL if PCI select PERF_USE_VMALLOC select RTC_LIB - select SPARSE_IRQ if !ARCH_FOOTBRIDGE + select SPARSE_IRQ select SYS_SUPPORTS_APM_EMULATION select THREAD_INFO_IN_TASK select TIMER_OF if OF
arch/arm/include/asm/irq.h +3 -1
@@ -10,7 +10,9 @@#define NR_IRQS NR_IRQS_LEGACY#endif -#ifndef irq_canonicalize +#ifdef CONFIG_ARCH_FOOTBRIDGE +#define irq_canonicalize (i) (((i) == 2) ? 9 : i) +#else #define irq_canonicalize (i) (i)#endif
arch/arm/mach-footbridge/dc21285-timer.c +1 -1
@@ -12,7 +12,7 @@#include <linux/irq.h> #include <linux/sched_clock.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/hardware/dec21285.h> #include <asm/mach/time.h>
arch/arm/mach-footbridge/dc21285.c +1 -1
@@ -17,7 +17,7 @@#include <linux/io.h> #include <linux/spinlock.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/mach/pci.h> #include <asm/hardware/dec21285.h>
arch/arm/mach-footbridge/ebsa285-pci.c +1 -1
@@ -10,7 +10,7 @@#include <linux/pci.h> #include <linux/init.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/mach/pci.h> #include <asm/mach-types.h>
arch/arm/mach-footbridge/ebsa285.c +2 -0
@@ -10,6 +10,7 @@#include <linux/slab.h> #include <linux/leds.h> +#include <mach/irqs.h> #include <asm/hardware/dec21285.h> #include <asm/mach-types.h>
@@ -117,6 +118,7 @@ MACHINE_START(EBSA285, "EBSA285") .video_end = 0x000bffff, .map_io = footbridge_map_io, .init_early = footbridge_sched_clock, + .nr_irqs = FOOTBRIDGE_NR_IRQS, .init_irq = footbridge_init_irq, .init_time = footbridge_timer_init, .restart = footbridge_restart,
arch/arm/mach-footbridge/include/mach/irqs.h +1 -3
@@ -11,7 +11,7 @@*/ #include <asm/mach-types.h> -#define NR_IRQS 36 +#define FOOTBRIDGE_NR_IRQS 36#define NR_DC21285_IRQS 16#define _ISA_IRQ (x) (0 + (x))
@@ -93,5 +93,3 @@#define I8042_KBD_IRQ IRQ_ISA_KEYBOARD#define I8042_AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)#define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY - -#define irq_canonicalize (_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
arch/arm/mach-footbridge/isa-irq.c +1 -1
@@ -21,8 +21,8 @@#include <asm/mach/irq.h> #include <mach/hardware.h> +#include <mach/irqs.h> #include <asm/hardware/dec21285.h> -#include <asm/irq.h> #include <asm/mach-types.h> #include "common.h"
arch/arm/mach-footbridge/isa-timer.c +1 -1
@@ -13,7 +13,7 @@#include <linux/spinlock.h> #include <linux/timex.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/mach/time.h> #include "common.h"
arch/arm/mach-footbridge/isa.c +1 -1
@@ -7,7 +7,7 @@#include <linux/init.h> #include <linux/serial_8250.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/hardware/dec21285.h> #include "common.h"
arch/arm/mach-footbridge/netwinder-hw.c +2 -0
@@ -16,6 +16,7 @@#include <linux/slab.h> #include <linux/leds.h> +#include <mach/irqs.h> #include <asm/hardware/dec21285.h> #include <asm/mach-types.h> #include <asm/setup.h>
@@ -766,6 +767,7 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder") .reserve_lp2 = 1, .fixup = fixup_netwinder, .map_io = footbridge_map_io, + .nr_irqs = FOOTBRIDGE_NR_IRQS, .init_irq = footbridge_init_irq, .init_time = isa_timer_init, .restart = netwinder_restart,
arch/arm/mach-footbridge/netwinder-pci.c +1 -1
@@ -10,7 +10,7 @@#include <linux/pci.h> #include <linux/init.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/mach/pci.h> #include <asm/mach-types.h>
drivers/char/nwbutton.c +1 -1
@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/uaccess.h> -#include <asm/irq.h> +#include <mach/irqs.h> #include <asm/mach-types.h> #define __NWBUTTON_C/* Tell the header file who we are */
drivers/input/serio/i8042-io.h +3 -3
@@ -15,9 +15,9 @@* IRQs. */ -#if defined(__arm__) -/* defined in include/asm-arm/arch-xxx/irqs.h */ -#include <asm/irq.h> +#ifdef CONFIG_ARCH_FOOTBRIDGE +/* defined in arch/arm/mach-footbridge/include/mach/irqs.h */ +#include <mach/irqs.h> #elif defined(CONFIG_PPC )extern int of_i8042_kbd_irq;extern int of_i8042_aux_irq;
drivers/tty/serial/21285.c +1 -1
@@ -15,11 +15,11 @@#include <linux/serial.h> #include <linux/io.h> -#include <asm/irq.h> #include <asm/mach-types.h> #include <asm/system_info.h> #include <asm/hardware/dec21285.h> #include <mach/hardware.h> +#include <mach/irqs.h> #define BAUD_BASE (mem_fclk_21285/64)
Signature · 1 line
2.43.0
Quoted 8 lines · Ethan Nelson-Moore
To improve future maintainability, change the interrupt handling for mach-footbridge to use sparse IRQs.
Since the number of possible interrupts is already fixed and relatively small, just make it use all legacy interrupts preallocated using the .nr_irqs field in the machine descriptor, rather than actually allocating domains on the fly.
Quoted 8 lines
Many files had to be adjusted to include <
mach/irqs.h> explicitly because it is no longer implicitly included with sparse IRQs.Description adapted from commit
c78a41fc04f0("ARM: s3c24xx: convert to sparse-irq").Signed-off-by Ethan Nelson-Moore <[email protected]>
Have you tested this on real hardware?
The commit doesn't really say.
I might have to dig out my NetWinder to test this.
Yours,
Linus Walleij
Hi, Linus,
Quoted 2 lines · Linus Walleij
Have you tested this on real hardware?
The commit doesn't really say.
No, I haven't. I can try to test it in GXemul, but I'm not sure if it can boot Linux. The developer only lists it as capable of booting NetBSD.
Ethan
Dmitry Torokhov
maintainerHi Ethan,
Quoted 7 lines · Ethan Nelson-Moore
drivers/input/serio/i8042-io.h +0
-0@@ -15,9 +15,9 @@* IRQs. */
drivers/input/serio/i8042-io.h line 23
Quoted 10 lines
drivers/input/serio/i8042-io.h +3
-3-#if defined(__arm__) -/* defined in include/asm-arm/arch-xxx/irqs.h */ -#include <asm/irq.h> +#ifdef CONFIG_ARCH_FOOTBRIDGE +/* defined in arch/arm/mach-footbridge/include/mach/irqs.h */ +#include <mach/irqs.h> #elif defined(CONFIG_PPC )extern int of_i8042_kbd_irq;extern int of_i8042_aux_irq;
This does not look right. Did you mean to drop inclusion of asm/irq.h for all other arms?
Thanks.
Signature · 1 line
Dmitry
Arnd Bergmann
maintainerQuoted 4 lines · Dmitry Torokhov
Quoted 3 lines · Ethan Nelson-Moore
drivers/input/serio/i8042-io.h +0
-0
Quoted 12 lines
drivers/input/serio/i8042-io.h line 23
Quoted 9 lines
drivers/input/serio/i8042-io.h +3
-3-#if defined(__arm__) -/* defined in include/asm-arm/arch-xxx/irqs.h */ -#include <asm/irq.h> +#ifdef CONFIG_ARCH_FOOTBRIDGE +/* defined in arch/arm/mach-footbridge/include/mach/irqs.h */ +#include <mach/irqs.h> #elif defined(CONFIG_PPC )extern int of_i8042_kbd_irq;extern int of_i8042_aux_irq;This does not look right. Did you mean to drop inclusion of
asm/irq.hfor all other arms?
I think this is correct, as footbridge is the only one that selects CONFIG_ARCH_MIGHT_HAVE_PC_SERIO and defines I8042_KBD_IRQ on arm.
Arnd
Hi, Arnd,
Quoted 2 lines · Arnd Bergmann
I think this is correct, as footbridge is the only one that selects
CONFIG_ARCH_MIGHT_HAVE_PC_SERIOand definesI8042_KBD_IRQon arm.
I came to the same conclusion.
Ethan
Quoted 7 lines · Ethan Nelson-Moore
Hi, Arnd,
Quoted 2 lines · Arnd Bergmann
I think this is correct, as footbridge is the only one that selects
CONFIG_ARCH_MIGHT_HAVE_PC_SERIOand definesI8042_KBD_IRQon arm.I came to the same conclusion.
I see. In this case:
Thanks.
Signature · 1 line
Dmitry