Skip to content

RFC ARM: Subarch IRQ handler macro support

Magnus Damm linux-arm-kernel linux-sh 1 version New

Get series with b4
b4 am 20101210055835.8635.98614.sendpatchset@t400s

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ARM: Introduce Subarch IRQ handler macrosarch/arm/include/asm/entry-macro-multi.S arch/arm/kernel/entry-armv.S+45 -290 replies
2/2ARM: shmobile: Use Subarch IRQ handler for INTCarch/arm/mach-shmobile/Kconfig arch/arm/mach-shmobile/Makefile arch/arm/mach-shmobile/board-ap4evb.c +6 more+46 -330 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchMagnus Damm
1/2
2/2Not-Signed-off-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/02][RFC] ARM: Subarch IRQ handler macro support

ARM: Subarch IRQ handler macro support

[PATCH 01/02][RFC] ARM: Introduce Subarch IRQ handler macros [PATCH 02/02][RFC] ARM: shmobile: Use Subarch IRQ handler for INTC

These patches add a macro for per-subarch use together with some example code that shows how to use it.

The first patch simply breaks out code from the irq_handler macro in entry-armv.S to the new macro arch_irq_handler that is put in a shared header file. The new header file also adds the new macro arch_irq_handler_default which replaces previous code in the entry-armv.S file.

Patch number two gives an example on how to make use of the macro arch_irq_handler on the SH-Mobile ARM subarch. Compile-time tested on top of RMKs devel tree with the CONFIG_MULTI_IRQ_HANDLER patch by Eric Miao. Please note that this patch isn't suitable for merge since it needs to be reworked to fit on the sh-2.6 tree where the rest of the SH-Mobile changes are.

In short, the per-subarch code is reduced to the following on the sh7372 uniprocessor:

+#include <asm/entry-macro-multi.S>
+
+#define INTFLGA 0xe6980018
+

+       .macro  get_irqnr_preamble, base, tmp
+       ldr     \base, =INTFLGA
+       .endm
+
+       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+       ldr     \irqnr, [\base]
+       cmp     \irqnr, #0
+       beq     1000f
+       /* intevt to irq number */
+       lsr     \irqnr, \irqnr, #0x5
+       subs    \irqnr, \irqnr, #16

+1000:
+ .endm
+
+ arch_irq_handler shmobile_handle_irq_intc

This code depends on the following patch by Eric Miao:

[PATCH] ARM: Allow machine to specify it's own IRQ handlers at run-time

Comments are more than welcome!

---
 arch/arm/include/asm/entry-macro-multi.S          |   43 +++++++++++++++++++++
 arch/arm/kernel/entry-armv.S                      |   31 ---------------
 arch/arm/mach-shmobile/Kconfig                    |    3 +
 arch/arm/mach-shmobile/Makefile                   |   12 ++++-
 arch/arm/mach-shmobile/board-ap4evb.c             |    1 
 arch/arm/mach-shmobile/board-g3evm.c              |    1 
 arch/arm/mach-shmobile/board-g4evm.c              |    1 
 arch/arm/mach-shmobile/entry-intc.S               |   30 ++++++++++++++
 arch/arm/mach-shmobile/include/mach/common.h      |    1 
 arch/arm/mach-shmobile/include/mach/entry-macro.S |   27 -------------
 arch/arm/mach-shmobile/include/mach/hardware.h    |    3 -
 11 files changed, 91 insertions(+), 62 deletions(-)