linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Consolidate and clean up the arch/arm/mach-mx5/mm-*.c
@ 2011-09-08  3:27 Jason Liu
  2011-09-08  3:27 ` [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c Jason Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jason Liu @ 2011-09-08  3:27 UTC (permalink / raw)
  To: linux-arm-kernel

The patch-set work for consolidate and clean up the arch/arm/mach-mx5/mm-*.c

Jason Liu (4):
  ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c
  ARM: i.MX5/mm: Remove MX51_DEBUG related mapping
  ARM: i.MX5/mm: add the TZIC mapping resource
  ARM: i.MX5/mm: use static mapping for TZIC

---
v3: remove the TZIC for i.mx51 TO1 since there is no support for TO1 now.
    add missing static mapping comments for the i.mx53 part
    split the patches to 1) remove DEBUG mapping 2) add TZIC mapping

v2: Remove the MX51_DEBUG related mapping which is conflict with TZIC.
    MX51_DEBUG related mapping is dead code, no-one use it.

Jason Liu (4):
  ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c
  ARM: i.MX5/mm: Remove MX51_DEBUG related mapping
  ARM: i.MX5/mm: add the TZIC mapping resource
  ARM: i.MX5/mm: consolidate TZIC map code

 arch/arm/mach-mx5/Makefile                |    1 -
 arch/arm/mach-mx5/mm-mx50.c               |   72 -----------------------------
 arch/arm/mach-mx5/mm.c                    |   67 ++++++++++++++++++---------
 arch/arm/plat-mxc/include/mach/hardware.h |    7 ++-
 arch/arm/plat-mxc/include/mach/mx51.h     |   16 +------
 arch/arm/plat-mxc/include/mach/mx53.h     |    1 +
 6 files changed, 53 insertions(+), 111 deletions(-)
 delete mode 100644 arch/arm/mach-mx5/mm-mx50.c

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c
  2011-09-08  3:27 [PATCH v3 0/4] Consolidate and clean up the arch/arm/mach-mx5/mm-*.c Jason Liu
@ 2011-09-08  3:27 ` Jason Liu
  2011-09-09  8:00   ` Uwe Kleine-König
  2011-09-08  3:27 ` [PATCH v3 2/4] ARM: i.MX5/mm: Remove MX51_DEBUG related mapping Jason Liu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Jason Liu @ 2011-09-08  3:27 UTC (permalink / raw)
  To: linux-arm-kernel

We don't need one seperate file to deal with i.mx50
related stuff, which is very similar with i.mx51/53.
We can put it together into one file.So, just merge
function from mm-mx50.c to mm.c and remove mm-mx50.c

No function change by this commit.

Signed-off-by: Jason Liu <jason.hui@linaro.org>
---
 arch/arm/mach-mx5/Makefile  |    1 -
 arch/arm/mach-mx5/mm-mx50.c |   72 -------------------------------------------
 arch/arm/mach-mx5/mm.c      |   43 +++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 73 deletions(-)

diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
index 383e7cd..60f756d 100644
--- a/arch/arm/mach-mx5/Makefile
+++ b/arch/arm/mach-mx5/Makefile
@@ -4,7 +4,6 @@
 
 # Object file lists.
 obj-y   := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
-obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
 
 obj-$(CONFIG_PM) += pm-imx5.o
 obj-$(CONFIG_CPU_FREQ_IMX)    += cpu_op-mx51.o
diff --git a/arch/arm/mach-mx5/mm-mx50.c b/arch/arm/mach-mx5/mm-mx50.c
deleted file mode 100644
index 77e374c..0000000
--- a/arch/arm/mach-mx5/mm-mx50.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * 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; either version 2 of the License, or
- * (at your option) any later version.
-
- * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Create static mapping between physical to virtual memory.
- */
-
-#include <linux/mm.h>
-#include <linux/init.h>
-
-#include <asm/mach/map.h>
-
-#include <mach/hardware.h>
-#include <mach/common.h>
-#include <mach/iomux-v3.h>
-#include <mach/irqs.h>
-
-/*
- * Define the MX50 memory map.
- */
-static struct map_desc mx50_io_desc[] __initdata = {
-	imx_map_entry(MX50, TZIC, MT_DEVICE),
-	imx_map_entry(MX50, SPBA0, MT_DEVICE),
-	imx_map_entry(MX50, AIPS1, MT_DEVICE),
-	imx_map_entry(MX50, AIPS2, MT_DEVICE),
-};
-
-/*
- * This function initializes the memory map. It is called during the
- * system startup to create static physical to virtual memory mappings
- * for the IO modules.
- */
-void __init mx50_map_io(void)
-{
-	iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
-}
-
-void __init imx50_init_early(void)
-{
-	mxc_set_cpu_type(MXC_CPU_MX50);
-	mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
-	mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
-}
-
-void __init mx50_init_irq(void)
-{
-	tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
-}
-
-void __init imx50_soc_init(void)
-{
-	/* i.mx50 has the i.mx31 type gpio */
-	mxc_register_gpio("imx31-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
-	mxc_register_gpio("imx31-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
-	mxc_register_gpio("imx31-gpio", 2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
-	mxc_register_gpio("imx31-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
-	mxc_register_gpio("imx31-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
-	mxc_register_gpio("imx31-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
-}
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index baea6e5..63b0ab3 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -42,6 +42,16 @@ static struct map_desc mx53_io_desc[] __initdata = {
 };
 
 /*
+ * Define the MX50 memory map.
+ */
+static struct map_desc mx50_io_desc[] __initdata = {
+	imx_map_entry(MX50, TZIC, MT_DEVICE),
+	imx_map_entry(MX50, SPBA0, MT_DEVICE),
+	imx_map_entry(MX50, AIPS1, MT_DEVICE),
+	imx_map_entry(MX50, AIPS2, MT_DEVICE),
+};
+
+/*
  * This function initializes the memory map. It is called during the
  * system startup to create static physical to virtual memory mappings
  * for the IO modules.
@@ -70,6 +80,23 @@ void __init imx53_init_early(void)
 	mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
 }
 
+/*
+ * This function initializes the memory map. It is called during the
+ * system startup to create static physical to virtual memory mappings
+ * for the IO modules.
+ */
+void __init mx50_map_io(void)
+{
+	iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
+}
+
+void __init imx50_init_early(void)
+{
+	mxc_set_cpu_type(MXC_CPU_MX50);
+	mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
+	mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
+}
+
 void __init mx51_init_irq(void)
 {
 	unsigned long tzic_addr;
@@ -101,6 +128,11 @@ void __init mx53_init_irq(void)
 	tzic_init_irq(tzic_virt);
 }
 
+void __init mx50_init_irq(void)
+{
+	tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
+}
+
 static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
 	.ap_2_ap_addr = 642,
 	.uart_2_mcu_addr = 817,
@@ -164,3 +196,14 @@ void __init imx53_soc_init(void)
 	/* i.mx53 has the i.mx35 type sdma */
 	imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
 }
+
+void __init imx50_soc_init(void)
+{
+	/* i.mx50 has the i.mx31 type gpio */
+	mxc_register_gpio("imx31-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
+	mxc_register_gpio("imx31-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
+	mxc_register_gpio("imx31-gpio", 2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
+	mxc_register_gpio("imx31-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
+	mxc_register_gpio("imx31-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
+	mxc_register_gpio("imx31-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
+}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 2/4] ARM: i.MX5/mm: Remove MX51_DEBUG related mapping
  2011-09-08  3:27 [PATCH v3 0/4] Consolidate and clean up the arch/arm/mach-mx5/mm-*.c Jason Liu
  2011-09-08  3:27 ` [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c Jason Liu
@ 2011-09-08  3:27 ` Jason Liu
  2011-09-08  3:27 ` [PATCH v3 3/4] ARM: i.MX5/mm: add the TZIC mapping resource Jason Liu
  2011-09-08  3:27 ` [PATCH v3 4/4] ARM: i.MX5/mm: consolidate TZIC map code Jason Liu
  3 siblings, 0 replies; 8+ messages in thread
From: Jason Liu @ 2011-09-08  3:27 UTC (permalink / raw)
  To: linux-arm-kernel

MX51_DEBUG related mapping is dead code, no-one use it

Signed-off-by: Jason Liu <jason.hui@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx5/mm.c                    |    1 -
 arch/arm/plat-mxc/include/mach/hardware.h |    1 -
 arch/arm/plat-mxc/include/mach/mx51.h     |   12 ------------
 3 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 63b0ab3..0ca4c6a 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -26,7 +26,6 @@
  */
 static struct map_desc mx51_io_desc[] __initdata = {
 	imx_map_entry(MX51, IRAM, MT_DEVICE),
-	imx_map_entry(MX51, DEBUG, MT_DEVICE),
 	imx_map_entry(MX51, AIPS1, MT_DEVICE),
 	imx_map_entry(MX51, SPBA0, MT_DEVICE),
 	imx_map_entry(MX51, AIPS2, MT_DEVICE),
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index a8bfd56..33728aa 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -82,7 +82,6 @@
  *	AIPS2	0x63f00000+0x100000	->	0xf5300000+0x100000
  * mx51:
  *	IRAM	0x1ffe0000+0x020000	->	0xf4fe0000+0x020000
- *	DEBUG	0x60000000+0x100000	->	0xf5000000+0x100000
  *	SPBA0	0x70000000+0x100000	->	0xf5400000+0x100000
  *	AIPS1	0x73f00000+0x100000	->	0xf5700000+0x100000
  *	AIPS2	0x83f00000+0x100000	->	0xf4300000+0x100000
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
index dede19a..652f2b0 100644
--- a/arch/arm/plat-mxc/include/mach/mx51.h
+++ b/arch/arm/plat-mxc/include/mach/mx51.h
@@ -18,18 +18,6 @@
 #define MX51_GPU_CTRL_BASE_ADDR		0x30000000
 #define MX51_IPU_CTRL_BASE_ADDR		0x40000000
 
-#define MX51_DEBUG_BASE_ADDR		0x60000000
-#define MX51_DEBUG_SIZE			SZ_1M
-
-#define MX51_ETB_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x01000)
-#define MX51_ETM_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x02000)
-#define MX51_TPIU_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x03000)
-#define MX51_CTI0_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x04000)
-#define MX51_CTI1_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x05000)
-#define MX51_CTI2_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x06000)
-#define MX51_CTI3_BASE_ADDR		(MX51_DEBUG_BASE_ADDR + 0x07000)
-#define MX51_CORTEX_DBG_BASE_ADDR	(MX51_DEBUG_BASE_ADDR + 0x08000)
-
 /*
  * SPBA global module enabled #0
  */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 3/4] ARM: i.MX5/mm: add the TZIC mapping resource
  2011-09-08  3:27 [PATCH v3 0/4] Consolidate and clean up the arch/arm/mach-mx5/mm-*.c Jason Liu
  2011-09-08  3:27 ` [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c Jason Liu
  2011-09-08  3:27 ` [PATCH v3 2/4] ARM: i.MX5/mm: Remove MX51_DEBUG related mapping Jason Liu
@ 2011-09-08  3:27 ` Jason Liu
  2011-09-09  8:23   ` Uwe Kleine-König
  2011-09-08  3:27 ` [PATCH v3 4/4] ARM: i.MX5/mm: consolidate TZIC map code Jason Liu
  3 siblings, 1 reply; 8+ messages in thread
From: Jason Liu @ 2011-09-08  3:27 UTC (permalink / raw)
  To: linux-arm-kernel

Add the TZIC mapping size and also add missing static mapping
comments for the i.mx53 part

Signed-off-by: Jason Liu <jason.hui@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/plat-mxc/include/mach/hardware.h |    6 ++++++
 arch/arm/plat-mxc/include/mach/mx51.h     |    1 +
 arch/arm/plat-mxc/include/mach/mx53.h     |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 33728aa..d1ba212 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -81,10 +81,16 @@
  *	AIPS1	0x53f00000+0x100000	->	0xf5700000+0x100000
  *	AIPS2	0x63f00000+0x100000	->	0xf5300000+0x100000
  * mx51:
+ *	TZIC	0xe0000000+0x004000	->	0xf5000000+0x004000
  *	IRAM	0x1ffe0000+0x020000	->	0xf4fe0000+0x020000
  *	SPBA0	0x70000000+0x100000	->	0xf5400000+0x100000
  *	AIPS1	0x73f00000+0x100000	->	0xf5700000+0x100000
  *	AIPS2	0x83f00000+0x100000	->	0xf4300000+0x100000
+ * mx53:
+ *	TZIC	0x0FFFC000+0x004000	->	0xf4bfc000+0x004000
+ *	SPBA0	0x50000000+0x100000	->	0xf5400000+0x100000
+ *	AIPS1	0x53F00000+0x100000	->	0xf5700000+0x100000
+ *	AIPS2	0x63F00000+0x100000	->	0xf5300000+0x100000
  */
 #define IMX_IO_P2V(x)	(						\
 			0xf4000000 +					\
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
index 652f2b0..8da9d7a 100644
--- a/arch/arm/plat-mxc/include/mach/mx51.h
+++ b/arch/arm/plat-mxc/include/mach/mx51.h
@@ -120,6 +120,7 @@
 
 #define MX51_GPU2D_BASE_ADDR		0xd0000000
 #define MX51_TZIC_BASE_ADDR		0xe0000000
+#define MX51_TZIC_SIZE			SZ_16K
 
 #define MX51_IO_P2V(x)			IMX_IO_P2V(x)
 #define MX51_IO_ADDRESS(x)		IOMEM(MX51_IO_P2V(x))
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
index 5e3c323..fbf2610 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/plat-mxc/include/mach/mx53.h
@@ -9,6 +9,7 @@
 
 /* TZIC */
 #define MX53_TZIC_BASE_ADDR		0x0FFFC000
+#define MX53_TZIC_SIZE                  SZ_16K
 
 /*
  * AHCI SATA
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 4/4] ARM: i.MX5/mm: consolidate TZIC map code
  2011-09-08  3:27 [PATCH v3 0/4] Consolidate and clean up the arch/arm/mach-mx5/mm-*.c Jason Liu
                   ` (2 preceding siblings ...)
  2011-09-08  3:27 ` [PATCH v3 3/4] ARM: i.MX5/mm: add the TZIC mapping resource Jason Liu
@ 2011-09-08  3:27 ` Jason Liu
  2011-09-09  8:26   ` Uwe Kleine-König
  3 siblings, 1 reply; 8+ messages in thread
From: Jason Liu @ 2011-09-08  3:27 UTC (permalink / raw)
  To: linux-arm-kernel

We can use static mapping for TZIC to get rid of the
duplicated code for ioremap and the error handling of
ioremap, which will made code more clean and consistent

This patch also removes TZIC mapping for i.mx51 TO1 since
there is no support for TO1 now since the following commit:
9ab4650f718a0e1cb8792bab4ef97efca4ac75c2

Signed-off-by: Jason Liu <jason.hui@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
v3: remove the TZIC for i.mx51 TO1 since there is no support for TO1 now.
v2: Remove the MX51_DEBUG related mapping which is conflict with TZIC.
    MX51_DEBUG related mapping is dead code, no-one use it.
---
 arch/arm/mach-mx5/mm.c                |   27 ++++-----------------------
 arch/arm/plat-mxc/include/mach/mx51.h |    3 ---
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 0ca4c6a..c7125ca 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -25,6 +25,7 @@
  * Define the MX51 memory map.
  */
 static struct map_desc mx51_io_desc[] __initdata = {
+	imx_map_entry(MX51, TZIC, MT_DEVICE),
 	imx_map_entry(MX51, IRAM, MT_DEVICE),
 	imx_map_entry(MX51, AIPS1, MT_DEVICE),
 	imx_map_entry(MX51, SPBA0, MT_DEVICE),
@@ -35,6 +36,7 @@ static struct map_desc mx51_io_desc[] __initdata = {
  * Define the MX53 memory map.
  */
 static struct map_desc mx53_io_desc[] __initdata = {
+	imx_map_entry(MX53, TZIC, MT_DEVICE),
 	imx_map_entry(MX53, AIPS1, MT_DEVICE),
 	imx_map_entry(MX53, SPBA0, MT_DEVICE),
 	imx_map_entry(MX53, AIPS2, MT_DEVICE),
@@ -98,33 +100,12 @@ void __init imx50_init_early(void)
 
 void __init mx51_init_irq(void)
 {
-	unsigned long tzic_addr;
-	void __iomem *tzic_virt;
-
-	if (mx51_revision() < IMX_CHIP_REVISION_2_0)
-		tzic_addr = MX51_TZIC_BASE_ADDR_TO1;
-	else
-		tzic_addr = MX51_TZIC_BASE_ADDR;
-
-	tzic_virt = ioremap(tzic_addr, SZ_16K);
-	if (!tzic_virt)
-		panic("unable to map TZIC interrupt controller\n");
-
-	tzic_init_irq(tzic_virt);
+	tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR));
 }
 
 void __init mx53_init_irq(void)
 {
-	unsigned long tzic_addr;
-	void __iomem *tzic_virt;
-
-	tzic_addr = MX53_TZIC_BASE_ADDR;
-
-	tzic_virt = ioremap(tzic_addr, SZ_16K);
-	if (!tzic_virt)
-		panic("unable to map TZIC interrupt controller\n");
-
-	tzic_init_irq(tzic_virt);
+	tzic_init_irq(MX53_IO_ADDRESS(MX53_TZIC_BASE_ADDR));
 }
 
 void __init mx50_init_irq(void)
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
index 8da9d7a..ba88550 100644
--- a/arch/arm/plat-mxc/include/mach/mx51.h
+++ b/arch/arm/plat-mxc/include/mach/mx51.h
@@ -339,7 +339,4 @@ extern int mx51_revision(void);
 extern void mx51_display_revision(void);
 #endif
 
-/* tape-out 1 defines */
-#define MX51_TZIC_BASE_ADDR_TO1		0x8fffc000
-
 #endif	/* ifndef __MACH_MX51_H__ */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c
  2011-09-08  3:27 ` [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c Jason Liu
@ 2011-09-09  8:00   ` Uwe Kleine-König
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2011-09-09  8:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Jason,

On Thu, Sep 08, 2011 at 11:27:24AM +0800, Jason Liu wrote:
> We don't need one seperate file to deal with i.mx50
> related stuff, which is very similar with i.mx51/53.
> We can put it together into one file.So, just merge
> function from mm-mx50.c to mm.c and remove mm-mx50.c
> 
> No function change by this commit.
> 
> Signed-off-by: Jason Liu <jason.hui@linaro.org>
> ---
>  arch/arm/mach-mx5/Makefile  |    1 -
>  arch/arm/mach-mx5/mm-mx50.c |   72 -------------------------------------------
>  arch/arm/mach-mx5/mm.c      |   43 +++++++++++++++++++++++++
>  3 files changed, 43 insertions(+), 73 deletions(-)
> 
> diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
> index 383e7cd..60f756d 100644
> --- a/arch/arm/mach-mx5/Makefile
> +++ b/arch/arm/mach-mx5/Makefile
> @@ -4,7 +4,6 @@
>  
>  # Object file lists.
>  obj-y   := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
> -obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
>  
>  obj-$(CONFIG_PM) += pm-imx5.o
>  obj-$(CONFIG_CPU_FREQ_IMX)    += cpu_op-mx51.o
> diff --git a/arch/arm/mach-mx5/mm-mx50.c b/arch/arm/mach-mx5/mm-mx50.c
> deleted file mode 100644
> index 77e374c..0000000
> --- a/arch/arm/mach-mx5/mm-mx50.c
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -/*
> - * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
> - *
> - * 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; either version 2 of the License, or
> - * (at your option) any later version.
> -
> - * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
> - *
> - * Create static mapping between physical to virtual memory.
> - */
> -
> -#include <linux/mm.h>
> -#include <linux/init.h>
> -
> -#include <asm/mach/map.h>
> -
> -#include <mach/hardware.h>
> -#include <mach/common.h>
> -#include <mach/iomux-v3.h>
> -#include <mach/irqs.h>
> -
> -/*
> - * Define the MX50 memory map.
> - */
> -static struct map_desc mx50_io_desc[] __initdata = {
> -	imx_map_entry(MX50, TZIC, MT_DEVICE),
> -	imx_map_entry(MX50, SPBA0, MT_DEVICE),
> -	imx_map_entry(MX50, AIPS1, MT_DEVICE),
> -	imx_map_entry(MX50, AIPS2, MT_DEVICE),
> -};
> -
> -/*
> - * This function initializes the memory map. It is called during the
> - * system startup to create static physical to virtual memory mappings
> - * for the IO modules.
> - */
> -void __init mx50_map_io(void)
> -{
> -	iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
> -}
> -
> -void __init imx50_init_early(void)
> -{
> -	mxc_set_cpu_type(MXC_CPU_MX50);
> -	mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
> -	mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
> -}
> -
> -void __init mx50_init_irq(void)
> -{
> -	tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
> -}
> -
> -void __init imx50_soc_init(void)
> -{
> -	/* i.mx50 has the i.mx31 type gpio */
> -	mxc_register_gpio("imx31-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
> -	mxc_register_gpio("imx31-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
> -	mxc_register_gpio("imx31-gpio", 2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
> -	mxc_register_gpio("imx31-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
> -	mxc_register_gpio("imx31-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
> -	mxc_register_gpio("imx31-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
> -}
> diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
> index baea6e5..63b0ab3 100644
> --- a/arch/arm/mach-mx5/mm.c
> +++ b/arch/arm/mach-mx5/mm.c
> @@ -42,6 +42,16 @@ static struct map_desc mx53_io_desc[] __initdata = {
>  };
>  
>  /*
> + * Define the MX50 memory map.
> + */
> +static struct map_desc mx50_io_desc[] __initdata = {
> +	imx_map_entry(MX50, TZIC, MT_DEVICE),
> +	imx_map_entry(MX50, SPBA0, MT_DEVICE),
> +	imx_map_entry(MX50, AIPS1, MT_DEVICE),
> +	imx_map_entry(MX50, AIPS2, MT_DEVICE),
> +};
I'd prefer to have the i.MX50 stuff above i.MX51, not below i.MX53.
Applies to the other items, too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 3/4] ARM: i.MX5/mm: add the TZIC mapping resource
  2011-09-08  3:27 ` [PATCH v3 3/4] ARM: i.MX5/mm: add the TZIC mapping resource Jason Liu
@ 2011-09-09  8:23   ` Uwe Kleine-König
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2011-09-09  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 08, 2011 at 11:27:26AM +0800, Jason Liu wrote:
> Add the TZIC mapping size and also add missing static mapping
> comments for the i.mx53 part
> 
> Signed-off-by: Jason Liu <jason.hui@linaro.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/plat-mxc/include/mach/hardware.h |    6 ++++++
>  arch/arm/plat-mxc/include/mach/mx51.h     |    1 +
>  arch/arm/plat-mxc/include/mach/mx53.h     |    1 +
>  3 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
> index 33728aa..d1ba212 100644
> --- a/arch/arm/plat-mxc/include/mach/hardware.h
> +++ b/arch/arm/plat-mxc/include/mach/hardware.h
> @@ -81,10 +81,16 @@
>   *	AIPS1	0x53f00000+0x100000	->	0xf5700000+0x100000
>   *	AIPS2	0x63f00000+0x100000	->	0xf5300000+0x100000
>   * mx51:
> + *	TZIC	0xe0000000+0x004000	->	0xf5000000+0x004000
>   *	IRAM	0x1ffe0000+0x020000	->	0xf4fe0000+0x020000
>   *	SPBA0	0x70000000+0x100000	->	0xf5400000+0x100000
>   *	AIPS1	0x73f00000+0x100000	->	0xf5700000+0x100000
>   *	AIPS2	0x83f00000+0x100000	->	0xf4300000+0x100000
> + * mx53:
> + *	TZIC	0x0FFFC000+0x004000	->	0xf4bfc000+0x004000
> + *	SPBA0	0x50000000+0x100000	->	0xf5400000+0x100000
> + *	AIPS1	0x53F00000+0x100000	->	0xf5700000+0x100000
> + *	AIPS2	0x63F00000+0x100000	->	0xf5300000+0x100000
The numbers are right, but using small letters would be more consistent.
Hmm, it seems I wasn't attentive when the mx53 mapping was introduced
...

Other than that this should be folded into patch 4 IMHO.

Best regards
Uwe

>   */
>  #define IMX_IO_P2V(x)	(						\
>  			0xf4000000 +					\
> diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
> index 652f2b0..8da9d7a 100644
> --- a/arch/arm/plat-mxc/include/mach/mx51.h
> +++ b/arch/arm/plat-mxc/include/mach/mx51.h
> @@ -120,6 +120,7 @@
>  
>  #define MX51_GPU2D_BASE_ADDR		0xd0000000
>  #define MX51_TZIC_BASE_ADDR		0xe0000000
> +#define MX51_TZIC_SIZE			SZ_16K
>  
>  #define MX51_IO_P2V(x)			IMX_IO_P2V(x)
>  #define MX51_IO_ADDRESS(x)		IOMEM(MX51_IO_P2V(x))
> diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
> index 5e3c323..fbf2610 100644
> --- a/arch/arm/plat-mxc/include/mach/mx53.h
> +++ b/arch/arm/plat-mxc/include/mach/mx53.h
> @@ -9,6 +9,7 @@
>  
>  /* TZIC */
>  #define MX53_TZIC_BASE_ADDR		0x0FFFC000
> +#define MX53_TZIC_SIZE                  SZ_16K
>  
>  /*
>   * AHCI SATA
> -- 
> 1.7.4.1
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 4/4] ARM: i.MX5/mm: consolidate TZIC map code
  2011-09-08  3:27 ` [PATCH v3 4/4] ARM: i.MX5/mm: consolidate TZIC map code Jason Liu
@ 2011-09-09  8:26   ` Uwe Kleine-König
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2011-09-09  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 08, 2011 at 11:27:27AM +0800, Jason Liu wrote:
> We can use static mapping for TZIC to get rid of the
> duplicated code for ioremap and the error handling of
> ioremap, which will made code more clean and consistent
> 
> This patch also removes TZIC mapping for i.mx51 TO1 since
> there is no support for TO1 now since the following commit:
> 9ab4650f718a0e1cb8792bab4ef97efca4ac75c2
Something like

	9ab4650 (ARM: imx: Get the silicon version from the IIM module)

instead of the full hash without shortlog is generally preferred here. I
usually use

	git one 9ab4650f718a0e1cb8792bab4ef97efca4ac75c2

to get this (after doing

	git config --global alias.one "show -s --pretty='format:%h (%s)'"

once).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-09  8:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08  3:27 [PATCH v3 0/4] Consolidate and clean up the arch/arm/mach-mx5/mm-*.c Jason Liu
2011-09-08  3:27 ` [PATCH v3 1/4] ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c Jason Liu
2011-09-09  8:00   ` Uwe Kleine-König
2011-09-08  3:27 ` [PATCH v3 2/4] ARM: i.MX5/mm: Remove MX51_DEBUG related mapping Jason Liu
2011-09-08  3:27 ` [PATCH v3 3/4] ARM: i.MX5/mm: add the TZIC mapping resource Jason Liu
2011-09-09  8:23   ` Uwe Kleine-König
2011-09-08  3:27 ` [PATCH v3 4/4] ARM: i.MX5/mm: consolidate TZIC map code Jason Liu
2011-09-09  8:26   ` Uwe Kleine-König

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).