All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/02][RFC] ARM: Subarch IRQ handler macro support
Date: Fri, 10 Dec 2010 05:58:35 +0000	[thread overview]
Message-ID: <20101210055835.8635.98614.sendpatchset@t400s> (raw)

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!

Signed-off-by: Magnus Damm <damm@opensource.se>
---
 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(-)


WARNING: multiple messages have this Message-ID (diff)
From: magnus.damm@gmail.com (Magnus Damm)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/02][RFC] ARM: Subarch IRQ handler macro support
Date: Fri, 10 Dec 2010 14:58:35 +0900	[thread overview]
Message-ID: <20101210055835.8635.98614.sendpatchset@t400s> (raw)

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!

Signed-off-by: Magnus Damm <damm@opensource.se>
---
 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(-)

             reply	other threads:[~2010-12-10  5:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10  5:58 Magnus Damm [this message]
2010-12-10  5:58 ` [PATCH 00/02][RFC] ARM: Subarch IRQ handler macro support Magnus Damm
2010-12-10  5:58 ` [PATCH 01/02][RFC] ARM: Introduce Subarch IRQ handler macros Magnus Damm
2010-12-10  5:58   ` Magnus Damm
2010-12-10  5:58 ` [PATCH 02/02][RFC] ARM: shmobile: Use Subarch IRQ handler for INTC Magnus Damm
2010-12-10  5:58   ` Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101210055835.8635.98614.sendpatchset@t400s \
    --to=magnus.damm@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.