Skip to contentSkip to conversation

consolidate and clean up the arch/arm/mach-mx5/mm-*.c

PATCH New Jason Liu 1 participant 4 messages Sep 9, 2011

Subsystems (3)
lore
Share & tools
lore

Jason Liu

author
#0 lore raw

v4 cover consolidate and clean up the arch/arm/mach-mx5/mm-*.c

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: Consolidate TZIC map code

---
v4: arrage code(mm.c) layout by the sequence:mx50,mx51,mx51

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 (3):
ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c
ARM: i.MX5/mm: Remove MX51_DEBUG related mapping
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                    |   76 ++++++++++++++++++-----------
 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, 55 insertions(+), 118 deletions(-)
 delete mode 100644 arch/arm/mach-mx5/mm-mx50.c
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH v4 1/3 ARM: i.MX5/mm: Consolidate arch/arm/mach-mx5/mm-*.c

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.

---
v1:arrage code(mm.c) layout by the sequence:mx50,mx51,mx51

---
 arch/arm/mach-mx5/Makefile  |    1 -
 arch/arm/mach-mx5/mm-mx50.c |   72 -------------------------------------------
 arch/arm/mach-mx5/mm.c      |   48 +++++++++++++++++++++++++---
 3 files changed, 43 insertions(+), 78 deletions(-)
arch/arm/mach-mx5/Makefile +0 -1
index 383e7cd..60f756d 100644
@@ -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
arch/arm/mach-mx5/mm-mx50.c deleted +0 -72

72 lines not on this page · raw message

arch/arm/mach-mx5/mm.c +43 -5

83 lines not on this page · raw message

Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH v4 2/3 ARM: i.MX5/mm: Remove MX51_DEBUG related mapping

In reply to Jason Liu

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

Cc Sascha Hauer <[email protected]>
---
 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(-)
arch/arm/mach-mx5/mm.c +0 -1
index 999f0d3..0002b68 100644
@@ -36,7 +36,6 @@ static struct map_desc mx50_io_desc[] __initdata = {
  */
 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),
arch/arm/plat-mxc/include/mach/hardware.h +0 -1
index a8bfd56..33728aa 100644
@@ -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
arch/arm/plat-mxc/include/mach/mx51.h +0 -12
index dede19a..652f2b0 100644
@@ -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
  */
Signature · 1 line
1.7.4.1
author
#3 lore raw

PATCH v4 3/3 ARM: i.MX5/mm: consolidate TZIC map code

In reply to Jason Liu

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:
9ab4650 (ARM: imx: Get the silicon version from the IIM module)

Cc Sascha Hauer <[email protected]>

---
v4: squash patches,fix the upper-letter(hex value) in comments,fix hash value
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/hardware.h |    6 ++++++
 arch/arm/plat-mxc/include/mach/mx51.h     |    4 +---
 arch/arm/plat-mxc/include/mach/mx53.h     |    1 +
 4 files changed, 12 insertions(+), 26 deletions(-)
arch/arm/mach-mx5/mm.c +4 -23
index 0002b68..80998b0 100644
@@ -35,6 +35,7 @@ static struct map_desc mx50_io_desc[] __initdata = {
  * 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),
@@ -45,6 +46,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 mx50_init_irq(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));
 }
 
 static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
arch/arm/plat-mxc/include/mach/hardware.h +6 -0
index 33728aa..264a2ee 100644
@@ -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 +					\
arch/arm/plat-mxc/include/mach/mx51.h +1 -3
index 652f2b0..ba88550 100644
@@ -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))
@@ -338,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__ */
arch/arm/plat-mxc/include/mach/mx53.h +1 -0
index 5e3c323..fbf2610 100644
@@ -9,6 +9,7 @@
 
 /* TZIC */
 #define MX53_TZIC_BASE_ADDR		0x0FFFC000
+#define MX53_TZIC_SIZE                  SZ_16K
 
 /*
  * AHCI SATA
Signature · 1 line
1.7.4.1