linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h>
@ 2011-10-17  6:15 Shawn Guo
  2011-10-17  6:15 ` [PATCH 1/5] arm/imx: remove mx31_setup_weimcs() from mx31.h Shawn Guo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Shawn Guo @ 2011-10-17  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

With rmk's mach/gpio.h cleanup series merged into arm-soc/imx tree,
plat-mxc/include/mach/gpio.h will become an empty file waiting for 
a global removal of mach/gpio.h.

Currently, this mach/gpio.h includes mach/hardware.h.  Once mach/gpio.h
becomes an empty file, we will hit a number of imx build errors caused
by the indirect inclusion to mach/hardware.h.  This series is trying to
address these errors before above two trees gets merged, which will
happen pretty soon, I believe.

Shawn Guo (5):
      arm/imx: remove mx31_setup_weimcs() from mx31.h
      arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c
      arm/imx: remove mx27_setup_weimcs() from mx27.h
      arm/imx: explicitly includes mach/hardware.h in pm-imx27.c
      mmc: mxcmmc: explicitly includes mach/hardware.h

 arch/arm/mach-imx/mach-kzm_arm11_01.c |    1 +
 arch/arm/mach-imx/mach-pcm038.c       |    4 +++-
 arch/arm/mach-imx/mach-qong.c         |    5 ++++-
 arch/arm/mach-imx/pm-imx27.c          |    2 +-
 arch/arm/plat-mxc/include/mach/mx27.h |   14 --------------
 arch/arm/plat-mxc/include/mach/mx31.h |   14 --------------
 drivers/mmc/host/mxcmmc.c             |    1 +
 7 files changed, 10 insertions(+), 31 deletions(-)

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

* [PATCH 1/5] arm/imx: remove mx31_setup_weimcs() from mx31.h
  2011-10-17  6:15 [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h> Shawn Guo
@ 2011-10-17  6:15 ` Shawn Guo
  2011-10-17  6:15 ` [PATCH 2/5] arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c Shawn Guo
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2011-10-17  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

The helper function mx31_setup_weimcs() references IOMEM() and
IMX_IO_P2V() but without required header mach/hardware.h included
in mx31.h.  This will break the build of those mx31 based board file
with no direct inclusion of mach/hardware.h, or when indirect inclusion
to mach/hardware.h breaks.

For example, when the inclusion of mach/hardware.h gets removed from
mach/gpio.h, we will see the following compile error.

  CC      arch/arm/mach-imx/mach-pcm037_eet.o
In file included from arch/arm/mach-imx/devices-imx31.h:9:0,
                 from arch/arm/mach-imx/mach-pcm037_eet.c:20:
arch/arm/plat-mxc/include/mach/mx31.h: In function ?mx31_setup_weimcs?:
arch/arm/plat-mxc/include/mach/mx31.h:129:2: error: implicit declaration of function ?IOMEM?
arch/arm/plat-mxc/include/mach/mx31.h:129:2: error: implicit declaration of function ?IMX_IO_P2V?

This patch removes mx31_setup_weimcs() from mx31.h and makes it local
to mach-qong.c, which is the only user for this helper.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/mach-imx/mach-qong.c         |    5 ++++-
 arch/arm/plat-mxc/include/mach/mx31.h |   14 --------------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index 1c4822b..4ff5faf 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -190,7 +190,10 @@ static struct platform_device qong_nand_device = {
 static void __init qong_init_nand_mtd(void)
 {
 	/* init CS */
-	mx31_setup_weimcs(3, 0x00004f00, 0x20013b31, 0x00020800);
+	__raw_writel(0x00004f00, MX31_IO_ADDRESS(MX31_WEIM_CSCRxU(3)));
+	__raw_writel(0x20013b31, MX31_IO_ADDRESS(MX31_WEIM_CSCRxL(3)));
+	__raw_writel(0x00020800, MX31_IO_ADDRESS(MX31_WEIM_CSCRxA(3)));
+
 	mxc_iomux_set_gpr(MUX_SDCTL_CSD1_SEL, true);
 
 	/* enable pin */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 79e7fc0..e27619e 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -1,10 +1,6 @@
 #ifndef __MACH_MX31_H__
 #define __MACH_MX31_H__
 
-#ifndef __ASSEMBLER__
-#include <linux/io.h>
-#endif
-
 /*
  * IRAM
  */
@@ -122,16 +118,6 @@
 #define MX31_IO_P2V(x)			IMX_IO_P2V(x)
 #define MX31_IO_ADDRESS(x)		IOMEM(MX31_IO_P2V(x))
 
-#ifndef __ASSEMBLER__
-static inline void mx31_setup_weimcs(size_t cs,
-		unsigned upper, unsigned lower, unsigned addional)
-{
-	__raw_writel(upper, MX31_IO_ADDRESS(MX31_WEIM_CSCRxU(cs)));
-	__raw_writel(lower, MX31_IO_ADDRESS(MX31_WEIM_CSCRxL(cs)));
-	__raw_writel(addional, MX31_IO_ADDRESS(MX31_WEIM_CSCRxA(cs)));
-}
-#endif
-
 #define MX31_INT_I2C3		3
 #define MX31_INT_I2C2		4
 #define MX31_INT_MPEG4_ENCODER	5
-- 
1.7.4.1

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

* [PATCH 2/5] arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c
  2011-10-17  6:15 [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h> Shawn Guo
  2011-10-17  6:15 ` [PATCH 1/5] arm/imx: remove mx31_setup_weimcs() from mx31.h Shawn Guo
@ 2011-10-17  6:15 ` Shawn Guo
  2011-10-17  6:15 ` [PATCH 3/5] arm/imx: remove mx27_setup_weimcs() from mx27.h Shawn Guo
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2011-10-17  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

The mach-kzm_arm11_01.c references a number of things requiring the
explicit inclusion of mach/hardware.h.  Otherwise, when indirect
inclusion to mach/hardware.h gets cleaned up, we will see the following
compile error.

  CC      arch/arm/mach-imx/mach-kzm_arm11_01.o
arch/arm/mach-imx/mach-kzm_arm11_01.c:71:3: error: implicit declaration of function ?IOMEM?
arch/arm/mach-imx/mach-kzm_arm11_01.c:71:3: error: implicit declaration of function ?IMX_IO_P2V_MODULE?
arch/arm/mach-imx/mach-kzm_arm11_01.c:71:14: error: ?MX31_CS4? undeclared here (not in a function)
arch/arm/mach-imx/mach-kzm_arm11_01.c:71:14: error: ?MX31_CS5? undeclared here (not in a function)
arch/arm/mach-imx/mach-kzm_arm11_01.c:71:3: error: implicit declaration of function ?IMX_IO_P2V?

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/mach-imx/mach-kzm_arm11_01.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 4288e8f..5f37f89 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -36,6 +36,7 @@
 
 #include <mach/clock.h>
 #include <mach/common.h>
+#include <mach/hardware.h>
 #include <mach/iomux-mx3.h>
 
 #include "devices-imx31.h"
-- 
1.7.4.1

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

* [PATCH 3/5] arm/imx: remove mx27_setup_weimcs() from mx27.h
  2011-10-17  6:15 [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h> Shawn Guo
  2011-10-17  6:15 ` [PATCH 1/5] arm/imx: remove mx31_setup_weimcs() from mx31.h Shawn Guo
  2011-10-17  6:15 ` [PATCH 2/5] arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c Shawn Guo
@ 2011-10-17  6:15 ` Shawn Guo
  2011-10-17  6:15 ` [PATCH 4/5] arm/imx: explicitly includes mach/hardware.h in pm-imx27.c Shawn Guo
  2011-10-17  6:15 ` [PATCH 5/5] mmc: mxcmmc: explicitly includes mach/hardware.h Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2011-10-17  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

The helper function mx27_setup_weimcs() references IOMEM() and
IMX_IO_P2V() but without required header mach/hardware.h included
in mx27.h.  This will break the build of those mx27 file with no
direct inclusion of mach/hardware.h, or when indirect inclusion to
mach/hardware.h breaks.

For example, when the inclusion of mach/hardware.h gets removed from
mach/gpio.h, we will see the following compile error.

  CC      arch/arm/mach-imx/pm-imx27.o
In file included from arch/arm/mach-imx/pm-imx27.c:14:0:
arch/arm/plat-mxc/include/mach/mx27.h: In function ?mx27_setup_weimcs?:
arch/arm/plat-mxc/include/mach/mx27.h:138:2: error: implicit declaration of function ?IOMEM?
arch/arm/plat-mxc/include/mach/mx27.h:138:2: error: implicit declaration of function ?IMX_IO_P2V?

This patch removes mx27_setup_weimcs() from mx27.h and makes it local
to mach-pcm038.c, which is the only user for this helper.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/mach-imx/mach-pcm038.c       |    4 +++-
 arch/arm/plat-mxc/include/mach/mx27.h |   14 --------------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index f0a5282..100bc73 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -176,7 +176,9 @@ static struct platform_device *platform_devices[] __initdata = {
  * setup other stuffs to access the sram. */
 static void __init pcm038_init_sram(void)
 {
-	mx27_setup_weimcs(1, 0x0000d843, 0x22252521, 0x22220a00);
+	__raw_writel(0x0000d843, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(1)));
+	__raw_writel(0x22252521, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(1)));
+	__raw_writel(0x22220a00, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(1)));
 }
 
 static const struct imxi2c_platform_data pcm038_i2c1_data __initconst = {
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index 1dc1c52..6265357 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -24,10 +24,6 @@
 #ifndef __MACH_MX27_H__
 #define __MACH_MX27_H__
 
-#ifndef __ASSEMBLER__
-#include <linux/io.h>
-#endif
-
 #define MX27_AIPI_BASE_ADDR		0x10000000
 #define MX27_AIPI_SIZE			SZ_1M
 #define MX27_DMA_BASE_ADDR			(MX27_AIPI_BASE_ADDR + 0x01000)
@@ -131,16 +127,6 @@
 #define MX27_IO_P2V(x)			IMX_IO_P2V(x)
 #define MX27_IO_ADDRESS(x)		IOMEM(MX27_IO_P2V(x))
 
-#ifndef __ASSEMBLER__
-static inline void mx27_setup_weimcs(size_t cs,
-		unsigned upper, unsigned lower, unsigned addional)
-{
-	__raw_writel(upper, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(cs)));
-	__raw_writel(lower, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(cs)));
-	__raw_writel(addional, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(cs)));
-}
-#endif
-
 /* fixed interrupt numbers */
 #define MX27_INT_I2C2		1
 #define MX27_INT_GPT6		2
-- 
1.7.4.1

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

* [PATCH 4/5] arm/imx: explicitly includes mach/hardware.h in pm-imx27.c
  2011-10-17  6:15 [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h> Shawn Guo
                   ` (2 preceding siblings ...)
  2011-10-17  6:15 ` [PATCH 3/5] arm/imx: remove mx27_setup_weimcs() from mx27.h Shawn Guo
@ 2011-10-17  6:15 ` Shawn Guo
  2011-10-17  6:15 ` [PATCH 5/5] mmc: mxcmmc: explicitly includes mach/hardware.h Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2011-10-17  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

The pm-imx27.c references a number of things requiring the explicit
inclusion of mach/hardware.h.  Otherwise, when indirect inclusion
to mach/hardware.h gets cleaned up, we will see the following
compile error.

  CC      arch/arm/mach-imx/pm-imx27.o
arch/arm/mach-imx/pm-imx27.c: In function ?mx27_suspend_enter?:
arch/arm/mach-imx/pm-imx27.c:22:3: error: implicit declaration of function ?IOMEM?
arch/arm/mach-imx/pm-imx27.c:22:3: error: implicit declaration of function ?IMX_IO_P2V?
arch/arm/mach-imx/pm-imx27.c: In function ?mx27_pm_init?:
arch/arm/mach-imx/pm-imx27.c:42:2: error: implicit declaration of function ?cpu_is_mx27?

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/mach-imx/pm-imx27.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index acf1769..e455d2f 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -11,7 +11,7 @@
 #include <linux/suspend.h>
 #include <linux/io.h>
 #include <mach/system.h>
-#include <mach/mx27.h>
+#include <mach/hardware.h>
 
 static int mx27_suspend_enter(suspend_state_t state)
 {
-- 
1.7.4.1

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

* [PATCH 5/5] mmc: mxcmmc: explicitly includes mach/hardware.h
  2011-10-17  6:15 [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h> Shawn Guo
                   ` (3 preceding siblings ...)
  2011-10-17  6:15 ` [PATCH 4/5] arm/imx: explicitly includes mach/hardware.h in pm-imx27.c Shawn Guo
@ 2011-10-17  6:15 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2011-10-17  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

When indirect inclusion to <mach/hardware.h> via <mach/gpio.h> gets
removed, we will see the following compile error.

  CC      drivers/mmc/host/mxcmmc.o
drivers/mmc/host/mxcmmc.c: In function ?mxcmci_init_card?:
drivers/mmc/host/mxcmmc.c:811:2: error: implicit declaration of function ?cpu_is_mx3?

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/mmc/host/mxcmmc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 14aa213..6632e38 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -40,6 +40,7 @@
 #include <mach/mmc.h>
 
 #include <mach/dma.h>
+#include <mach/hardware.h>
 
 #define DRIVER_NAME "mxc-mmc"
 
-- 
1.7.4.1

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

end of thread, other threads:[~2011-10-17  6:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17  6:15 [PATCH 0/5] Fix indirect inclusion to <mach/hardware.h> Shawn Guo
2011-10-17  6:15 ` [PATCH 1/5] arm/imx: remove mx31_setup_weimcs() from mx31.h Shawn Guo
2011-10-17  6:15 ` [PATCH 2/5] arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c Shawn Guo
2011-10-17  6:15 ` [PATCH 3/5] arm/imx: remove mx27_setup_weimcs() from mx27.h Shawn Guo
2011-10-17  6:15 ` [PATCH 4/5] arm/imx: explicitly includes mach/hardware.h in pm-imx27.c Shawn Guo
2011-10-17  6:15 ` [PATCH 5/5] mmc: mxcmmc: explicitly includes mach/hardware.h Shawn Guo

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