linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/20] ARM: imx5: tzic_init_irq() can directly be .init_irq hook
Date: Tue, 20 May 2014 16:45:26 +0800	[thread overview]
Message-ID: <1400575538-21136-9-git-send-email-shawn.guo@freescale.com> (raw)
In-Reply-To: <1400575538-21136-1-git-send-email-shawn.guo@freescale.com>

After i.MX51 supports DT only, tzic_init_irq() can figure out the
tzic_base on its own.  Thus, it can directly be .init_irq hook, and
mx51[53]_init_irq() can be saved.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
 arch/arm/mach-imx/common.h     |  4 +---
 arch/arm/mach-imx/mach-imx50.c |  2 +-
 arch/arm/mach-imx/mach-imx51.c |  2 +-
 arch/arm/mach-imx/mach-imx53.c |  2 +-
 arch/arm/mach-imx/mm-imx5.c    | 17 -----------------
 arch/arm/mach-imx/tzic.c       |  9 ++++++---
 6 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index cf9e9c2..6d018c0 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -37,15 +37,13 @@ void imx35_init_early(void);
 void imx51_init_early(void);
 void imx53_init_early(void);
 void mxc_init_irq(void __iomem *);
-void tzic_init_irq(void __iomem *);
+void tzic_init_irq(void);
 void mx1_init_irq(void);
 void mx21_init_irq(void);
 void mx25_init_irq(void);
 void mx27_init_irq(void);
 void mx31_init_irq(void);
 void mx35_init_irq(void);
-void mx51_init_irq(void);
-void mx53_init_irq(void);
 void imx1_soc_init(void);
 void imx21_soc_init(void);
 void imx25_soc_init(void);
diff --git a/arch/arm/mach-imx/mach-imx50.c b/arch/arm/mach-imx/mach-imx50.c
index b899c0b..66e537b 100644
--- a/arch/arm/mach-imx/mach-imx50.c
+++ b/arch/arm/mach-imx/mach-imx50.c
@@ -30,7 +30,7 @@ static const char *imx50_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(IMX50_DT, "Freescale i.MX50 (Device Tree Support)")
 	.map_io		= mx53_map_io,
-	.init_irq	= mx53_init_irq,
+	.init_irq	= tzic_init_irq,
 	.init_machine	= imx50_dt_init,
 	.dt_compat	= imx50_dt_board_compat,
 	.restart	= mxc_restart,
diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c
index b8cd968..a849d43 100644
--- a/arch/arm/mach-imx/mach-imx51.c
+++ b/arch/arm/mach-imx/mach-imx51.c
@@ -37,7 +37,7 @@ static const char *imx51_dt_board_compat[] __initconst = {
 DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
 	.map_io		= mx51_map_io,
 	.init_early	= imx51_init_early,
-	.init_irq	= mx51_init_irq,
+	.init_irq	= tzic_init_irq,
 	.init_machine	= imx51_dt_init,
 	.init_late	= imx51_init_late,
 	.dt_compat	= imx51_dt_board_compat,
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 2bad387..9a066af 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -39,7 +39,7 @@ static const char *imx53_dt_board_compat[] __initconst = {
 DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
 	.map_io		= mx53_map_io,
 	.init_early	= imx53_init_early,
-	.init_irq	= mx53_init_irq,
+	.init_irq	= tzic_init_irq,
 	.init_machine	= imx53_dt_init,
 	.init_late	= imx53_init_late,
 	.dt_compat	= imx53_dt_board_compat,
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index 4c11202..d5dbf80 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -93,23 +93,6 @@ void __init imx53_init_early(void)
 	imx_src_init();
 }
 
-void __init mx51_init_irq(void)
-{
-	tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR));
-}
-
-void __init mx53_init_irq(void)
-{
-	struct device_node *np;
-	void __iomem *base;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,imx53-tzic");
-	base = of_iomap(np, 0);
-	WARN_ON(!base);
-
-	tzic_init_irq(base);
-}
-
 static struct sdma_platform_data imx51_sdma_pdata __initdata = {
 	.fw_name = "sdma-imx51.bin",
 };
diff --git a/arch/arm/mach-imx/tzic.c b/arch/arm/mach-imx/tzic.c
index 7828af4..1d4f384 100644
--- a/arch/arm/mach-imx/tzic.c
+++ b/arch/arm/mach-imx/tzic.c
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/irqdomain.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <asm/mach/irq.h>
 #include <asm/exception.h>
@@ -153,13 +154,16 @@ static void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
  * interrupts. It registers the interrupt enable and disable functions
  * to the kernel for each interrupt source.
  */
-void __init tzic_init_irq(void __iomem *irqbase)
+void __init tzic_init_irq(void)
 {
 	struct device_node *np;
 	int irq_base;
 	int i;
 
-	tzic_base = irqbase;
+	np = of_find_compatible_node(NULL, NULL, "fsl,tzic");
+	tzic_base = of_iomap(np, 0);
+	WARN_ON(!tzic_base);
+
 	/* put the TZIC into the reset value with
 	 * all interrupts disabled
 	 */
@@ -181,7 +185,6 @@ void __init tzic_init_irq(void __iomem *irqbase)
 	irq_base = irq_alloc_descs(-1, 0, TZIC_NUM_IRQS, numa_node_id());
 	WARN_ON(irq_base < 0);
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,tzic");
 	domain = irq_domain_add_legacy(np, TZIC_NUM_IRQS, irq_base, 0,
 				       &irq_domain_simple_ops, NULL);
 	WARN_ON(!domain);
-- 
1.8.3.2

  parent reply	other threads:[~2014-05-20  8:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20  8:45 [PATCH v2 00/20] ARM: imx: clean up i.MX5 support Shawn Guo
2014-05-20  8:45 ` [PATCH 01/20] ARM: imx: move EHCI platform defines out of platform_data header Shawn Guo
2014-05-20  8:45 ` [PATCH 02/20] ARM: imx5: move SOC_IMX5 and SOC_IMX51 into 'Device tree only' Shawn Guo
2014-05-20  8:45 ` [PATCH 03/20] ARM: imx5: drop option MACH_IMX51_DT Shawn Guo
2014-05-20  8:45 ` [PATCH 04/20] ARM: imx5: remove imx51 non-DT support files Shawn Guo
2014-05-20  8:45 ` [PATCH 05/20] ARM: imx5: remove i.MX5 non-DT device registration helpers Shawn Guo
2014-05-20  9:02   ` Alexander Shiyan
2014-05-20 11:47     ` Shawn Guo
2014-05-20  8:45 ` [PATCH 06/20] ARM: imx5: make mx51_clocks_init() a DT call Shawn Guo
2014-05-20  8:45 ` [PATCH 07/20] ARM: imx5: drop arguments from mx5_clocks_common_init() Shawn Guo
2014-05-20  8:45 ` Shawn Guo [this message]
2014-05-20  8:45 ` [PATCH 09/20] ARM: imx5: remove function imx51_soc_init() Shawn Guo
2014-05-20  8:45 ` [PATCH 10/20] ARM: imx5: call mxc_timer_init_dt() on imx51 Shawn Guo
2014-05-20  8:45 ` [PATCH 11/20] ARM: imx5: retrieve iim base from device tree Shawn Guo
2014-05-20  8:45 ` [PATCH 12/20] ARM: imx5: remove header crm-regs-imx5.h Shawn Guo
2014-05-20  8:45 ` [PATCH 13/20] ARM: imx5: use dynamic mapping for CCM block Shawn Guo
2014-05-20  8:45 ` [PATCH 14/20] ARM: imx5: use dynamic mapping for DPLL block Shawn Guo
2014-05-20  8:45 ` [PATCH 15/20] ARM: imx5: reuse clock CCM mapping in pm code Shawn Guo
2014-05-20  8:45 ` [PATCH 16/20] ARM: imx5: use dynamic mapping for Cortex and GPC block Shawn Guo
2014-05-20  8:45 ` [PATCH 17/20] ARM: imx5: move init hooks into mach-imx5x.c Shawn Guo
2014-05-20 11:53   ` Shawn Guo
2014-05-20  8:45 ` [PATCH 18/20] ARM: imx5: remove file mm-imx5.c Shawn Guo
2014-05-20  9:42   ` Alexander Shiyan
2014-05-20 11:50     ` Shawn Guo
2014-05-20  8:45 ` [PATCH 19/20] ARM: imx5: clean function declarations in mx51.h Shawn Guo
2014-05-20  8:45 ` [PATCH 20/20] ARM: imx5: remove mx51.h and mx53.h Shawn Guo
2014-05-21  6:21 ` [PATCH v2 00/20] ARM: imx: clean up i.MX5 support Sascha Hauer

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=1400575538-21136-9-git-send-email-shawn.guo@freescale.com \
    --to=shawn.guo@freescale.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;
as well as URLs for NNTP newsgroup(s).