public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/08] ARM: Dynamic IRQ demux for SH-Mobile
Date: Wed, 06 Oct 2010 07:18:37 +0000	[thread overview]
Message-ID: <20101006071837.28048.58439.sendpatchset@t400s> (raw)
In-Reply-To: <20101006071731.28048.89938.sendpatchset@t400s>

From: Magnus Damm <damm@opensource.se>

This patch adds Dynamic IRQ demux support to the
SH-Mobile line of processors. The actual demux code
is implemented in entry-irq-common.S and each INTC
implementation is responsible for registering the
shared demux code using setup_irq_stubs().

Future processors will add a new a IRQ demux instance
and register that from the INTC implementation for
that particular processor.

Tested on sh7372 and AP4EVB.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/Kconfig                                  |    1 
 arch/arm/mach-shmobile/Makefile                   |    1 
 arch/arm/mach-shmobile/entry-irq-common.S         |   38 +++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/common.h      |    1 
 arch/arm/mach-shmobile/include/mach/entry-macro.S |   17 ---------
 arch/arm/mach-shmobile/intc-sh7367.c              |    4 ++
 arch/arm/mach-shmobile/intc-sh7372.c              |    4 ++
 arch/arm/mach-shmobile/intc-sh7377.c              |    4 ++
 8 files changed, 53 insertions(+), 17 deletions(-)

--- 0008/arch/arm/Kconfig
+++ work/arch/arm/Kconfig	2010-10-06 14:43:07.000000000 +0900
@@ -1377,6 +1377,7 @@ config SPARSE_IRQ
 	  experimental until they have been independently verified.
 
 config DEFAULT_IRQ_DEMUX
+	default n if ARCH_SHMOBILE
 	def_bool y
 
 source "mm/Kconfig"
--- 0001/arch/arm/mach-shmobile/Makefile
+++ work/arch/arm/mach-shmobile/Makefile	2010-10-06 14:36:27.000000000 +0900
@@ -4,6 +4,7 @@
 
 # Common objects
 obj-y				:= timer.o console.o clock.o pm_runtime.o
+obj-y				+= entry-irq-common.o
 
 # CPU objects
 obj-$(CONFIG_ARCH_SH7367)	+= setup-sh7367.o clock-sh7367.o intc-sh7367.o
--- /dev/null
+++ work/arch/arm/mach-shmobile/entry-irq-common.S	2010-10-06 14:38:29.000000000 +0900
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Magnus Damm
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <asm/entry-header.S>
+
+	.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
+
+	__irq_svc shmobile_common
+	__irq_usr shmobile_common
--- 0001/arch/arm/mach-shmobile/include/mach/common.h
+++ work/arch/arm/mach-shmobile/include/mach/common.h	2010-10-06 14:39:29.000000000 +0900
@@ -5,6 +5,7 @@ extern struct sys_timer shmobile_timer;
 extern void shmobile_setup_console(void);
 struct clk;
 extern int clk_init(void);
+extern char __irq_usr_shmobile_common[], __irq_svc_shmobile_common[];
 
 extern void sh7367_init_irq(void);
 extern void sh7367_add_early_devices(void);
--- 0001/arch/arm/mach-shmobile/include/mach/entry-macro.S
+++ work/arch/arm/mach-shmobile/include/mach/entry-macro.S	2010-10-06 14:38:01.000000000 +0900
@@ -14,26 +14,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include <mach/hardware.h>
-#include <mach/irqs.h>
 
 	.macro  disable_fiq
 	.endm
 
-	.macro  get_irqnr_preamble, base, tmp
-	ldr     \base, =INTFLGA
-	.endm
-
 	.macro  arch_ret_to_user, tmp1, tmp2
 	.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
--- 0001/arch/arm/mach-shmobile/intc-sh7367.c
+++ work/arch/arm/mach-shmobile/intc-sh7367.c	2010-10-06 14:44:20.000000000 +0900
@@ -24,6 +24,8 @@
 #include <linux/sh_intc.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/traps.h>
+#include <mach/common.h>
 
 enum {
 	UNUSED_INTCA = 0,
@@ -431,6 +433,8 @@ void __init sh7367_init_irq(void)
 {
 	void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
 
+	setup_irq_stubs(__irq_usr_shmobile_common, __irq_svc_shmobile_common);
+
 	register_intc_controller(&intca_desc);
 	register_intc_controller(&intcs_desc);
 
--- 0001/arch/arm/mach-shmobile/intc-sh7372.c
+++ work/arch/arm/mach-shmobile/intc-sh7372.c	2010-10-06 14:44:09.000000000 +0900
@@ -24,6 +24,8 @@
 #include <linux/sh_intc.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/traps.h>
+#include <mach/common.h>
 
 enum {
 	UNUSED_INTCA = 0,
@@ -580,6 +582,8 @@ void __init sh7372_init_irq(void)
 {
 	void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
 
+	setup_irq_stubs(__irq_usr_shmobile_common, __irq_svc_shmobile_common);
+
 	register_intc_controller(&intca_desc);
 	register_intc_controller(&intcs_desc);
 
--- 0001/arch/arm/mach-shmobile/intc-sh7377.c
+++ work/arch/arm/mach-shmobile/intc-sh7377.c	2010-10-06 14:44:28.000000000 +0900
@@ -24,6 +24,8 @@
 #include <linux/sh_intc.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/traps.h>
+#include <mach/common.h>
 
 enum {
 	UNUSED_INTCA = 0,
@@ -637,6 +639,8 @@ void __init sh7377_init_irq(void)
 {
 	void __iomem *intevtsa = ioremap_nocache(INTEVTSA, PAGE_SIZE);
 
+	setup_irq_stubs(__irq_usr_shmobile_common, __irq_svc_shmobile_common);
+
 	register_intc_controller(&intca_desc);
 	register_intc_controller(&intcs_desc);
 

  parent reply	other threads:[~2010-10-06  7:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06  7:17 [PATCH 00/08] ARM: Dynamic IRQ demux support Magnus Damm
2010-10-06  7:17 ` [PATCH 01/08] ARM: Move entry-header.S to asm/ Magnus Damm
2010-10-06  7:17 ` [PATCH 02/08] ARM: Move macros from entry-armv.S Magnus Damm
2010-10-06  7:17 ` [PATCH 03/08] ARM: Make alignment_trap macro self-contained Magnus Damm
2010-10-06  7:18 ` [PATCH 04/08] ARM: Convert __irq_svc and __usr_svc to macros Magnus Damm
2010-10-06  7:18 ` [PATCH 05/08] ARM: Move the unwind header to entry-header.S Magnus Damm
2010-10-06  7:18 ` [PATCH 06/08] ARM: Add setup_irq_stubs() function Magnus Damm
2010-10-06  7:18 ` [PATCH 07/08] ARM: Add CONFIG_DEFAULT_IRQ_DEMUX Magnus Damm
2010-10-06  7:18 ` Magnus Damm [this message]
2010-10-06 13:06 ` [PATCH 00/08] ARM: Dynamic IRQ demux support Eric Miao
2010-10-06 14:58   ` Grant Likely
2010-10-06 15:06     ` Eric Miao
2010-10-06 15:11       ` Eric Miao
2010-10-06 15:26         ` Grant Likely
2010-10-06 15:38           ` Eric Miao
2010-10-07  6:39   ` Magnus Damm
2010-10-08  7:09     ` Eric Miao
2010-10-14 10:50       ` Magnus Damm
2010-10-16  3:53         ` Grant Likely

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=20101006071837.28048.58439.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox