All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] mach/io.h cleanup and removal
@ 2012-02-13 21:43 Rob Herring
  2012-02-13 21:43 ` [PATCH 01/15] usb: ohci-pxa27x: add explicit include of hardware.h Rob Herring
                   ` (17 more replies)
  0 siblings, 18 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

This series cleans-up mach/io.h and removes it for most platforms that have
the same definitions of __io() and __mem_pci(). This mainly leaves platforms
with PCI that need an io.h. Most of those can be converted once we have a
fixed IO space mapping. OMAP io.h also remains as moving all the extra io.h
stuff leaves it quite broken, so I'm leaving it to the OMAP folks to convert.

I've compiled all defconfigs and I think I've fixed all the new breakage.
There's still a few platforms broken in rc3.

These are the remaining mach/io.h files:

arch/arm/mach-dove/include/mach/io.h
arch/arm/mach-ebsa110/include/mach/io.h
arch/arm/mach-footbridge/include/mach/io.h
arch/arm/mach-integrator/include/mach/io.h
arch/arm/mach-iop13xx/include/mach/io.h
arch/arm/mach-iop32x/include/mach/io.h
arch/arm/mach-iop33x/include/mach/io.h
arch/arm/mach-ixp2000/include/mach/io.h
arch/arm/mach-ixp23xx/include/mach/io.h
arch/arm/mach-ixp4xx/include/mach/io.h
arch/arm/mach-kirkwood/include/mach/io.h
arch/arm/mach-mv78xx0/include/mach/io.h
arch/arm/mach-omap1/include/mach/io.h
arch/arm/mach-omap2/include/mach/io.h
arch/arm/mach-rpc/include/mach/io.h
arch/arm/mach-s3c2410/include/mach/io.h
arch/arm/mach-shark/include/mach/io.h
arch/arm/mach-tegra/include/mach/io.h
arch/arm/mach-vt8500/include/mach/io.h
arch/arm/plat-omap/include/plat/io.h

Rob

Rob Herring (15):
  usb: ohci-pxa27x: add explicit include of hardware.h
  ARM: add explicit include of system.h to processor.h
  ARM: provide runtime hook for ioremap
  ARM: imx: convert to common runtime ioremap hook
  ARM: msm: use runtime ioremap hook
  ARM: msm: clean-up mach/io.h
  ARM: at91: clean-up mach/io.h
  ARM: davinci: remove unneeded mach/io.h include
  ARM: orion5x: clean-up mach/io.h
  ARM: tegra: clean-up mach/io.h
  ARM: ep93xx: clean-up mach/io.h
  ARM: clps711x: remove unneeded include of mach/io.h
  ARM: make mach/io.h include optional
  ARM: remove bunch of now unused mach/io.h files
  ARM: kill off __mem_pci

 arch/arm/Kconfig                                  |   21 ++++++++
 arch/arm/include/asm/io.h                         |   54 ++++++++++-----------
 arch/arm/include/asm/processor.h                  |    1 +
 arch/arm/mach-at91/at91cap9.c                     |    1 +
 arch/arm/mach-at91/at91cap9_devices.c             |    1 +
 arch/arm/mach-at91/at91rm9200.c                   |    1 +
 arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
 arch/arm/mach-at91/at91rm9200_time.c              |    1 +
 arch/arm/mach-at91/at91sam9260.c                  |    1 +
 arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9261.c                  |    1 +
 arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9263.c                  |    1 +
 arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9g45.c                  |    1 +
 arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9rl.c                   |    1 +
 arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
 arch/arm/mach-at91/at91x40.c                      |    1 +
 arch/arm/mach-at91/at91x40_time.c                 |    1 +
 arch/arm/mach-at91/board-cap9adk.c                |    1 +
 arch/arm/mach-at91/board-cpu9krea.c               |    1 +
 arch/arm/mach-at91/board-eco920.c                 |    1 +
 arch/arm/mach-at91/board-yl-9200.c                |    1 +
 arch/arm/mach-at91/clock.c                        |    1 +
 arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++
 arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
 arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
 arch/arm/mach-at91/include/mach/io.h              |   49 -------------------
 arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
 arch/arm/mach-at91/pm.c                           |    1 +
 arch/arm/mach-at91/pm.h                           |    2 +
 arch/arm/mach-at91/setup.c                        |    1 +
 arch/arm/mach-bcmring/include/mach/io.h           |   33 -------------
 arch/arm/mach-clps711x/include/mach/io.h          |   36 --------------
 arch/arm/mach-clps711x/include/mach/uncompress.h  |    1 -
 arch/arm/mach-cns3xxx/include/mach/io.h           |   17 -------
 arch/arm/mach-davinci/include/mach/entry-macro.S  |    1 -
 arch/arm/mach-davinci/include/mach/io.h           |   24 ---------
 arch/arm/mach-dove/include/mach/io.h              |    1 -
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h   |    6 ++
 arch/arm/mach-ep93xx/include/mach/io.h            |   22 --------
 arch/arm/mach-exynos/include/mach/io.h            |   26 ----------
 arch/arm/mach-footbridge/include/mach/io.h        |   13 -----
 arch/arm/mach-gemini/include/mach/io.h            |   18 -------
 arch/arm/mach-h720x/include/mach/io.h             |   22 --------
 arch/arm/mach-highbank/include/mach/io.h          |    7 ---
 arch/arm/mach-imx/mm-imx3.c                       |    4 +-
 arch/arm/mach-integrator/include/mach/io.h        |    1 -
 arch/arm/mach-iop13xx/include/mach/io.h           |    2 -
 arch/arm/mach-iop32x/include/mach/io.h            |    1 -
 arch/arm/mach-iop33x/include/mach/io.h            |    1 -
 arch/arm/mach-ixp2000/include/mach/io.h           |    1 -
 arch/arm/mach-ixp23xx/include/mach/io.h           |    1 -
 arch/arm/mach-ixp4xx/include/mach/io.h            |    6 +--
 arch/arm/mach-kirkwood/include/mach/io.h          |    2 -
 arch/arm/mach-ks8695/include/mach/io.h            |   19 -------
 arch/arm/mach-lpc32xx/include/mach/io.h           |   27 ----------
 arch/arm/mach-mmp/include/mach/io.h               |   21 --------
 arch/arm/mach-msm/board-halibut.c                 |    6 ++
 arch/arm/mach-msm/board-trout.c                   |    6 ++
 arch/arm/mach-msm/include/mach/io.h               |   36 --------------
 arch/arm/mach-msm/include/mach/msm_iomap-7x00.h   |    6 ++
 arch/arm/mach-msm/include/mach/msm_iomap-7x30.h   |    4 ++
 arch/arm/mach-msm/include/mach/msm_iomap-8960.h   |    4 ++
 arch/arm/mach-msm/include/mach/msm_iomap-8x50.h   |    4 ++
 arch/arm/mach-msm/include/mach/msm_iomap-8x60.h   |    4 ++
 arch/arm/mach-msm/io.c                            |    1 -
 arch/arm/mach-mv78xx0/include/mach/io.h           |    2 -
 arch/arm/mach-mxs/include/mach/io.h               |   22 --------
 arch/arm/mach-netx/include/mach/io.h              |   28 -----------
 arch/arm/mach-nomadik/include/mach/io.h           |   22 --------
 arch/arm/mach-orion5x/common.h                    |    9 ++++
 arch/arm/mach-orion5x/include/mach/io.h           |   33 -------------
 arch/arm/mach-orion5x/pci.c                       |    1 +
 arch/arm/mach-orion5x/tsx09-common.c              |    1 +
 arch/arm/mach-picoxcell/include/mach/io.h         |   22 --------
 arch/arm/mach-pnx4008/include/mach/io.h           |   21 --------
 arch/arm/mach-prima2/include/mach/io.h            |   16 ------
 arch/arm/mach-pxa/include/mach/io.h               |   20 --------
 arch/arm/mach-realview/include/mach/io.h          |   28 -----------
 arch/arm/mach-rpc/include/mach/io.h               |    5 --
 arch/arm/mach-s3c2410/include/mach/io.h           |    5 --
 arch/arm/mach-s3c64xx/include/mach/io.h           |   18 -------
 arch/arm/mach-s5p64x0/include/mach/io.h           |   25 ----------
 arch/arm/mach-s5pc100/include/mach/io.h           |   18 -------
 arch/arm/mach-s5pv210/include/mach/io.h           |   26 ----------
 arch/arm/mach-sa1100/include/mach/io.h            |   20 --------
 arch/arm/mach-shark/include/mach/io.h             |    2 -
 arch/arm/mach-shmobile/include/mach/io.h          |    9 ----
 arch/arm/mach-spear3xx/include/mach/io.h          |   19 -------
 arch/arm/mach-spear6xx/include/mach/io.h          |   20 --------
 arch/arm/mach-tegra/include/mach/io.h             |   49 -------------------
 arch/arm/mach-tegra/include/mach/iomap.h          |   48 ++++++++++++++++++
 arch/arm/mach-tegra/io.c                          |    1 +
 arch/arm/mach-u300/include/mach/io.h              |   20 --------
 arch/arm/mach-ux500/include/mach/io.h             |   22 --------
 arch/arm/mach-versatile/include/mach/io.h         |   28 -----------
 arch/arm/mach-vexpress/include/mach/io.h          |   26 ----------
 arch/arm/mach-vt8500/include/mach/io.h            |    1 -
 arch/arm/mach-w90x900/include/mach/io.h           |   30 -----------
 arch/arm/mach-zynq/include/mach/io.h              |   33 -------------
 arch/arm/mm/ioremap.c                             |    3 +
 arch/arm/plat-mxc/include/mach/hardware.h         |    3 +
 arch/arm/plat-mxc/include/mach/io.h               |   39 ---------------
 arch/arm/plat-spear/include/plat/io.h             |   22 --------
 drivers/pcmcia/at91_cf.c                          |    1 +
 drivers/rtc/rtc-at91sam9.c                        |    2 +-
 drivers/usb/gadget/at91_udc.c                     |    1 +
 drivers/usb/host/ohci-pxa27x.c                    |    1 +
 drivers/watchdog/at91rm9200_wdt.c                 |    1 +
 drivers/watchdog/at91sam9_wdt.c                   |    1 +
 112 files changed, 237 insertions(+), 1071 deletions(-)
 create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
 delete mode 100644 arch/arm/mach-at91/include/mach/io.h
 delete mode 100644 arch/arm/mach-bcmring/include/mach/io.h
 delete mode 100644 arch/arm/mach-clps711x/include/mach/io.h
 delete mode 100644 arch/arm/mach-cns3xxx/include/mach/io.h
 delete mode 100644 arch/arm/mach-davinci/include/mach/io.h
 delete mode 100644 arch/arm/mach-ep93xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-exynos/include/mach/io.h
 delete mode 100644 arch/arm/mach-gemini/include/mach/io.h
 delete mode 100644 arch/arm/mach-h720x/include/mach/io.h
 delete mode 100644 arch/arm/mach-highbank/include/mach/io.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/io.h
 delete mode 100644 arch/arm/mach-lpc32xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-mmp/include/mach/io.h
 delete mode 100644 arch/arm/mach-msm/include/mach/io.h
 delete mode 100644 arch/arm/mach-mxs/include/mach/io.h
 delete mode 100644 arch/arm/mach-netx/include/mach/io.h
 delete mode 100644 arch/arm/mach-nomadik/include/mach/io.h
 delete mode 100644 arch/arm/mach-orion5x/include/mach/io.h
 delete mode 100644 arch/arm/mach-picoxcell/include/mach/io.h
 delete mode 100644 arch/arm/mach-pnx4008/include/mach/io.h
 delete mode 100644 arch/arm/mach-prima2/include/mach/io.h
 delete mode 100644 arch/arm/mach-pxa/include/mach/io.h
 delete mode 100644 arch/arm/mach-realview/include/mach/io.h
 delete mode 100644 arch/arm/mach-s3c64xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-s5p64x0/include/mach/io.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/io.h
 delete mode 100644 arch/arm/mach-s5pv210/include/mach/io.h
 delete mode 100644 arch/arm/mach-sa1100/include/mach/io.h
 delete mode 100644 arch/arm/mach-shmobile/include/mach/io.h
 delete mode 100644 arch/arm/mach-spear3xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-spear6xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-u300/include/mach/io.h
 delete mode 100644 arch/arm/mach-ux500/include/mach/io.h
 delete mode 100644 arch/arm/mach-versatile/include/mach/io.h
 delete mode 100644 arch/arm/mach-vexpress/include/mach/io.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/io.h
 delete mode 100644 arch/arm/mach-zynq/include/mach/io.h
 delete mode 100644 arch/arm/plat-mxc/include/mach/io.h
 delete mode 100644 arch/arm/plat-spear/include/plat/io.h

-- 
1.7.5.4

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

* [PATCH 01/15] usb: ohci-pxa27x: add explicit include of hardware.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:43 ` [PATCH 02/15] ARM: add explicit include of system.h to processor.h Rob Herring
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

ohci-pxa27x needs cpu_is_pxa3xx macro.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 drivers/usb/host/ohci-pxa27x.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 6313e44..4db399c 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -23,6 +23,7 @@
 #include <linux/signal.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <mach/hardware.h>
 #include <mach/ohci.h>
 #include <mach/pxa3xx-u2d.h>
 
-- 
1.7.5.4

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

* [PATCH 02/15] ARM: add explicit include of system.h to processor.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
  2012-02-13 21:43 ` [PATCH 01/15] usb: ohci-pxa27x: add explicit include of hardware.h Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 22:14   ` H Hartley Sweeten
  2012-02-13 21:43 ` [PATCH 03/15] ARM: provide runtime hook for ioremap Rob Herring
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

cpu_relax in processor.h needs smp_mb which is defined in system.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/include/asm/processor.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index ce280b8..cb8d638 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -22,6 +22,7 @@
 #include <asm/hw_breakpoint.h>
 #include <asm/ptrace.h>
 #include <asm/types.h>
+#include <asm/system.h>
 
 #ifdef __KERNEL__
 #define STACK_TOP	((current->personality & ADDR_LIMIT_32BIT) ? \
-- 
1.7.5.4

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

* [PATCH 03/15] ARM: provide runtime hook for ioremap
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
  2012-02-13 21:43 ` [PATCH 01/15] usb: ohci-pxa27x: add explicit include of hardware.h Rob Herring
  2012-02-13 21:43 ` [PATCH 02/15] ARM: add explicit include of system.h to processor.h Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 22:13   ` H Hartley Sweeten
  2012-02-13 22:30   ` Russell King - ARM Linux
  2012-02-13 21:43 ` [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook Rob Herring
                   ` (14 subsequent siblings)
  17 siblings, 2 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

We have compile time over-ride of ioremap, but an run-time override is
needed for multi-platform builds.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/include/asm/io.h |    5 ++++-
 arch/arm/mm/ioremap.c     |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 9275828..f5c6968 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -264,8 +264,11 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
  * Documentation/io-mapping.txt.
  *
  */
+
+extern void __iomem * (*arch_ioremap)(unsigned long, size_t, unsigned int);
+
 #ifndef __arch_ioremap
-#define __arch_ioremap			__arm_ioremap
+#define __arch_ioremap			arch_ioremap
 #define __arch_iounmap			__iounmap
 #endif
 
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 80632e8..f551c13 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -314,6 +314,9 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
 }
 EXPORT_SYMBOL(__arm_ioremap);
 
+void __iomem * (*arch_ioremap)(unsigned long , size_t , unsigned int ) = __arm_ioremap;
+EXPORT_SYMBOL(arch_ioremap);
+
 /*
  * Remap an arbitrary physical address space into the kernel virtual
  * address space as memory. Needed when the kernel wants to execute
-- 
1.7.5.4

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

* [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (2 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 03/15] ARM: provide runtime hook for ioremap Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-16  0:17   ` Shawn Guo
  2012-02-13 21:43 ` [PATCH 05/15] ARM: msm: use " Rob Herring
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Convert i.MX platforms to use the common run-time ioremap hook instead of
the imx specific hook.

Also, move addr_in_module out of io.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-imx/mm-imx3.c               |    4 ++--
 arch/arm/plat-mxc/include/mach/hardware.h |    3 +++
 arch/arm/plat-mxc/include/mach/io.h       |   17 -----------------
 3 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 31807d2..b33f736 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -135,7 +135,7 @@ void __init imx31_init_early(void)
 	mxc_set_cpu_type(MXC_CPU_MX31);
 	mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
 	pm_idle = imx3_idle;
-	imx_ioremap = imx3_ioremap;
+	arch_ioremap = imx3_ioremap;
 }
 
 void __init mx31_init_irq(void)
@@ -198,7 +198,7 @@ void __init imx35_init_early(void)
 	mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
 	mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
 	pm_idle = imx3_idle;
-	imx_ioremap = imx3_ioremap;
+	arch_ioremap = imx3_ioremap;
 }
 
 void __init mx35_init_irq(void)
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index a599f01..ca06a68 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -28,6 +28,9 @@
 #define IOMEM(addr)	((void __force __iomem *)(addr))
 #endif
 
+#define addr_in_module(addr, mod) \
+	((unsigned long)(addr) - mod ## _BASE_ADDR < mod ## _SIZE)
+
 #define IMX_IO_P2V_MODULE(addr, module)					\
 	(((addr) - module ## _BASE_ADDR) < module ## _SIZE ?		\
 	 (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0)
diff --git a/arch/arm/plat-mxc/include/mach/io.h b/arch/arm/plat-mxc/include/mach/io.h
index 338300b..ea9d95e 100644
--- a/arch/arm/plat-mxc/include/mach/io.h
+++ b/arch/arm/plat-mxc/include/mach/io.h
@@ -14,23 +14,6 @@
 /* Allow IO space to be anywhere in the memory */
 #define IO_SPACE_LIMIT 0xffffffff
 
-#define __arch_ioremap __imx_ioremap
-#define __arch_iounmap __iounmap
-
-#define addr_in_module(addr, mod) \
-	((unsigned long)(addr) - mod ## _BASE_ADDR < mod ## _SIZE)
-
-extern void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int);
-
-static inline void __iomem *
-__imx_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
-{
-	if (imx_ioremap != NULL)
-		return imx_ioremap(phys_addr, size, mtype);
-	else
-		return __arm_ioremap(phys_addr, size, mtype);
-}
-
 /* io address mapping macro */
 #define __io(a)		__typesafe_io(a)
 
-- 
1.7.5.4

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

* [PATCH 05/15] ARM: msm: use runtime ioremap hook
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (3 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 23:05   ` David Brown
  2012-02-13 21:43 ` [PATCH 06/15] ARM: msm: clean-up mach/io.h Rob Herring
                   ` (12 subsequent siblings)
  17 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Convert msm platforms to use run-time ioremap hook instead of the compile
time hook.

According to David Brown, only the msm7201 needed the ioremap hook.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-msm/board-halibut.c               |    6 ++++++
 arch/arm/mach-msm/board-trout.c                 |    6 ++++++
 arch/arm/mach-msm/include/mach/io.h             |    5 -----
 arch/arm/mach-msm/include/mach/msm_iomap-7x00.h |    6 ++++++
 arch/arm/mach-msm/io.c                          |    1 -
 5 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
index a60ab6d..b6cff3a 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -68,6 +68,11 @@ static struct platform_device *devices[] __initdata = {
 
 extern struct sys_timer msm_timer;
 
+static void __init halibut_init_early(void)
+{
+	arch_ioremap = __msm_ioremap;
+}
+
 static void __init halibut_init_irq(void)
 {
 	msm_init_irq();
@@ -96,6 +101,7 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
 	.atag_offset	= 0x100,
 	.fixup		= halibut_fixup,
 	.map_io		= halibut_map_io,
+	.init_early	= halibut_init_early,
 	.init_irq	= halibut_init_irq,
 	.init_machine	= halibut_init,
 	.timer		= &msm_timer,
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index 6b9b227..509d94c 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -43,6 +43,11 @@ static struct platform_device *devices[] __initdata = {
 
 extern struct sys_timer msm_timer;
 
+static void __init trout_init_early(void)
+{
+	arch_ioremap = __msm_ioremap;
+}
+
 static void __init trout_init_irq(void)
 {
 	msm_init_irq();
@@ -96,6 +101,7 @@ MACHINE_START(TROUT, "HTC Dream")
 	.atag_offset	= 0x100,
 	.fixup		= trout_fixup,
 	.map_io		= trout_map_io,
+	.init_early	= trout_init_early,
 	.init_irq	= trout_init_irq,
 	.init_machine	= trout_init,
 	.timer		= &msm_timer,
diff --git a/arch/arm/mach-msm/include/mach/io.h b/arch/arm/mach-msm/include/mach/io.h
index dc1b928..c6ff9bb 100644
--- a/arch/arm/mach-msm/include/mach/io.h
+++ b/arch/arm/mach-msm/include/mach/io.h
@@ -18,11 +18,6 @@
 
 #define IO_SPACE_LIMIT 0xffffffff
 
-#define __arch_ioremap __msm_ioremap
-#define __arch_iounmap __iounmap
-
-void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype);
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)    (a)
 
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
index 8af4612..c355886 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
@@ -111,5 +111,11 @@
 #define MSM_AD5_PHYS          0xAC000000
 #define MSM_AD5_SIZE          (SZ_1M*13)
 
+#ifndef __ASSEMBLY__
+
+extern void __iomem *
+__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype);
+
+#endif
 
 #endif
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 578b04e..283cdff 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -187,4 +187,3 @@ __msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
 	return __arm_ioremap_caller(phys_addr, size, mtype,
 		__builtin_return_address(0));
 }
-EXPORT_SYMBOL(__msm_ioremap);
-- 
1.7.5.4

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

* [PATCH 06/15] ARM: msm: clean-up mach/io.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (4 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 05/15] ARM: msm: use " Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:43 ` [PATCH 07/15] ARM: at91: " Rob Herring
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Move msm specifics in mach/io.h to respective msm_iomap-*.h headers.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-msm/include/mach/io.h             |    7 -------
 arch/arm/mach-msm/include/mach/msm_iomap-7x30.h |    4 ++++
 arch/arm/mach-msm/include/mach/msm_iomap-8960.h |    4 ++++
 arch/arm/mach-msm/include/mach/msm_iomap-8x50.h |    4 ++++
 arch/arm/mach-msm/include/mach/msm_iomap-8x60.h |    4 ++++
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-msm/include/mach/io.h b/arch/arm/mach-msm/include/mach/io.h
index c6ff9bb..1071f98 100644
--- a/arch/arm/mach-msm/include/mach/io.h
+++ b/arch/arm/mach-msm/include/mach/io.h
@@ -21,11 +21,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)    (a)
 
-void msm_map_qsd8x50_io(void);
-void msm_map_msm7x30_io(void);
-void msm_map_msm8x60_io(void);
-void msm_map_msm8960_io(void);
-
-extern unsigned int msm_shared_ram_phys;
-
 #endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
index 198202c..f944fe6 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
@@ -100,4 +100,8 @@
 #define MSM_HSUSB_PHYS        0xA3600000
 #define MSM_HSUSB_SIZE        SZ_1K
 
+#ifndef __ASSEMBLY__
+extern void msm_map_msm7x30_io(void);
+#endif
+
 #endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
index 800b557..a1752c0 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
@@ -50,4 +50,8 @@
 #define MSM_DEBUG_UART_PHYS	0x16440000
 #endif
 
+#ifndef __ASSEMBLY__
+extern void msm_map_msm8960_io(void);
+#endif
+
 #endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
index 0faa894..da77cc1 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
@@ -122,4 +122,8 @@
 #define MSM_SDC4_PHYS          0xA0600000
 #define MSM_SDC4_SIZE          SZ_4K
 
+#ifndef __ASSEMBLY__
+extern void msm_map_qsd8x50_io(void);
+#endif
+
 #endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
index 54e12ca..5aed57d 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
@@ -67,4 +67,8 @@
 #define MSM_DEBUG_UART_PHYS	0x19C40000
 #endif
 
+#ifndef __ASSEMBLY__
+extern void msm_map_msm8x60_io(void);
+#endif
+
 #endif
-- 
1.7.5.4

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (5 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 06/15] ARM: msm: clean-up mach/io.h Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-14  9:21   ` Nicolas Ferre
  2012-02-13 21:43 ` [PATCH 08/15] ARM: davinci: remove unneeded mach/io.h include Rob Herring
                   ` (10 subsequent siblings)
  17 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Move most of io.h into at91_io.h and update includes.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-at91/at91cap9.c                     |    1 +
 arch/arm/mach-at91/at91cap9_devices.c             |    1 +
 arch/arm/mach-at91/at91rm9200.c                   |    1 +
 arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
 arch/arm/mach-at91/at91rm9200_time.c              |    1 +
 arch/arm/mach-at91/at91sam9260.c                  |    1 +
 arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9261.c                  |    1 +
 arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9263.c                  |    1 +
 arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9g45.c                  |    1 +
 arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
 arch/arm/mach-at91/at91sam9rl.c                   |    1 +
 arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
 arch/arm/mach-at91/at91x40.c                      |    1 +
 arch/arm/mach-at91/at91x40_time.c                 |    1 +
 arch/arm/mach-at91/board-cap9adk.c                |    1 +
 arch/arm/mach-at91/board-cpu9krea.c               |    1 +
 arch/arm/mach-at91/board-eco920.c                 |    1 +
 arch/arm/mach-at91/board-yl-9200.c                |    1 +
 arch/arm/mach-at91/clock.c                        |    1 +
 arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
 arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
 arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
 arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
 arch/arm/mach-at91/pm.c                           |    1 +
 arch/arm/mach-at91/pm.h                           |    2 +
 arch/arm/mach-at91/setup.c                        |    1 +
 drivers/pcmcia/at91_cf.c                          |    1 +
 drivers/rtc/rtc-at91sam9.c                        |    2 +-
 drivers/usb/gadget/at91_udc.c                     |    1 +
 drivers/watchdog/at91rm9200_wdt.c                 |    1 +
 drivers/watchdog/at91sam9_wdt.c                   |    1 +
 34 files changed, 80 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h

diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index a42edc2..1fc7082 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -21,6 +21,7 @@
 #include <mach/cpu.h>
 #include <mach/at91cap9.h>
 #include <mach/at91_pmc.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index d298fb7..f2edf2d 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -27,6 +27,7 @@
 #include <mach/at91cap9.h>
 #include <mach/at91cap9_matrix.h>
 #include <mach/at91sam9_smc.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 99c3174..e8a4d50 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -19,6 +19,7 @@
 #include <mach/at91_pmc.h>
 #include <mach/at91_st.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 18bacec..1566d68 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -21,6 +21,7 @@
 #include <mach/board.h>
 #include <mach/at91rm9200.h>
 #include <mach/at91rm9200_mc.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index a028cdf..45bddca 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -27,6 +27,7 @@
 #include <asm/mach/time.h>
 
 #include <mach/at91_st.h>
+#include <mach/at91_io.h>
 
 static unsigned long last_crtr;
 static u32 irqmask;
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index d4036ba..5aa78fa 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -20,6 +20,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 642ccb6..94fdf96 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -22,6 +22,7 @@
 #include <mach/at91sam9260.h>
 #include <mach/at91sam9260_matrix.h>
 #include <mach/at91sam9_smc.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 023c2ff..3b4aec7 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -19,6 +19,7 @@
 #include <mach/at91sam9261.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index fc59cbd..bbd04c2 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -25,6 +25,7 @@
 #include <mach/at91sam9261.h>
 #include <mach/at91sam9261_matrix.h>
 #include <mach/at91sam9_smc.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 75e876c..2e1a428 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -18,6 +18,7 @@
 #include <mach/at91sam9263.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 7b46b27..1e5e88d 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -24,6 +24,7 @@
 #include <mach/at91sam9263.h>
 #include <mach/at91sam9263_matrix.h>
 #include <mach/at91sam9_smc.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 1cb6a96..2f2e061 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -19,6 +19,7 @@
 #include <mach/at91sam9g45.h>
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index b7582dd..9e0de74 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -27,6 +27,7 @@
 #include <mach/at91sam9_smc.h>
 #include <mach/at_hdmac.h>
 #include <mach/atmel-mci.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index d2c91a8..c284d98 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -19,6 +19,7 @@
 #include <mach/at91sam9rl.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 61908dc..3311106 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -22,6 +22,7 @@
 #include <mach/at91sam9rl_matrix.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at_hdmac.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index 56ba3bd..838103e 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -17,6 +17,7 @@
 #include <mach/at91x40.h>
 #include <mach/at91_st.h>
 #include <mach/timex.h>
+#include <mach/at91_io.h>
 #include "generic.h"
 
 /*
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index dfff289..152cc7a 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -27,6 +27,7 @@
 #include <mach/hardware.h>
 #include <asm/mach/time.h>
 #include <mach/at91_tc.h>
+#include <mach/at91_io.h>
 
 /*
  *	3 counter/timer units present.
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index ac3de4f..b31791a 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -44,6 +44,7 @@
 #include <mach/board.h>
 #include <mach/at91cap9_matrix.h>
 #include <mach/at91sam9_smc.h>
+#include <mach/at91_io.h>
 #include <mach/system_rev.h>
 
 #include "sam9_smc.h"
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index 9ab3d1e..619d1d0 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -43,6 +43,7 @@
 #include <mach/board.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91sam9260_matrix.h>
+#include <mach/at91_io.h>
 
 #include "sam9_smc.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 07ef35b..f56bf24 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -27,6 +27,7 @@
 #include <mach/board.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index bbd553e..bf889e5 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -46,6 +46,7 @@
 #include <mach/board.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 61873f3..0e8b318 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -27,6 +27,7 @@
 #include <mach/hardware.h>
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "clock.h"
 #include "generic.h"
diff --git a/arch/arm/mach-at91/include/mach/at91_io.h b/arch/arm/mach-at91/include/mach/at91_io.h
new file mode 100644
index 0000000..82e66de
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at91_io.h
@@ -0,0 +1,44 @@
+/*
+ * arch/arm/mach-at91/include/mach/io.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#include <mach/hardware.h>
+
+#ifndef __ASSEMBLY__
+
+static inline unsigned int at91_sys_read(unsigned int reg_offset)
+{
+	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
+
+	return __raw_readl(addr + reg_offset);
+}
+
+static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
+{
+	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
+
+	__raw_writel(value, addr + reg_offset);
+}
+
+#endif
+
+#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
index e2f8da8..0427212 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
@@ -12,6 +12,8 @@
 #ifndef AT91SAM9_DDRSDR_H
 #define AT91SAM9_DDRSDR_H
 
+#include <mach/at91_io.h>
+
 #define AT91_DDRSDRC_MR		0x00	/* Mode Register */
 #define		AT91_DDRSDRC_MODE	(0x7 << 0)		/* Command Mode */
 #define			AT91_DDRSDRC_MODE_NORMAL	0
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
index 100f5a5..4a3b2ec 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
@@ -16,6 +16,8 @@
 #ifndef AT91SAM9_SDRAMC_H
 #define AT91SAM9_SDRAMC_H
 
+#include <mach/at91_io.h>
+
 /* SDRAM Controller (SDRAMC) registers */
 #define AT91_SDRAMC_MR		0x00	/* SDRAM Controller Mode Register */
 #define		AT91_SDRAMC_MODE	(0xf << 0)		/* Command Mode */
diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 0234fd9..96dd8e1 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -23,6 +23,7 @@
 
 #include <linux/io.h>
 #include <linux/atmel_serial.h>
+#include <mach/at91_io.h>
 
 #if defined(CONFIG_AT91_EARLY_DBGU0)
 #define UART_OFFSET AT91_BASE_DBGU0
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 1606379..f099c3e 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -27,6 +27,7 @@
 
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 #include "pm.h"
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 7eb40d2..ac12592 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -1,3 +1,5 @@
+#include <mach/at91_io.h>
+
 #ifdef CONFIG_ARCH_AT91RM9200
 #include <mach/at91rm9200_mc.h>
 
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 69d3fc4..cee8156 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -17,6 +17,7 @@
 #include <mach/at91_dbgu.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_shdwc.h>
+#include <mach/at91_io.h>
 
 #include "soc.h"
 #include "generic.h"
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 4902206..3edf52b 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -26,6 +26,7 @@
 
 #include <mach/board.h>
 #include <mach/at91rm9200_mc.h>
+#include <mach/at91_io.h>
 
 
 /*
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index a3ad957..d044f55 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -23,7 +23,7 @@
 #include <mach/board.h>
 #include <mach/at91_rtt.h>
 #include <mach/cpu.h>
-
+#include <mach/at91_io.h>
 
 /*
  * This driver uses two configurable hardware resources that live in the
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 143a725..e9da936 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -41,6 +41,7 @@
 #include <mach/board.h>
 #include <mach/cpu.h>
 #include <mach/at91sam9261_matrix.h>
+#include <mach/at91_io.h>
 
 #include "at91_udc.h"
 
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c
index b3046dc..4073312 100644
--- a/drivers/watchdog/at91rm9200_wdt.c
+++ b/drivers/watchdog/at91rm9200_wdt.c
@@ -22,6 +22,7 @@
 #include <linux/types.h>
 #include <linux/watchdog.h>
 #include <linux/uaccess.h>
+#include <mach/at91_io.h>
 #include <mach/at91_st.h>
 
 #define WDT_DEFAULT_TIME	5	/* seconds */
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 0056256..d4c0576 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -31,6 +31,7 @@
 #include <linux/bitops.h>
 #include <linux/uaccess.h>
 
+#include <mach/at91_io.h>
 #include "at91sam9_wdt.h"
 
 #define DRV_NAME "AT91SAM9 Watchdog"
-- 
1.7.5.4

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

* [PATCH 08/15] ARM: davinci: remove unneeded mach/io.h include
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (6 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 07/15] ARM: at91: " Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:43 ` [PATCH 09/15] ARM: orion5x: clean-up mach/io.h Rob Herring
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

entry-macro.S doesn't actually need mach/io.h, so remove it.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-davinci/include/mach/entry-macro.S |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-davinci/include/mach/entry-macro.S b/arch/arm/mach-davinci/include/mach/entry-macro.S
index e14c0dc..f6e1d33 100644
--- a/arch/arm/mach-davinci/include/mach/entry-macro.S
+++ b/arch/arm/mach-davinci/include/mach/entry-macro.S
@@ -8,7 +8,6 @@
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
  */
-#include <mach/io.h>
 #include <mach/irqs.h>
 
 		.macro	disable_fiq
-- 
1.7.5.4

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

* [PATCH 09/15] ARM: orion5x: clean-up mach/io.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (7 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 08/15] ARM: davinci: remove unneeded mach/io.h include Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:43 ` [PATCH 10/15] ARM: tegra: " Rob Herring
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Move orion5x specific mach/io.h parts into common.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-orion5x/common.h          |    9 +++++++++
 arch/arm/mach-orion5x/include/mach/io.h |   12 ------------
 arch/arm/mach-orion5x/pci.c             |    1 +
 arch/arm/mach-orion5x/tsx09-common.c    |    1 +
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index d2513ac..2e6454c 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -57,5 +57,14 @@ struct meminfo;
 struct tag;
 extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
 
+/*****************************************************************************
+ * Helpers to access Orion registers
+ ****************************************************************************/
+/*
+ * These are not preempt-safe.  Locks, if needed, must be taken
+ * care of by the caller.
+ */
+#define orion5x_setbits(r, mask)	writel(readl(r) | (mask), (r))
+#define orion5x_clrbits(r, mask)	writel(readl(r) & ~(mask), (r))
 
 #endif
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h
index e9d9afd..444136d 100644
--- a/arch/arm/mach-orion5x/include/mach/io.h
+++ b/arch/arm/mach-orion5x/include/mach/io.h
@@ -18,16 +18,4 @@
 #define __io(a)			__typesafe_io(a)
 #define __mem_pci(a)		(a)
 
-
-/*****************************************************************************
- * Helpers to access Orion registers
- ****************************************************************************/
-/*
- * These are not preempt-safe.  Locks, if needed, must be taken
- * care of by the caller.
- */
-#define orion5x_setbits(r, mask)	writel(readl(r) | (mask), (r))
-#define orion5x_clrbits(r, mask)	writel(readl(r) & ~(mask), (r))
-
-
 #endif
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index 09a045f..a9d2151 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -19,6 +19,7 @@
 #include <asm/mach/pci.h>
 #include <plat/pcie.h>
 #include <plat/addr-map.h>
+#include <mach/orion5x.h>
 #include "common.h"
 
 /*****************************************************************************
diff --git a/arch/arm/mach-orion5x/tsx09-common.c b/arch/arm/mach-orion5x/tsx09-common.c
index c9abb8f..7189827 100644
--- a/arch/arm/mach-orion5x/tsx09-common.c
+++ b/arch/arm/mach-orion5x/tsx09-common.c
@@ -15,6 +15,7 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/timex.h>
 #include <linux/serial_reg.h>
+#include <mach/orion5x.h>
 #include "tsx09-common.h"
 #include "common.h"
 
-- 
1.7.5.4

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

* [PATCH 10/15] ARM: tegra: clean-up mach/io.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (8 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 09/15] ARM: orion5x: clean-up mach/io.h Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Move tegra specific mach/io.h parts into iomap.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-tegra/include/mach/io.h    |   48 ------------------------------
 arch/arm/mach-tegra/include/mach/iomap.h |   48 ++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/io.c                 |    1 +
 3 files changed, 49 insertions(+), 48 deletions(-)

diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h
index f15deff..47b4b61 100644
--- a/arch/arm/mach-tegra/include/mach/io.h
+++ b/arch/arm/mach-tegra/include/mach/io.h
@@ -23,56 +23,8 @@
 
 #define IO_SPACE_LIMIT 0xffff
 
-/* On TEGRA, many peripherals are very closely packed in
- * two 256MB io windows (that actually only use about 64KB
- * at the start of each).
- *
- * We will just map the first 1MB of each window (to minimize
- * pt entries needed) and provide a macro to transform physical
- * io addresses to an appropriate void __iomem *.
- *
- */
-
-#ifdef __ASSEMBLY__
-#define IOMEM(x)	(x)
-#else
-#define IOMEM(x)	((void __force __iomem *)(x))
-#endif
-
-#define IO_IRAM_PHYS	0x40000000
-#define IO_IRAM_VIRT	IOMEM(0xFE400000)
-#define IO_IRAM_SIZE	SZ_256K
-
-#define IO_CPU_PHYS     0x50040000
-#define IO_CPU_VIRT     IOMEM(0xFE000000)
-#define IO_CPU_SIZE	SZ_16K
-
-#define IO_PPSB_PHYS	0x60000000
-#define IO_PPSB_VIRT	IOMEM(0xFE200000)
-#define IO_PPSB_SIZE	SZ_1M
-
-#define IO_APB_PHYS	0x70000000
-#define IO_APB_VIRT	IOMEM(0xFE300000)
-#define IO_APB_SIZE	SZ_1M
-
-#define IO_TO_VIRT_BETWEEN(p, st, sz)	((p) >= (st) && (p) < ((st) + (sz)))
-#define IO_TO_VIRT_XLATE(p, pst, vst)	(((p) - (pst) + (vst)))
-
-#define IO_TO_VIRT(n) ( \
-	IO_TO_VIRT_BETWEEN((n), IO_PPSB_PHYS, IO_PPSB_SIZE) ?		\
-		IO_TO_VIRT_XLATE((n), IO_PPSB_PHYS, IO_PPSB_VIRT) :	\
-	IO_TO_VIRT_BETWEEN((n), IO_APB_PHYS, IO_APB_SIZE) ?		\
-		IO_TO_VIRT_XLATE((n), IO_APB_PHYS, IO_APB_VIRT) :	\
-	IO_TO_VIRT_BETWEEN((n), IO_CPU_PHYS, IO_CPU_SIZE) ?		\
-		IO_TO_VIRT_XLATE((n), IO_CPU_PHYS, IO_CPU_VIRT) :	\
-	IO_TO_VIRT_BETWEEN((n), IO_IRAM_PHYS, IO_IRAM_SIZE) ?		\
-		IO_TO_VIRT_XLATE((n), IO_IRAM_PHYS, IO_IRAM_VIRT) :	\
-	NULL)
-
 #ifndef __ASSEMBLER__
 
-#define IO_ADDRESS(n) (IO_TO_VIRT(n))
-
 #ifdef CONFIG_TEGRA_PCI
 extern void __iomem *tegra_pcie_io_base;
 
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 19dec3a..082b4d1 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -271,4 +271,52 @@
 # define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE
 #endif
 
+/* On TEGRA, many peripherals are very closely packed in
+ * two 256MB io windows (that actually only use about 64KB
+ *@the start of each).
+ *
+ * We will just map the first 1MB of each window (to minimize
+ * pt entries needed) and provide a macro to transform physical
+ * io addresses to an appropriate void __iomem *.
+ *
+ */
+
+#ifdef __ASSEMBLY__
+#define IOMEM(x)	(x)
+#else
+#define IOMEM(x)	((void __force __iomem *)(x))
+#endif
+
+#define IO_IRAM_PHYS	0x40000000
+#define IO_IRAM_VIRT	IOMEM(0xFE400000)
+#define IO_IRAM_SIZE	SZ_256K
+
+#define IO_CPU_PHYS     0x50040000
+#define IO_CPU_VIRT     IOMEM(0xFE000000)
+#define IO_CPU_SIZE	SZ_16K
+
+#define IO_PPSB_PHYS	0x60000000
+#define IO_PPSB_VIRT	IOMEM(0xFE200000)
+#define IO_PPSB_SIZE	SZ_1M
+
+#define IO_APB_PHYS	0x70000000
+#define IO_APB_VIRT	IOMEM(0xFE300000)
+#define IO_APB_SIZE	SZ_1M
+
+#define IO_TO_VIRT_BETWEEN(p, st, sz)	((p) >= (st) && (p) < ((st) + (sz)))
+#define IO_TO_VIRT_XLATE(p, pst, vst)	(((p) - (pst) + (vst)))
+
+#define IO_TO_VIRT(n) ( \
+	IO_TO_VIRT_BETWEEN((n), IO_PPSB_PHYS, IO_PPSB_SIZE) ?		\
+		IO_TO_VIRT_XLATE((n), IO_PPSB_PHYS, IO_PPSB_VIRT) :	\
+	IO_TO_VIRT_BETWEEN((n), IO_APB_PHYS, IO_APB_SIZE) ?		\
+		IO_TO_VIRT_XLATE((n), IO_APB_PHYS, IO_APB_VIRT) :	\
+	IO_TO_VIRT_BETWEEN((n), IO_CPU_PHYS, IO_CPU_SIZE) ?		\
+		IO_TO_VIRT_XLATE((n), IO_CPU_PHYS, IO_CPU_VIRT) :	\
+	IO_TO_VIRT_BETWEEN((n), IO_IRAM_PHYS, IO_IRAM_SIZE) ?		\
+		IO_TO_VIRT_XLATE((n), IO_IRAM_PHYS, IO_IRAM_VIRT) :	\
+	NULL)
+
+#define IO_ADDRESS(n) (IO_TO_VIRT(n))
+
 #endif
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c
index d23ee2d..58b4baf 100644
--- a/arch/arm/mach-tegra/io.c
+++ b/arch/arm/mach-tegra/io.c
@@ -26,6 +26,7 @@
 
 #include <asm/page.h>
 #include <asm/mach/map.h>
+#include <mach/iomap.h>
 
 #include "board.h"
 
-- 
1.7.5.4

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

* [PATCH 11/15] ARM: ep93xx: clean-up mach/io.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (9 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 10/15] ARM: tegra: " Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:52   ` Ryan Mallon
                     ` (2 more replies)
  2012-02-13 21:43 ` [PATCH 12/15] ARM: clps711x: remove unneeded include of mach/io.h Rob Herring
                   ` (6 subsequent siblings)
  17 siblings, 3 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Move ep93xx specifics in mach/io.h to ep93xx-regs.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index c4a7b84..8933c62 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -25,6 +25,12 @@
  *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
  */
 
+#ifdef __ASSEMBLER__
+#define IOMEM(p)                p
+#else
+#define IOMEM(p)                ((void __iomem __force *)(p))
+#endif
+
 #define EP93XX_CS0_PHYS_BASE_ASYNC	0x00000000	/* ASDO Pin = 0 */
 #define EP93XX_SDCE3_PHYS_BASE_SYNC	0x00000000	/* ASDO Pin = 1 */
 #define EP93XX_CS1_PHYS_BASE		0x10000000
-- 
1.7.5.4

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

* [PATCH 12/15] ARM: clps711x: remove unneeded include of mach/io.h
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (10 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

In preparation to remove mach/io.h, remove an unneeded include of it.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-clps711x/include/mach/uncompress.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index 7164310..35ed731 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -17,7 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <mach/io.h>
 #include <mach/hardware.h>
 #include <asm/hardware/clps7111.h>
 
-- 
1.7.5.4

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (11 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 12/15] ARM: clps711x: remove unneeded include of mach/io.h Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 22:14   ` H Hartley Sweeten
                     ` (2 more replies)
  2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
                   ` (4 subsequent siblings)
  17 siblings, 3 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.

Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
platforms don't need mach/io.h, but ebsa110 does. Most PCI platforms need
mach/io.h for now, but ks8695 doesn't which means it's broken? omap has a
lot of other stuff in its io.h, so it also needs io.h until it is cleaned
up.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/Kconfig          |   21 +++++++++++++++++++++
 arch/arm/include/asm/io.h |    5 +++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a48aecc..fce05b8 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -186,6 +186,9 @@ config GENERIC_ISA_DMA
 config FIQ
 	bool
 
+config NEED_MACH_IO_H
+	bool
+
 config ARCH_MTD_XIP
 	bool
 
@@ -265,6 +268,7 @@ config ARCH_INTEGRATOR
 	select GENERIC_CLOCKEVENTS
 	select PLAT_VERSATILE
 	select PLAT_VERSATILE_FPGA_IRQ
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for ARM's Integrator platform.
@@ -400,6 +404,7 @@ config ARCH_EBSA110
 	select ISA
 	select NO_IOPORT
 	select ARCH_USES_GETTIMEOFFSET
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  This is an evaluation board for the StrongARM processor available
@@ -426,6 +431,7 @@ config ARCH_FOOTBRIDGE
 	select FOOTBRIDGE
 	select GENERIC_CLOCKEVENTS
 	select HAVE_IDE
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for systems based on the DC21285 companion chip
@@ -478,6 +484,7 @@ config ARCH_IOP13XX
 	select PCI
 	select ARCH_SUPPORTS_MSI
 	select VMSPLIT_1G
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for Intel's IOP13XX (XScale) family of processors.
@@ -486,6 +493,7 @@ config ARCH_IOP32X
 	bool "IOP32x-based"
 	depends on MMU
 	select CPU_XSCALE
+	select NEED_MACH_IO_H
 	select PLAT_IOP
 	select PCI
 	select ARCH_REQUIRE_GPIOLIB
@@ -497,6 +505,7 @@ config ARCH_IOP33X
 	bool "IOP33x-based"
 	depends on MMU
 	select CPU_XSCALE
+	select NEED_MACH_IO_H
 	select PLAT_IOP
 	select PCI
 	select ARCH_REQUIRE_GPIOLIB
@@ -509,6 +518,7 @@ config ARCH_IXP23XX
 	select CPU_XSC3
  	select PCI
 	select ARCH_USES_GETTIMEOFFSET
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for Intel's IXP23xx (XScale) family of processors.
@@ -519,6 +529,7 @@ config ARCH_IXP2000
 	select CPU_XSCALE
 	select PCI
 	select ARCH_USES_GETTIMEOFFSET
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for Intel's IXP2400/2800 (XScale) family of processors.
@@ -532,6 +543,7 @@ config ARCH_IXP4XX
 	select GENERIC_CLOCKEVENTS
 	select HAVE_SCHED_CLOCK
 	select MIGHT_HAVE_PCI
+	select NEED_MACH_IO_H
 	select DMABOUNCE if PCI
 	help
 	  Support for Intel's IXP4XX (XScale) family of processors.
@@ -542,6 +554,7 @@ config ARCH_DOVE
 	select PCI
 	select ARCH_REQUIRE_GPIOLIB
 	select GENERIC_CLOCKEVENTS
+	select NEED_MACH_IO_H
 	select PLAT_ORION
 	help
 	  Support for the Marvell Dove SoC 88AP510
@@ -552,6 +565,7 @@ config ARCH_KIRKWOOD
 	select PCI
 	select ARCH_REQUIRE_GPIOLIB
 	select GENERIC_CLOCKEVENTS
+	select NEED_MACH_IO_H
 	select PLAT_ORION
 	help
 	  Support for the following Marvell Kirkwood series SoCs:
@@ -576,6 +590,7 @@ config ARCH_MV78XX0
 	select PCI
 	select ARCH_REQUIRE_GPIOLIB
 	select GENERIC_CLOCKEVENTS
+	select NEED_MACH_IO_H
 	select PLAT_ORION
 	help
 	  Support for the following Marvell MV78xx0 series SoCs:
@@ -645,6 +660,7 @@ config ARCH_TEGRA
 	select HAVE_SCHED_CLOCK
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
+	select NEED_MACH_IO_H if PCI
 	select ARCH_HAS_CPUFREQ
 	help
 	  This enables support for NVIDIA Tegra based systems (Tegra APX,
@@ -739,6 +755,7 @@ config ARCH_RPC
 	select ARCH_SPARSEMEM_ENABLE
 	select ARCH_USES_GETTIMEOFFSET
 	select HAVE_IDE
+	select NEED_MACH_IO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  On the Acorn Risc-PC, Linux can support the internal IDE disk and
@@ -771,6 +788,7 @@ config ARCH_S3C2410
 	select CLKDEV_LOOKUP
 	select ARCH_USES_GETTIMEOFFSET
 	select HAVE_S3C2410_I2C if I2C
+	select NEED_MACH_IO_H
 	help
 	  Samsung S3C2410X CPU based systems, such as the Simtec Electronics
 	  BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@ -877,6 +895,7 @@ config ARCH_SHARK
 	select PCI
 	select ARCH_USES_GETTIMEOFFSET
 	select NEED_MACH_MEMORY_H
+	select NEED_MACH_IO_H
 	help
 	  Support for the StrongARM based Digital DNARD machine, also known
 	  as "Shark" (<http://www.shark-linux.de/shark.html>).
@@ -946,6 +965,7 @@ config ARCH_OMAP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_SCHED_CLOCK
 	select ARCH_HAS_HOLES_MEMORYMODEL
+	select NEED_MACH_IO_H
 	help
 	  Support for TI's OMAP platform (OMAP1/2/3/4).
 
@@ -968,6 +988,7 @@ config ARCH_VT8500
 	select GENERIC_CLOCKEVENTS
 	select ARCH_REQUIRE_GPIOLIB
 	select HAVE_PWM
+	select NEED_MACH_IO_H
 	help
 	  Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
 
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index f5c6968..5e0ca53 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -109,7 +109,12 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
 /*
  * Now, pick up the machine-defined IO definitions
  */
+#ifdef CONFIG_NEED_MACH_IO_H
 #include <mach/io.h>
+#else
+#define __io(a)		({ (void)(a); __typesafe_io(0); })
+#define __mem_pci(a)	(a)
+#endif
 
 /*
  * This is the limit of PC card/PCI/ISA IO space, which is by default
-- 
1.7.5.4

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

* [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (12 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 22:16   ` H Hartley Sweeten
                     ` (2 more replies)
  2012-02-13 21:43 ` [PATCH 15/15] ARM: kill off __mem_pci Rob Herring
                   ` (3 subsequent siblings)
  17 siblings, 3 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Now that many platforms don't need mach/io.h, remove the usused ones.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-at91/include/mach/io.h      |   49 -----------------------------
 arch/arm/mach-bcmring/include/mach/io.h   |   33 -------------------
 arch/arm/mach-clps711x/include/mach/io.h  |   36 ---------------------
 arch/arm/mach-cns3xxx/include/mach/io.h   |   17 ----------
 arch/arm/mach-davinci/include/mach/io.h   |   24 --------------
 arch/arm/mach-ep93xx/include/mach/io.h    |   22 -------------
 arch/arm/mach-exynos/include/mach/io.h    |   26 ---------------
 arch/arm/mach-gemini/include/mach/io.h    |   18 ----------
 arch/arm/mach-h720x/include/mach/io.h     |   22 -------------
 arch/arm/mach-highbank/include/mach/io.h  |    7 ----
 arch/arm/mach-ks8695/include/mach/io.h    |   19 -----------
 arch/arm/mach-lpc32xx/include/mach/io.h   |   27 ----------------
 arch/arm/mach-mmp/include/mach/io.h       |   21 ------------
 arch/arm/mach-msm/include/mach/io.h       |   24 --------------
 arch/arm/mach-mxs/include/mach/io.h       |   22 -------------
 arch/arm/mach-netx/include/mach/io.h      |   28 ----------------
 arch/arm/mach-nomadik/include/mach/io.h   |   22 -------------
 arch/arm/mach-orion5x/include/mach/io.h   |   21 ------------
 arch/arm/mach-picoxcell/include/mach/io.h |   22 -------------
 arch/arm/mach-pnx4008/include/mach/io.h   |   21 ------------
 arch/arm/mach-prima2/include/mach/io.h    |   16 ---------
 arch/arm/mach-pxa/include/mach/io.h       |   20 ------------
 arch/arm/mach-realview/include/mach/io.h  |   28 ----------------
 arch/arm/mach-s3c64xx/include/mach/io.h   |   18 ----------
 arch/arm/mach-s5p64x0/include/mach/io.h   |   25 ---------------
 arch/arm/mach-s5pc100/include/mach/io.h   |   18 ----------
 arch/arm/mach-s5pv210/include/mach/io.h   |   26 ---------------
 arch/arm/mach-sa1100/include/mach/io.h    |   20 ------------
 arch/arm/mach-shmobile/include/mach/io.h  |    9 -----
 arch/arm/mach-spear3xx/include/mach/io.h  |   19 -----------
 arch/arm/mach-spear6xx/include/mach/io.h  |   20 ------------
 arch/arm/mach-u300/include/mach/io.h      |   20 ------------
 arch/arm/mach-ux500/include/mach/io.h     |   22 -------------
 arch/arm/mach-versatile/include/mach/io.h |   28 ----------------
 arch/arm/mach-vexpress/include/mach/io.h  |   26 ---------------
 arch/arm/mach-w90x900/include/mach/io.h   |   30 -----------------
 arch/arm/mach-zynq/include/mach/io.h      |   33 -------------------
 arch/arm/plat-mxc/include/mach/io.h       |   22 -------------
 arch/arm/plat-spear/include/plat/io.h     |   22 -------------
 39 files changed, 0 insertions(+), 903 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/io.h
 delete mode 100644 arch/arm/mach-bcmring/include/mach/io.h
 delete mode 100644 arch/arm/mach-clps711x/include/mach/io.h
 delete mode 100644 arch/arm/mach-cns3xxx/include/mach/io.h
 delete mode 100644 arch/arm/mach-davinci/include/mach/io.h
 delete mode 100644 arch/arm/mach-ep93xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-exynos/include/mach/io.h
 delete mode 100644 arch/arm/mach-gemini/include/mach/io.h
 delete mode 100644 arch/arm/mach-h720x/include/mach/io.h
 delete mode 100644 arch/arm/mach-highbank/include/mach/io.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/io.h
 delete mode 100644 arch/arm/mach-lpc32xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-mmp/include/mach/io.h
 delete mode 100644 arch/arm/mach-msm/include/mach/io.h
 delete mode 100644 arch/arm/mach-mxs/include/mach/io.h
 delete mode 100644 arch/arm/mach-netx/include/mach/io.h
 delete mode 100644 arch/arm/mach-nomadik/include/mach/io.h
 delete mode 100644 arch/arm/mach-orion5x/include/mach/io.h
 delete mode 100644 arch/arm/mach-picoxcell/include/mach/io.h
 delete mode 100644 arch/arm/mach-pnx4008/include/mach/io.h
 delete mode 100644 arch/arm/mach-prima2/include/mach/io.h
 delete mode 100644 arch/arm/mach-pxa/include/mach/io.h
 delete mode 100644 arch/arm/mach-realview/include/mach/io.h
 delete mode 100644 arch/arm/mach-s3c64xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-s5p64x0/include/mach/io.h
 delete mode 100644 arch/arm/mach-s5pc100/include/mach/io.h
 delete mode 100644 arch/arm/mach-s5pv210/include/mach/io.h
 delete mode 100644 arch/arm/mach-sa1100/include/mach/io.h
 delete mode 100644 arch/arm/mach-shmobile/include/mach/io.h
 delete mode 100644 arch/arm/mach-spear3xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-spear6xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-u300/include/mach/io.h
 delete mode 100644 arch/arm/mach-ux500/include/mach/io.h
 delete mode 100644 arch/arm/mach-versatile/include/mach/io.h
 delete mode 100644 arch/arm/mach-vexpress/include/mach/io.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/io.h
 delete mode 100644 arch/arm/mach-zynq/include/mach/io.h
 delete mode 100644 arch/arm/plat-mxc/include/mach/io.h
 delete mode 100644 arch/arm/plat-spear/include/plat/io.h

diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h
deleted file mode 100644
index 4ca09ef..0000000
--- a/arch/arm/mach-at91/include/mach/io.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/io.h
- *
- *  Copyright (C) 2003 SAN People
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_IO_H
-#define __ASM_ARCH_IO_H
-
-#include <mach/hardware.h>
-
-#define IO_SPACE_LIMIT		0xFFFFFFFF
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#ifndef __ASSEMBLY__
-
-static inline unsigned int at91_sys_read(unsigned int reg_offset)
-{
-	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-
-	return __raw_readl(addr + reg_offset);
-}
-
-static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
-{
-	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-
-	__raw_writel(value, addr + reg_offset);
-}
-
-#endif
-
-#endif
diff --git a/arch/arm/mach-bcmring/include/mach/io.h b/arch/arm/mach-bcmring/include/mach/io.h
deleted file mode 100644
index dae5e9b..0000000
--- a/arch/arm/mach-bcmring/include/mach/io.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- *  Copyright (C) 1999 ARM Limited
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#include <mach/hardware.h>
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * We don't actually have real ISA nor PCI buses, but there is so many
- * drivers out there that might just work if we fake them...
- */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-clps711x/include/mach/io.h b/arch/arm/mach-clps711x/include/mach/io.h
deleted file mode 100644
index 2e0b3ce..0000000
--- a/arch/arm/mach-clps711x/include/mach/io.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  arch/arm/mach-clps711x/include/mach/io.h
- *
- *  Copyright (C) 1999 ARM Limited
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-/*
- * We don't support ins[lb]/outs[lb].  Make them fault.
- */
-#define __raw_readsb(p,d,l)	do { *(int *)0 = 0; } while (0)
-#define __raw_readsl(p,d,l)	do { *(int *)0 = 0; } while (0)
-#define __raw_writesb(p,d,l)	do { *(int *)0 = 0; } while (0)
-#define __raw_writesl(p,d,l)	do { *(int *)0 = 0; } while (0)
-
-#endif
diff --git a/arch/arm/mach-cns3xxx/include/mach/io.h b/arch/arm/mach-cns3xxx/include/mach/io.h
deleted file mode 100644
index 33b6fc1..0000000
--- a/arch/arm/mach-cns3xxx/include/mach/io.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2008 Cavium Networks
- * Copyright 2003 ARM Limited
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
- * published by the Free Software Foundation.
- */
-#ifndef __MACH_IO_H
-#define __MACH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
-#endif
diff --git a/arch/arm/mach-davinci/include/mach/io.h b/arch/arm/mach-davinci/include/mach/io.h
deleted file mode 100644
index b2267d1..0000000
--- a/arch/arm/mach-davinci/include/mach/io.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * DaVinci IO address definitions
- *
- * Copied from include/asm/arm/arch-omap/io.h
- *
- * 2007 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#ifndef __ASM_ARCH_IO_H
-#define __ASM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * We don't actually have real ISA nor PCI buses, but there is so many
- * drivers out there that might just work if we fake them...
- */
-#define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-#define __mem_isa(a)		(a)
-
-#endif /* __ASM_ARCH_IO_H */
diff --git a/arch/arm/mach-ep93xx/include/mach/io.h b/arch/arm/mach-ep93xx/include/mach/io.h
deleted file mode 100644
index 594b77f..0000000
--- a/arch/arm/mach-ep93xx/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * arch/arm/mach-ep93xx/include/mach/io.h
- */
-
-#ifndef __ASM_MACH_IO_H
-#define __ASM_MACH_IO_H
-
-#define IO_SPACE_LIMIT		0xffffffff
-
-#define __io(p)			__typesafe_io(p)
-#define __mem_pci(p)		(p)
-
-/*
- * A typesafe __io() variation for variable initialisers
- */
-#ifdef __ASSEMBLER__
-#define IOMEM(p)		p
-#else
-#define IOMEM(p)		((void __iomem __force *)(p))
-#endif
-
-#endif /* __ASM_MACH_IO_H */
diff --git a/arch/arm/mach-exynos/include/mach/io.h b/arch/arm/mach-exynos/include/mach/io.h
deleted file mode 100644
index d5478d2..0000000
--- a/arch/arm/mach-exynos/include/mach/io.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* linux/arch/arm/mach-exynos4/include/mach/io.h
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com
- *
- * Copyright 2008-2010 Ben Dooks <ben-linux@fluff.org>
- *
- * Based on arch/arm/mach-s5p6442/include/mach/io.h
- *
- * Default IO routines for EXYNOS4
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H __FILE__
-
-/* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
-#endif /* __ASM_ARM_ARCH_IO_H */
diff --git a/arch/arm/mach-gemini/include/mach/io.h b/arch/arm/mach-gemini/include/mach/io.h
deleted file mode 100644
index c548056..0000000
--- a/arch/arm/mach-gemini/include/mach/io.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- *  Copyright (C) 2001-2006 Storlink, Corp.
- *  Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * 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.
- */
-#ifndef __MACH_IO_H
-#define __MACH_IO_H
-
-#define IO_SPACE_LIMIT	0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif /* __MACH_IO_H */
diff --git a/arch/arm/mach-h720x/include/mach/io.h b/arch/arm/mach-h720x/include/mach/io.h
deleted file mode 100644
index 2c8659c..0000000
--- a/arch/arm/mach-h720x/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * arch/arm/mach-h720x/include/mach/io.h
- *
- * Copyright (C) 2000 Steve Hill (sjhill at cotw.com)
- *
- * Changelog:
- *
- *  09-19-2001	JJKIM
- *  		Created from arch/arm/mach-l7200/include/mach/io.h
- *
- *  03-27-2003  Robert Schwebel <r.schwebel@pengutronix.de>:
- *  		re-unified header files for h720x
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-highbank/include/mach/io.h b/arch/arm/mach-highbank/include/mach/io.h
deleted file mode 100644
index 70cfa3b..0000000
--- a/arch/arm/mach-highbank/include/mach/io.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __MACH_IO_H
-#define __MACH_IO_H
-
-#define __io(a)		({ (void)(a); __typesafe_io(0); })
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-ks8695/include/mach/io.h b/arch/arm/mach-ks8695/include/mach/io.h
deleted file mode 100644
index a7a63ac..0000000
--- a/arch/arm/mach-ks8695/include/mach/io.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-ks8695/include/mach/io.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_ARCH_IO_H
-#define __ASM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT		0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/io.h b/arch/arm/mach-lpc32xx/include/mach/io.h
deleted file mode 100644
index 9b59ab5..0000000
--- a/arch/arm/mach-lpc32xx/include/mach/io.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * arch/arm/mach-lpc32xx/include/mach/io.h
- *
- * Author: Kevin Wells <kevin.wells@nxp.com>
- *
- * Copyright (C) 2010 NXP Semiconductors
- *
- * 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.
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT	0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-mmp/include/mach/io.h b/arch/arm/mach-mmp/include/mach/io.h
deleted file mode 100644
index e7adf3d..0000000
--- a/arch/arm/mach-mmp/include/mach/io.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * linux/arch/arm/mach-mmp/include/mach/io.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ASM_MACH_IO_H
-#define __ASM_MACH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * We don't actually have real ISA nor PCI buses, but there is so many
- * drivers out there that might just work if we fake them...
- */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif /* __ASM_MACH_IO_H */
diff --git a/arch/arm/mach-msm/include/mach/io.h b/arch/arm/mach-msm/include/mach/io.h
deleted file mode 100644
index 1071f98..0000000
--- a/arch/arm/mach-msm/include/mach/io.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* arch/arm/mach-msm/include/mach/io.h
- *
- * Copyright (C) 2007 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)    (a)
-
-#endif
diff --git a/arch/arm/mach-mxs/include/mach/io.h b/arch/arm/mach-mxs/include/mach/io.h
deleted file mode 100644
index 289b722..0000000
--- a/arch/arm/mach-mxs/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *  Copyright 2004-2007 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 version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __MACH_MXS_IO_H__
-#define __MACH_MXS_IO_H__
-
-/* Allow IO space to be anywhere in the memory */
-#define IO_SPACE_LIMIT 0xffffffff
-
-/* io address mapping macro */
-#define __io(a)		__typesafe_io(a)
-
-#define __mem_pci(a)	(a)
-
-#endif /* __MACH_MXS_IO_H__ */
diff --git a/arch/arm/mach-netx/include/mach/io.h b/arch/arm/mach-netx/include/mach/io.h
deleted file mode 100644
index c3921cb..0000000
--- a/arch/arm/mach-netx/include/mach/io.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  arch/arm/mach-netx/include/mach/io.h
- *
- * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)            (a)
-
-#endif
diff --git a/arch/arm/mach-nomadik/include/mach/io.h b/arch/arm/mach-nomadik/include/mach/io.h
deleted file mode 100644
index 2e1eca1..0000000
--- a/arch/arm/mach-nomadik/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * arch/arm/mach-nomadik/include/mach/io.h   (copied from mach-sa1100)
- *
- * Copyright (C) 1997-1999 Russell King
- *
- * Modifications:
- *  06-12-1997  RMK     Created.
- *  07-04-1999  RMK     Major cleanup
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * We don't actually have real ISA nor PCI buses, but there is so many
- * drivers out there that might just work if we fake them...
- */
-#define __io(a)         __typesafe_io(a)
-#define __mem_pci(a)    (a)
-
-#endif
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h
deleted file mode 100644
index 444136d..0000000
--- a/arch/arm/mach-orion5x/include/mach/io.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/arm/mach-orion5x/include/mach/io.h
- *
- * Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_ARCH_IO_H
-#define __ASM_ARCH_IO_H
-
-#include "orion5x.h"
-
-#define IO_SPACE_LIMIT		0xffffffff
-
-#define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
-#endif
diff --git a/arch/arm/mach-picoxcell/include/mach/io.h b/arch/arm/mach-picoxcell/include/mach/io.h
deleted file mode 100644
index 7573ec7..0000000
--- a/arch/arm/mach-picoxcell/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2011 Picochip Ltd., Jamie Iles
- *
- * 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.
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-/* No ioports, but needed for driver compatibility. */
-#define __io(a)			__typesafe_io(a)
-/* No PCI possible on picoxcell. */
-#define __mem_pci(a)		(a)
-
-#endif /* __ASM_ARM_ARCH_IO_H */
diff --git a/arch/arm/mach-pnx4008/include/mach/io.h b/arch/arm/mach-pnx4008/include/mach/io.h
deleted file mode 100644
index cbf0904..0000000
--- a/arch/arm/mach-pnx4008/include/mach/io.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/*
- *  arch/arm/mach-pnx4008/include/mach/io.h
- *
- * Author: Dmitry Chigirev <chigirev@ru.mvista.com>
- *
- * 2005 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-prima2/include/mach/io.h b/arch/arm/mach-prima2/include/mach/io.h
deleted file mode 100644
index 6c31e9e..0000000
--- a/arch/arm/mach-prima2/include/mach/io.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * arch/arm/mach-prima2/include/mach/io.h
- *
- * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef __MACH_PRIMA2_IO_H
-#define __MACH_PRIMA2_IO_H
-
-#define IO_SPACE_LIMIT ((resource_size_t)0)
-
-#define __mem_pci(a)            (a)
-
-#endif
diff --git a/arch/arm/mach-pxa/include/mach/io.h b/arch/arm/mach-pxa/include/mach/io.h
deleted file mode 100644
index fdca3be..0000000
--- a/arch/arm/mach-pxa/include/mach/io.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * arch/arm/mach-pxa/include/mach/io.h
- *
- * Copied from asm/arch/sa1100/io.h
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#include <mach/hardware.h>
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * We don't actually have real ISA nor PCI buses, but there is so many
- * drivers out there that might just work if we fake them...
- */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-realview/include/mach/io.h b/arch/arm/mach-realview/include/mach/io.h
deleted file mode 100644
index f05bcdf..0000000
--- a/arch/arm/mach-realview/include/mach/io.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  arch/arm/mach-realview/include/mach/io.h
- *
- *  Copyright (C) 2003 ARM Limited
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-s3c64xx/include/mach/io.h b/arch/arm/mach-s3c64xx/include/mach/io.h
deleted file mode 100644
index de5716d..0000000
--- a/arch/arm/mach-s3c64xx/include/mach/io.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* arch/arm/mach-s3c64xxinclude/mach/io.h
- *
- * Copyright 2008 Simtec Electronics
- *	Ben Dooks <ben-linux@fluff.org>
- *
- * Default IO routines for S3C64XX based
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-/* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
-#endif
diff --git a/arch/arm/mach-s5p64x0/include/mach/io.h b/arch/arm/mach-s5p64x0/include/mach/io.h
deleted file mode 100644
index a3e095c..0000000
--- a/arch/arm/mach-s5p64x0/include/mach/io.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* linux/arch/arm/mach-s5p64x0/include/mach/io.h
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com
- *
- * Copyright 2008 Simtec Electronics
- *	Ben Dooks <ben-linux@fluff.org>
- *
- * Default IO routines for S5P64X0 based
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-/* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
-#endif
diff --git a/arch/arm/mach-s5pc100/include/mach/io.h b/arch/arm/mach-s5pc100/include/mach/io.h
deleted file mode 100644
index 819acf5..0000000
--- a/arch/arm/mach-s5pc100/include/mach/io.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* arch/arm/mach-s5pc100/include/mach/io.h
- *
- * Copyright 2008 Simtec Electronics
- *	Ben Dooks <ben-linux@fluff.org>
- *
- * Default IO routines for S5PC100 systems
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-/* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
-#endif
diff --git a/arch/arm/mach-s5pv210/include/mach/io.h b/arch/arm/mach-s5pv210/include/mach/io.h
deleted file mode 100644
index 5ab9d56..0000000
--- a/arch/arm/mach-s5pv210/include/mach/io.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/include/mach/io.h
- *
- * Copyright 2008-2010 Ben Dooks <ben-linux@fluff.org>
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com/
- *
- * Based on arch/arm/mach-s5p6442/include/mach/io.h
- *
- * Default IO routines for S5PV210
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H __FILE__
-
-/* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
-#endif /* __ASM_ARM_ARCH_IO_H */
diff --git a/arch/arm/mach-sa1100/include/mach/io.h b/arch/arm/mach-sa1100/include/mach/io.h
deleted file mode 100644
index dfc27ff..0000000
--- a/arch/arm/mach-sa1100/include/mach/io.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * arch/arm/mach-sa1100/include/mach/io.h
- *
- * Copyright (C) 1997-1999 Russell King
- *
- * Modifications:
- *  06-12-1997	RMK	Created.
- *  07-04-1999	RMK	Major cleanup
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-/*
- * __io() is required to be an equivalent mapping to __mem_pci() for
- * SOC_COMMON to work.
- */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-shmobile/include/mach/io.h b/arch/arm/mach-shmobile/include/mach/io.h
deleted file mode 100644
index 7339fe4..0000000
--- a/arch/arm/mach-shmobile/include/mach/io.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_MACH_IO_H
-#define __ASM_MACH_IO_H
-
-#define IO_SPACE_LIMIT		0xffffffff
-
-#define __io(a)			((void __iomem *)(a))
-#define __mem_pci(a)		(a)
-
-#endif /* __ASM_MACH_IO_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/io.h b/arch/arm/mach-spear3xx/include/mach/io.h
deleted file mode 100644
index 30cff8a..0000000
--- a/arch/arm/mach-spear3xx/include/mach/io.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear3xx/include/mach/io.h
- *
- * IO definitions for SPEAr3xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_IO_H
-#define __MACH_IO_H
-
-#include <plat/io.h>
-
-#endif /* __MACH_IO_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/io.h b/arch/arm/mach-spear6xx/include/mach/io.h
deleted file mode 100644
index fb7c106..0000000
--- a/arch/arm/mach-spear6xx/include/mach/io.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/include/mach/io.h
- *
- * IO definitions for SPEAr6xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar Kumar<rajeev-dlh.kumar@st.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_IO_H
-#define __MACH_IO_H
-
-#include <plat/io.h>
-
-#endif	/* __MACH_IO_H */
-
diff --git a/arch/arm/mach-u300/include/mach/io.h b/arch/arm/mach-u300/include/mach/io.h
deleted file mode 100644
index 5d6b4c1..0000000
--- a/arch/arm/mach-u300/include/mach/io.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *
- * arch/arm/mach-u300/include/mach/io.h
- *
- *
- * Copyright (C) 2006-2009 ST-Ericsson AB
- * License terms: GNU General Public License (GPL) version 2
- * Dummy IO map for being able to use writew()/readw(),
- * writel()/readw() and similar accessor functions.
- * Author: Linus Walleij <linus.walleij@stericsson.com>
- */
-#ifndef __MACH_IO_H
-#define __MACH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-ux500/include/mach/io.h b/arch/arm/mach-ux500/include/mach/io.h
deleted file mode 100644
index 1cf3f44..0000000
--- a/arch/arm/mach-ux500/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * arch/arm/mach-u8500/include/mach/io.h
- *
- * Copyright (C) 1997-1999 Russell King
- *
- * Modifications:
- *  06-12-1997	RMK	Created.
- *  07-04-1999	RMK	Major cleanup
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * We don't actually have real ISA nor PCI buses, but there is so many
- * drivers out there that might just work if we fake them...
- */
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-versatile/include/mach/io.h b/arch/arm/mach-versatile/include/mach/io.h
deleted file mode 100644
index f067c14..0000000
--- a/arch/arm/mach-versatile/include/mach/io.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  arch/arm/mach-versatile/include/mach/io.h
- *
- *  Copyright (C) 2003 ARM Limited
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-vexpress/include/mach/io.h b/arch/arm/mach-vexpress/include/mach/io.h
deleted file mode 100644
index 13522d8..0000000
--- a/arch/arm/mach-vexpress/include/mach/io.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  arch/arm/mach-vexpress/include/mach/io.h
- *
- *  Copyright (C) 2003 ARM Limited
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/mach-w90x900/include/mach/io.h b/arch/arm/mach-w90x900/include/mach/io.h
deleted file mode 100644
index d96ab99..0000000
--- a/arch/arm/mach-w90x900/include/mach/io.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * arch/arm/mach-w90x900/include/mach/io.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/io.h
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT	0xffffffff
-
-/*
- * 1:1 mapping for ioremapped regions.
- */
-
-#define __mem_pci(a)	(a)
-#define __io(a)		__typesafe_io(a)
-
-#endif
diff --git a/arch/arm/mach-zynq/include/mach/io.h b/arch/arm/mach-zynq/include/mach/io.h
deleted file mode 100644
index 39d9885..0000000
--- a/arch/arm/mach-zynq/include/mach/io.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* arch/arm/mach-zynq/include/mach/io.h
- *
- *  Copyright (C) 2011 Xilinx
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- */
-
-#ifndef __MACH_IO_H__
-#define __MACH_IO_H__
-
-/* Allow IO space to be anywhere in the memory */
-
-#define IO_SPACE_LIMIT 0xffff
-
-/* IO address mapping macros, nothing special at this time but required */
-
-#ifdef __ASSEMBLER__
-#define IOMEM(x)		(x)
-#else
-#define IOMEM(x)		((void __force __iomem *)(x))
-#endif
-
-#define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
-#endif
diff --git a/arch/arm/plat-mxc/include/mach/io.h b/arch/arm/plat-mxc/include/mach/io.h
deleted file mode 100644
index ea9d95e..0000000
--- a/arch/arm/plat-mxc/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *  Copyright 2004-2007 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 version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ASM_ARCH_MXC_IO_H__
-#define __ASM_ARCH_MXC_IO_H__
-
-/* Allow IO space to be anywhere in the memory */
-#define IO_SPACE_LIMIT 0xffffffff
-
-/* io address mapping macro */
-#define __io(a)		__typesafe_io(a)
-
-#define __mem_pci(a)	(a)
-
-#endif
diff --git a/arch/arm/plat-spear/include/plat/io.h b/arch/arm/plat-spear/include/plat/io.h
deleted file mode 100644
index 4d4ba82..0000000
--- a/arch/arm/plat-spear/include/plat/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/io.h
- *
- * IO definitions for SPEAr platform
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __PLAT_IO_H
-#define __PLAT_IO_H
-
-#define IO_SPACE_LIMIT		0xFFFFFFFF
-
-#define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
-#endif /* __PLAT_IO_H */
-- 
1.7.5.4

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

* [PATCH 15/15] ARM: kill off __mem_pci
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (13 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
@ 2012-02-13 21:43 ` Rob Herring
  2012-02-13 22:22 ` [PATCH 00/15] mach/io.h cleanup and removal Tony Lindgren
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

__mem_pci is only used to enable readl/writel and friends. Just condition
this on readl being defined and remove all the __mem_pci defines.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/include/asm/io.h                  |   46 ++++++++++-----------------
 arch/arm/mach-dove/include/mach/io.h       |    1 -
 arch/arm/mach-footbridge/include/mach/io.h |   13 --------
 arch/arm/mach-integrator/include/mach/io.h |    1 -
 arch/arm/mach-iop13xx/include/mach/io.h    |    2 -
 arch/arm/mach-iop32x/include/mach/io.h     |    1 -
 arch/arm/mach-iop33x/include/mach/io.h     |    1 -
 arch/arm/mach-ixp2000/include/mach/io.h    |    1 -
 arch/arm/mach-ixp23xx/include/mach/io.h    |    1 -
 arch/arm/mach-ixp4xx/include/mach/io.h     |    6 +---
 arch/arm/mach-kirkwood/include/mach/io.h   |    2 -
 arch/arm/mach-mv78xx0/include/mach/io.h    |    2 -
 arch/arm/mach-rpc/include/mach/io.h        |    5 ---
 arch/arm/mach-s3c2410/include/mach/io.h    |    5 ---
 arch/arm/mach-shark/include/mach/io.h      |    2 -
 arch/arm/mach-tegra/include/mach/io.h      |    1 -
 arch/arm/mach-vt8500/include/mach/io.h     |    1 -
 17 files changed, 18 insertions(+), 73 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 5e0ca53..0f506a8 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -113,7 +113,6 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
 #include <mach/io.h>
 #else
 #define __io(a)		({ (void)(a); __typesafe_io(0); })
-#define __mem_pci(a)	(a)
 #endif
 
 /*
@@ -216,18 +215,18 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
  * Again, this are defined to perform little endian accesses.  See the
  * IO port primitives for more information.
  */
-#ifdef __mem_pci
-#define readb_relaxed(c) ({ u8  __r = __raw_readb(__mem_pci(c)); __r; })
+#ifndef readl
+#define readb_relaxed(c) ({ u8  __r = __raw_readb(c); __r; })
 #define readw_relaxed(c) ({ u16 __r = le16_to_cpu((__force __le16) \
-					__raw_readw(__mem_pci(c))); __r; })
+					__raw_readw(c)); __r; })
 #define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \
-					__raw_readl(__mem_pci(c))); __r; })
+					__raw_readl(c)); __r; })
 
-#define writeb_relaxed(v,c)	((void)__raw_writeb(v,__mem_pci(c)))
+#define writeb_relaxed(v,c)	((void)__raw_writeb(v,c))
 #define writew_relaxed(v,c)	((void)__raw_writew((__force u16) \
-					cpu_to_le16(v),__mem_pci(c)))
+					cpu_to_le16(v),c))
 #define writel_relaxed(v,c)	((void)__raw_writel((__force u32) \
-					cpu_to_le32(v),__mem_pci(c)))
+					cpu_to_le32(v),c))
 
 #define readb(c)		({ u8  __v = readb_relaxed(c); __iormb(); __v; })
 #define readw(c)		({ u16 __v = readw_relaxed(c); __iormb(); __v; })
@@ -237,30 +236,19 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
 #define writew(v,c)		({ __iowmb(); writew_relaxed(v,c); })
 #define writel(v,c)		({ __iowmb(); writel_relaxed(v,c); })
 
-#define readsb(p,d,l)		__raw_readsb(__mem_pci(p),d,l)
-#define readsw(p,d,l)		__raw_readsw(__mem_pci(p),d,l)
-#define readsl(p,d,l)		__raw_readsl(__mem_pci(p),d,l)
+#define readsb(p,d,l)		__raw_readsb(p,d,l)
+#define readsw(p,d,l)		__raw_readsw(p,d,l)
+#define readsl(p,d,l)		__raw_readsl(p,d,l)
 
-#define writesb(p,d,l)		__raw_writesb(__mem_pci(p),d,l)
-#define writesw(p,d,l)		__raw_writesw(__mem_pci(p),d,l)
-#define writesl(p,d,l)		__raw_writesl(__mem_pci(p),d,l)
+#define writesb(p,d,l)		__raw_writesb(p,d,l)
+#define writesw(p,d,l)		__raw_writesw(p,d,l)
+#define writesl(p,d,l)		__raw_writesl(p,d,l)
 
-#define memset_io(c,v,l)	_memset_io(__mem_pci(c),(v),(l))
-#define memcpy_fromio(a,c,l)	_memcpy_fromio((a),__mem_pci(c),(l))
-#define memcpy_toio(c,a,l)	_memcpy_toio(__mem_pci(c),(a),(l))
+#define memset_io(c,v,l)	_memset_io(c,(v),(l))
+#define memcpy_fromio(a,c,l)	_memcpy_fromio((a),c,(l))
+#define memcpy_toio(c,a,l)	_memcpy_toio(c,(a),(l))
 
-#elif !defined(readb)
-
-#define readb(c)			(__readwrite_bug("readb"),0)
-#define readw(c)			(__readwrite_bug("readw"),0)
-#define readl(c)			(__readwrite_bug("readl"),0)
-#define writeb(v,c)			__readwrite_bug("writeb")
-#define writew(v,c)			__readwrite_bug("writew")
-#define writel(v,c)			__readwrite_bug("writel")
-
-#define check_signature(io,sig,len)	(0)
-
-#endif	/* __mem_pci */
+#endif	/* readl */
 
 /*
  * ioremap and friends.
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h
index eb4936f..29c8b85 100644
--- a/arch/arm/mach-dove/include/mach/io.h
+++ b/arch/arm/mach-dove/include/mach/io.h
@@ -15,6 +15,5 @@
 
 #define __io(a)  	((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
 						 DOVE_PCIE0_IO_VIRT_BASE))
-#define __mem_pci(a)	(a)
 
 #endif
diff --git a/arch/arm/mach-footbridge/include/mach/io.h b/arch/arm/mach-footbridge/include/mach/io.h
index 15a7039..aba531ee 100644
--- a/arch/arm/mach-footbridge/include/mach/io.h
+++ b/arch/arm/mach-footbridge/include/mach/io.h
@@ -27,18 +27,5 @@
  * Translation of various region addresses to virtual addresses
  */
 #define __io(a)			((void __iomem *)(PCIO_BASE + (a)))
-#if 1
-#define __mem_pci(a)		(a)
-#else
-
-static inline void __iomem *___mem_pci(void __iomem *p)
-{
-	unsigned long a = (unsigned long)p;
-	BUG_ON(a <= 0xc0000000 || a >= 0xe0000000);
-	return p;
-}
-
-#define __mem_pci(a)		___mem_pci(a)
-#endif
 
 #endif
diff --git a/arch/arm/mach-integrator/include/mach/io.h b/arch/arm/mach-integrator/include/mach/io.h
index 37beed3..8de70de 100644
--- a/arch/arm/mach-integrator/include/mach/io.h
+++ b/arch/arm/mach-integrator/include/mach/io.h
@@ -29,6 +29,5 @@
 #define PCI_IO_VADDR            0xee000000
 
 #define __io(a)			((void __iomem *)(PCI_IO_VADDR + (a)))
-#define __mem_pci(a)		(a)
 
 #endif
diff --git a/arch/arm/mach-iop13xx/include/mach/io.h b/arch/arm/mach-iop13xx/include/mach/io.h
index dffb234..858ba98 100644
--- a/arch/arm/mach-iop13xx/include/mach/io.h
+++ b/arch/arm/mach-iop13xx/include/mach/io.h
@@ -22,8 +22,6 @@
 #define IO_SPACE_LIMIT 0xffffffff
 
 #define __io(a) __iop13xx_io(a)
-#define __mem_pci(a) (a)
-#define __mem_isa(a) (a)
 
 extern void __iomem * __iop13xx_io(unsigned long io_addr);
 extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
diff --git a/arch/arm/mach-iop32x/include/mach/io.h b/arch/arm/mach-iop32x/include/mach/io.h
index 2d88264..e2ada26 100644
--- a/arch/arm/mach-iop32x/include/mach/io.h
+++ b/arch/arm/mach-iop32x/include/mach/io.h
@@ -15,6 +15,5 @@
 
 #define IO_SPACE_LIMIT		0xffffffff
 #define __io(p)		((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
-#define __mem_pci(a)		(a)
 
 #endif
diff --git a/arch/arm/mach-iop33x/include/mach/io.h b/arch/arm/mach-iop33x/include/mach/io.h
index a8a66fc..f7c1b65 100644
--- a/arch/arm/mach-iop33x/include/mach/io.h
+++ b/arch/arm/mach-iop33x/include/mach/io.h
@@ -15,6 +15,5 @@
 
 #define IO_SPACE_LIMIT		0xffffffff
 #define __io(p)		((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
-#define __mem_pci(a)		(a)
 
 #endif
diff --git a/arch/arm/mach-ixp2000/include/mach/io.h b/arch/arm/mach-ixp2000/include/mach/io.h
index 859e584..f6552d6 100644
--- a/arch/arm/mach-ixp2000/include/mach/io.h
+++ b/arch/arm/mach-ixp2000/include/mach/io.h
@@ -18,7 +18,6 @@
 #include <mach/hardware.h>
 
 #define IO_SPACE_LIMIT		0xffffffff
-#define __mem_pci(a)		(a)
 
 /*
  * The A? revisions of the IXP2000s assert byte lanes for PCI I/O
diff --git a/arch/arm/mach-ixp23xx/include/mach/io.h b/arch/arm/mach-ixp23xx/include/mach/io.h
index 4ce4353..a7aceb5 100644
--- a/arch/arm/mach-ixp23xx/include/mach/io.h
+++ b/arch/arm/mach-ixp23xx/include/mach/io.h
@@ -18,6 +18,5 @@
 #define IO_SPACE_LIMIT 0xffffffff
 
 #define __io(p)		((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
-#define __mem_pci(a)	(a)
 
 #endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h
index ffb9d6a..d76a9bb 100644
--- a/arch/arm/mach-ixp4xx/include/mach/io.h
+++ b/arch/arm/mach-ixp4xx/include/mach/io.h
@@ -39,11 +39,7 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
  *    but in some cases the performance hit is acceptable. In addition, you
  *    cannot mmap() PCI devices in this case.
  */
-#ifndef	CONFIG_IXP4XX_INDIRECT_PCI
-
-#define __mem_pci(a)		(a)
-
-#else
+#ifdef	CONFIG_IXP4XX_INDIRECT_PCI
 
 /*
  * In the case of using indirect PCI, we simply return the actual PCI
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
index 49dd0cb..5d0ab61 100644
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ b/arch/arm/mach-kirkwood/include/mach/io.h
@@ -20,7 +20,5 @@ static inline void __iomem *__io(unsigned long addr)
 }
 
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/io.h b/arch/arm/mach-mv78xx0/include/mach/io.h
index 450e0e1..c7d9d00 100644
--- a/arch/arm/mach-mv78xx0/include/mach/io.h
+++ b/arch/arm/mach-mv78xx0/include/mach/io.h
@@ -20,7 +20,5 @@ static inline void __iomem *__io(unsigned long addr)
 }
 
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
diff --git a/arch/arm/mach-rpc/include/mach/io.h b/arch/arm/mach-rpc/include/mach/io.h
index 695f4ed..707071a 100644
--- a/arch/arm/mach-rpc/include/mach/io.h
+++ b/arch/arm/mach-rpc/include/mach/io.h
@@ -28,9 +28,4 @@
  */
 #define __io(a)		(PCIO_BASE + ((a) << 2))
 
-/*
- * 1:1 mapping for ioremapped regions.
- */
-#define __mem_pci(x)	(x)
-
 #endif
diff --git a/arch/arm/mach-s3c2410/include/mach/io.h b/arch/arm/mach-s3c2410/include/mach/io.h
index 118749f..5dd1db4 100644
--- a/arch/arm/mach-s3c2410/include/mach/io.h
+++ b/arch/arm/mach-s3c2410/include/mach/io.h
@@ -208,9 +208,4 @@ DECLARE_IO(int,l,"")
 #define outsw(p,d,l)	__raw_writesw(__ioaddr(p),d,l)
 #define outsl(p,d,l)	__raw_writesl(__ioaddr(p),d,l)
 
-/*
- * 1:1 mapping for ioremapped regions.
- */
-#define __mem_pci(x)	(x)
-
 #endif
diff --git a/arch/arm/mach-shark/include/mach/io.h b/arch/arm/mach-shark/include/mach/io.h
index 9ccbcec..1a45fc0 100644
--- a/arch/arm/mach-shark/include/mach/io.h
+++ b/arch/arm/mach-shark/include/mach/io.h
@@ -15,6 +15,4 @@
 
 #define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
 
-#define __mem_pci(addr) (addr)
-
 #endif
diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h
index 47b4b61..fe700f9 100644
--- a/arch/arm/mach-tegra/include/mach/io.h
+++ b/arch/arm/mach-tegra/include/mach/io.h
@@ -40,7 +40,6 @@ static inline void __iomem *__io(unsigned long addr)
 #endif
 
 #define __io(a)         __io(a)
-#define __mem_pci(a)    (a)
 
 #endif
 
diff --git a/arch/arm/mach-vt8500/include/mach/io.h b/arch/arm/mach-vt8500/include/mach/io.h
index 46181ee..fe30fa9 100644
--- a/arch/arm/mach-vt8500/include/mach/io.h
+++ b/arch/arm/mach-vt8500/include/mach/io.h
@@ -21,6 +21,5 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io((a) + 0xf0000000)
-#define __mem_pci(a)	(a)
 
 #endif
-- 
1.7.5.4

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

* [PATCH 11/15] ARM: ep93xx: clean-up mach/io.h
  2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
@ 2012-02-13 21:52   ` Ryan Mallon
  2012-02-13 22:15     ` Rob Herring
  2012-02-13 22:16   ` H Hartley Sweeten
  2012-02-27 15:17   ` [PATCH] " Rob Herring
  2 siblings, 1 reply; 74+ messages in thread
From: Ryan Mallon @ 2012-02-13 21:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 14/02/12 08:43, Rob Herring wrote:

> From: Rob Herring <rob.herring@calxeda.com>
> 
> Move ep93xx specifics in mach/io.h to ep93xx-regs.h.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
> index c4a7b84..8933c62 100644
> --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
> +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
> @@ -25,6 +25,12 @@
>   *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
>   */
>  
> +#ifdef __ASSEMBLER__
> +#define IOMEM(p)                p
> +#else
> +#define IOMEM(p)                ((void __iomem __force *)(p))
> +#endif
> +


I think you will get multiple definition warnings with this patch
applied, but not the later patches (think git bisect, etc). For example,
arch/arm/mach-ep93xx/clock.c includes both linux/io.h (includes
mach/io.h) and mach/hardware.h (includes mach/ep93xx-regs.h) so you will
get warnings about IOMEM being redefined.

~Ryan

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

* [PATCH 03/15] ARM: provide runtime hook for ioremap
  2012-02-13 21:43 ` [PATCH 03/15] ARM: provide runtime hook for ioremap Rob Herring
@ 2012-02-13 22:13   ` H Hartley Sweeten
  2012-02-13 22:30   ` Russell King - ARM Linux
  1 sibling, 0 replies; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-13 22:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 2:43 PM, Rob Herring wrote:
>
> We have compile time over-ride of ioremap, but an run-time override is
> needed for multi-platform builds.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/include/asm/io.h |    5 ++++-
>  arch/arm/mm/ioremap.c     |    3 +++
>  2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index 9275828..f5c6968 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -264,8 +264,11 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
>   * Documentation/io-mapping.txt.
>   *
>   */
> +
> +extern void __iomem * (*arch_ioremap)(unsigned long, size_t, unsigned int);
> +
>  #ifndef __arch_ioremap
> -#define __arch_ioremap			__arm_ioremap
> +#define __arch_ioremap			arch_ioremap
>  #define __arch_iounmap			__iounmap
>  #endif
>  
> diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
> index 80632e8..f551c13 100644
> --- a/arch/arm/mm/ioremap.c
> +++ b/arch/arm/mm/ioremap.c
> @@ -314,6 +314,9 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
>  }
>  EXPORT_SYMBOL(__arm_ioremap);
>  
> +void __iomem * (*arch_ioremap)(unsigned long , size_t , unsigned int ) = __arm_ioremap;
> +EXPORT_SYMBOL(arch_ioremap);
> +
>  /*
>   * Remap an arbitrary physical address space into the kernel virtual
>   * address space as memory. Needed when the kernel wants to execute

On EP93xx:

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* [PATCH 02/15] ARM: add explicit include of system.h to processor.h
  2012-02-13 21:43 ` [PATCH 02/15] ARM: add explicit include of system.h to processor.h Rob Herring
@ 2012-02-13 22:14   ` H Hartley Sweeten
  0 siblings, 0 replies; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-13 22:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 2:43 PM, Rob Herring wrote:
>
> cpu_relax in processor.h needs smp_mb which is defined in system.h.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/include/asm/processor.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
> index ce280b8..cb8d638 100644
> --- a/arch/arm/include/asm/processor.h
> +++ b/arch/arm/include/asm/processor.h
> @@ -22,6 +22,7 @@
>  #include <asm/hw_breakpoint.h>
>  #include <asm/ptrace.h>
>  #include <asm/types.h>
> +#include <asm/system.h>
>  
>  #ifdef __KERNEL__
>  #define STACK_TOP	((current->personality & ADDR_LIMIT_32BIT) ? \

On EP93xx

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
@ 2012-02-13 22:14   ` H Hartley Sweeten
  2012-02-13 22:36   ` Russell King - ARM Linux
  2012-02-13 23:15   ` H Hartley Sweeten
  2 siblings, 0 replies; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-13 22:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 2:43 PM, Rob Herring wrote:
>
> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
>
> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
> platforms don't need mach/io.h, but ebsa110 does. Most PCI platforms need
> mach/io.h for now, but ks8695 doesn't which means it's broken? omap has a
> lot of other stuff in its io.h, so it also needs io.h until it is cleaned
> up.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/Kconfig          |   21 +++++++++++++++++++++
>  arch/arm/include/asm/io.h |    5 +++++
>  2 files changed, 26 insertions(+), 0 deletions(-)

On EP93xx:

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* [PATCH 11/15] ARM: ep93xx: clean-up mach/io.h
  2012-02-13 21:52   ` Ryan Mallon
@ 2012-02-13 22:15     ` Rob Herring
  0 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 22:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/13/2012 03:52 PM, Ryan Mallon wrote:
> On 14/02/12 08:43, Rob Herring wrote:
> 
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> Move ep93xx specifics in mach/io.h to ep93xx-regs.h.
>>
>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>> ---
>>  arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
>>  1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
>> index c4a7b84..8933c62 100644
>> --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
>> +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
>> @@ -25,6 +25,12 @@
>>   *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
>>   */
>>  
>> +#ifdef __ASSEMBLER__
>> +#define IOMEM(p)                p
>> +#else
>> +#define IOMEM(p)                ((void __iomem __force *)(p))
>> +#endif
>> +
> 
> 
> I think you will get multiple definition warnings with this patch
> applied, but not the later patches (think git bisect, etc). For example,
> arch/arm/mach-ep93xx/clock.c includes both linux/io.h (includes
> mach/io.h) and mach/hardware.h (includes mach/ep93xx-regs.h) so you will
> get warnings about IOMEM being redefined.

Yes. I fixed the commit msg to say "move", but forgot to go back and
delete it from io.h. That's what I get for going off to lunch...

Rob

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

* [PATCH 11/15] ARM: ep93xx: clean-up mach/io.h
  2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
  2012-02-13 21:52   ` Ryan Mallon
@ 2012-02-13 22:16   ` H Hartley Sweeten
  2012-02-27 15:17   ` [PATCH] " Rob Herring
  2 siblings, 0 replies; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-13 22:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 2:43 PM, Rob Herring wrote:
>
> Move ep93xx specifics in mach/io.h to ep93xx-regs.h.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
> index c4a7b84..8933c62 100644
> --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
> +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
> @@ -25,6 +25,12 @@
>   *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
>   */
>  
> +#ifdef __ASSEMBLER__
> +#define IOMEM(p)                p
> +#else
> +#define IOMEM(p)                ((void __iomem __force *)(p))
> +#endif
> +
>  #define EP93XX_CS0_PHYS_BASE_ASYNC	0x00000000	/* ASDO Pin = 0 */
>  #define EP93XX_SDCE3_PHYS_BASE_SYNC	0x00000000	/* ASDO Pin = 1 */
>  #define EP93XX_CS1_PHYS_BASE		0x10000000

Can you please keep the comment from io.h with this move?

Also, the definition in io.h should be also be removed in this patch so that
git bisect works.

Other than that, this works on EP93xx.

I'll hold my Ack until I hear back.

Thanks,
Hartley

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

* [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files
  2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
@ 2012-02-13 22:16   ` H Hartley Sweeten
  2012-02-16  0:19   ` Shawn Guo
  2012-02-16 18:57   ` Linus Walleij
  2 siblings, 0 replies; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-13 22:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 2:43 PM, Rob Herring wrote:
>
> Now that many platforms don't need mach/io.h, remove the usused ones.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---

<snip>

arch/arm/mach-ep93xx/include/mach/io.h    |   22 -------------

<snip>

 delete mode 100644 arch/arm/mach-ep93xx/include/mach/io.h

<snip>

> diff --git a/arch/arm/mach-ep93xx/include/mach/io.h b/arch/arm/mach-ep93xx/include/mach/io.h
> deleted file mode 100644
> index 594b77f..0000000
> --- a/arch/arm/mach-ep93xx/include/mach/io.h
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -/*
> - * arch/arm/mach-ep93xx/include/mach/io.h
> - */
> -
> -#ifndef __ASM_MACH_IO_H
> -#define __ASM_MACH_IO_H
> -
> -#define IO_SPACE_LIMIT		0xffffffff
> -
> -#define __io(p)			__typesafe_io(p)
> -#define __mem_pci(p)		(p)
> -

As I mentioned in Patch 11/15, the following chunk:

> -/*
> - * A typesafe __io() variation for variable initialisers
> - */
> -#ifdef __ASSEMBLER__
> -#define IOMEM(p)		p
> -#else
> -#define IOMEM(p)		((void __iomem __force *)(p))
> -#endif

should be in Patch 11/15 so that git bisect works.

> -
> -#endif /* __ASM_MACH_IO_H */

Regards,
Hartley

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (14 preceding siblings ...)
  2012-02-13 21:43 ` [PATCH 15/15] ARM: kill off __mem_pci Rob Herring
@ 2012-02-13 22:22 ` Tony Lindgren
  2012-02-13 23:56   ` Tony Lindgren
  2012-02-14  3:09   ` Rob Herring
  2012-02-13 23:41 ` Tony Lindgren
  2012-02-21 22:47 ` Stephen Warren
  17 siblings, 2 replies; 74+ messages in thread
From: Tony Lindgren @ 2012-02-13 22:22 UTC (permalink / raw)
  To: linux-arm-kernel

* Rob Herring <robherring2@gmail.com> [120213 13:12]:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> This series cleans-up mach/io.h and removes it for most platforms that have
> the same definitions of __io() and __mem_pci(). This mainly leaves platforms
> with PCI that need an io.h. Most of those can be converted once we have a
> fixed IO space mapping. OMAP io.h also remains as moving all the extra io.h
> stuff leaves it quite broken, so I'm leaving it to the OMAP folks to convert.

I'll do some patches to use iomap.h on omaps. Are you planning to queue
these for v3.4 merge window?

If these are for v3.5 merge window, then I'll do a cleanup series that
just leaves a minimal io.h for omaps that's easy to convert. If you're
still planning these for v3.4 merge window, I'll rebase on your series.

Regards,

Tony

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

* [PATCH 03/15] ARM: provide runtime hook for ioremap
  2012-02-13 21:43 ` [PATCH 03/15] ARM: provide runtime hook for ioremap Rob Herring
  2012-02-13 22:13   ` H Hartley Sweeten
@ 2012-02-13 22:30   ` Russell King - ARM Linux
  2012-02-13 22:48     ` Rob Herring
  1 sibling, 1 reply; 74+ messages in thread
From: Russell King - ARM Linux @ 2012-02-13 22:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 13, 2012 at 03:43:16PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> We have compile time over-ride of ioremap, but an run-time override is
> needed for multi-platform builds.

Are you sure we need this after Nicolas' updates to ioremap() ?

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
  2012-02-13 22:14   ` H Hartley Sweeten
@ 2012-02-13 22:36   ` Russell King - ARM Linux
  2012-02-13 22:55     ` Rob Herring
  2012-02-14  2:03     ` Arnd Bergmann
  2012-02-13 23:15   ` H Hartley Sweeten
  2 siblings, 2 replies; 74+ messages in thread
From: Russell King - ARM Linux @ 2012-02-13 22:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
> 
> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
> platforms don't need mach/io.h, but ebsa110 does.

This is architecturally wrong.  If you have ISA, and your __io() macro
is essentially a 1:1 translation, you're asking for ISA drivers to
scribble on whatever is at virtual address 0-64K.  Too bad if that
happens to be where your CPU vectors are stored, you'll lose control
of the CPU in that case.

In other words, if you have PCI or ISA and your __io() macro is a 1:1
translation, you _need_ an io.h to define a proper offset for this.

So, I think this patch series moves things in the wrong direction.

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

* [PATCH 03/15] ARM: provide runtime hook for ioremap
  2012-02-13 22:30   ` Russell King - ARM Linux
@ 2012-02-13 22:48     ` Rob Herring
  0 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 22:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/13/2012 04:30 PM, Russell King - ARM Linux wrote:
> On Mon, Feb 13, 2012 at 03:43:16PM -0600, Rob Herring wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> We have compile time over-ride of ioremap, but an run-time override is
>> needed for multi-platform builds.
> 
> Are you sure we need this after Nicolas' updates to ioremap() ?

Yes, because these are adjusting the memory type, not redirecting the
ioremap to a static mapping. There was some discussion among Nico, Arnd
and myself about using static mappings instead as you can set the memory
type. The imx case is all addresses below 0x8000000 except the interrupt
controller need adjustment. This would burn up a lot more virtual space
or be a long list of peripherals. I think my change is much simpler and
is just generalizing what imx is doing for everyone.

There's also a few other custom ioremaps I didn't convert: ebsa110,
iop13xx, and ixp4xx. These platforms already have multiple issues with
single kernel.

Rob

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 22:36   ` Russell King - ARM Linux
@ 2012-02-13 22:55     ` Rob Herring
  2012-02-14  2:03     ` Arnd Bergmann
  1 sibling, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-13 22:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/13/2012 04:36 PM, Russell King - ARM Linux wrote:
> On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
>>
>> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
>> platforms don't need mach/io.h, but ebsa110 does.
> 
> This is architecturally wrong.  If you have ISA, and your __io() macro
> is essentially a 1:1 translation, you're asking for ISA drivers to
> scribble on whatever is at virtual address 0-64K.  Too bad if that
> happens to be where your CPU vectors are stored, you'll lose control
> of the CPU in that case.
> 
> In other words, if you have PCI or ISA and your __io() macro is a 1:1
> translation, you _need_ an io.h to define a proper offset for this.
> 
> So, I think this patch series moves things in the wrong direction.

I think a lot of platforms are already broken in this way. The platforms
which actually do the right thing are unchanged and still have an io.h.
The remaining platforms only care about building ISA drivers, but not
actually using that code path.

Moving to a fixed IO virtual address range is the next step, but is
really an independent problem.

Rob

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

* [PATCH 05/15] ARM: msm: use runtime ioremap hook
  2012-02-13 21:43 ` [PATCH 05/15] ARM: msm: use " Rob Herring
@ 2012-02-13 23:05   ` David Brown
  0 siblings, 0 replies; 74+ messages in thread
From: David Brown @ 2012-02-13 23:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 13, 2012 at 03:43:18PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Convert msm platforms to use run-time ioremap hook instead of the compile
> time hook.
> 
> According to David Brown, only the msm7201 needed the ioremap hook.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/mach-msm/board-halibut.c               |    6 ++++++
>  arch/arm/mach-msm/board-trout.c                 |    6 ++++++
>  arch/arm/mach-msm/include/mach/io.h             |    5 -----
>  arch/arm/mach-msm/include/mach/msm_iomap-7x00.h |    6 ++++++
>  arch/arm/mach-msm/io.c                          |    1 -
>  5 files changed, 18 insertions(+), 6 deletions(-)

Tested on 8660, compiled on all MSM targets (both patches that apply
to msm).

Tetsed-by: David Brown <davidb@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
  2012-02-13 22:14   ` H Hartley Sweeten
  2012-02-13 22:36   ` Russell King - ARM Linux
@ 2012-02-13 23:15   ` H Hartley Sweeten
  2012-02-14  1:06     ` Arnd Bergmann
  2 siblings, 1 reply; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-13 23:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 2:43 PM, Rob Herring wrote:
> 
> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
>
> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
> platforms don't need mach/io.h, but ebsa110 does. Most PCI platforms need
> mach/io.h for now, but ks8695 doesn't which means it's broken? omap has a
> lot of other stuff in its io.h, so it also needs io.h until it is cleaned
> up.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>

<snip>

> +#ifdef CONFIG_NEED_MACH_IO_H
>  #include <mach/io.h>
> +#else
> +#define __io(a)		({ (void)(a); __typesafe_io(0); })
> +#define __mem_pci(a)	(a)
> +#endif

Rob,

I compile and boot tested these patches on EP93xxbut did not check them
with sparse.

Most of the mach/io.h headers you remove in Patch 14/15 have the __io
macro defined like:

#define __io(a)		__typesafe_io(a)

Does your change above still keep the __io macro typesafe?

They don't appear equivalent to me...

Regards,
Hartley

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (15 preceding siblings ...)
  2012-02-13 22:22 ` [PATCH 00/15] mach/io.h cleanup and removal Tony Lindgren
@ 2012-02-13 23:41 ` Tony Lindgren
  2012-02-14  3:20   ` Rob Herring
  2012-02-21 22:47 ` Stephen Warren
  17 siblings, 1 reply; 74+ messages in thread
From: Tony Lindgren @ 2012-02-13 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

* Rob Herring <robherring2@gmail.com> [120213 13:12]:
>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++
>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
...
>  arch/arm/mach-msm/include/mach/msm_iomap-7x00.h   |    6 ++
>  arch/arm/mach-msm/include/mach/msm_iomap-7x30.h   |    4 ++
>  arch/arm/mach-msm/include/mach/msm_iomap-8960.h   |    4 ++
>  arch/arm/mach-msm/include/mach/msm_iomap-8x50.h   |    4 ++
>  arch/arm/mach-msm/include/mach/msm_iomap-8x60.h   |    4 ++
...

Considering the naming above..

>  arch/arm/mach-tegra/include/mach/iomap.h          |   48 ++++++++++++++++++

..should this be called tegra-iomap.h instead?

Tony

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-13 22:22 ` [PATCH 00/15] mach/io.h cleanup and removal Tony Lindgren
@ 2012-02-13 23:56   ` Tony Lindgren
  2012-02-14  3:09   ` Rob Herring
  1 sibling, 0 replies; 74+ messages in thread
From: Tony Lindgren @ 2012-02-13 23:56 UTC (permalink / raw)
  To: linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [120213 13:54]:
> * Rob Herring <robherring2@gmail.com> [120213 13:12]:
> > From: Rob Herring <rob.herring@calxeda.com>
> > 
> > This series cleans-up mach/io.h and removes it for most platforms that have
> > the same definitions of __io() and __mem_pci(). This mainly leaves platforms
> > with PCI that need an io.h. Most of those can be converted once we have a
> > fixed IO space mapping. OMAP io.h also remains as moving all the extra io.h
> > stuff leaves it quite broken, so I'm leaving it to the OMAP folks to convert.
> 
> I'll do some patches to use iomap.h on omaps. Are you planning to queue
> these for v3.4 merge window?
> 
> If these are for v3.5 merge window, then I'll do a cleanup series that
> just leaves a minimal io.h for omaps that's easy to convert. If you're
> still planning these for v3.4 merge window, I'll rebase on your series.

Posted the series to mov most of omap io.h into omap-iomap.h. It's intended
as a clean-up series before your patches so omap io.h can then be removed.

The series is Subject: [PATCH 0/3] Move most of omap io.h into omap-iomap.h.

Regards,

Tony

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 23:15   ` H Hartley Sweeten
@ 2012-02-14  1:06     ` Arnd Bergmann
  2012-02-14 17:38       ` H Hartley Sweeten
  0 siblings, 1 reply; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14  1:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 13 February 2012, H Hartley Sweeten wrote:
> > +#ifdef CONFIG_NEED_MACH_IO_H
> >  #include <mach/io.h>
> > +#else
> > +#define __io(a)              ({ (void)(a); __typesafe_io(0); })
> > +#define __mem_pci(a) (a)
> > +#endif
> 
> Rob,
> 
> I compile and boot tested these patches on EP93xxbut did not check them
> with sparse.
> 
> Most of the mach/io.h headers you remove in Patch 14/15 have the __io
> macro defined like:
> 
> #define __io(a)         __typesafe_io(a)
> 
> Does your change above still keep the __io macro typesafe?
> 
> They don't appear equivalent to me...

It's not equivalent, but the new version is more correct for most
platforms because it turns a random pointer dereference into a NULL
pointer dereference.

If you have none of PCI/ISA/PCMCIA, then inb/outb should never be
used. Ideally we would undefine __io in that case, which results
in the inb/outb stuff also not getting defined, but some drivers
like 8250 serial then fail to build even for systems that only
use the readl/writel path.

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-13 22:36   ` Russell King - ARM Linux
  2012-02-13 22:55     ` Rob Herring
@ 2012-02-14  2:03     ` Arnd Bergmann
  2012-02-14  2:54       ` Rob Herring
  1 sibling, 1 reply; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14  2:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 13 February 2012, Russell King - ARM Linux wrote:
> On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
> > From: Rob Herring <rob.herring@calxeda.com>
> > 
> > Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
> > 
> > Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
> > platforms don't need mach/io.h, but ebsa110 does.
> 
> This is architecturally wrong.  If you have ISA, and your __io() macro
> is essentially a 1:1 translation, you're asking for ISA drivers to
> scribble on whatever is at virtual address 0-64K.  Too bad if that
> happens to be where your CPU vectors are stored, you'll lose control
> of the CPU in that case.

Right. I still think it should be conditional on PCI || ISA || PCMCIA,
not introducing a new kconfig symbol, and the next step should be to
unify the __io() implementations for the platforms that need them.

> So, I think this patch series moves things in the wrong direction.

I would very much like to see a lot of the series get merged as it
brings us closer to the single zimage, but I agree we have to be
careful not to add extra complexity (or bugs, for that matter).

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14  2:03     ` Arnd Bergmann
@ 2012-02-14  2:54       ` Rob Herring
  2012-02-14  8:04         ` Arnd Bergmann
  0 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14  2:54 UTC (permalink / raw)
  To: linux-arm-kernel

Arnd,

On 02/13/2012 08:03 PM, Arnd Bergmann wrote:
> On Monday 13 February 2012, Russell King - ARM Linux wrote:
>> On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
>>> From: Rob Herring <rob.herring@calxeda.com>
>>>
>>> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
>>>
>>> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
>>> platforms don't need mach/io.h, but ebsa110 does.
>>
>> This is architecturally wrong.  If you have ISA, and your __io() macro
>> is essentially a 1:1 translation, you're asking for ISA drivers to
>> scribble on whatever is at virtual address 0-64K.  Too bad if that
>> happens to be where your CPU vectors are stored, you'll lose control
>> of the CPU in that case.
> 
> Right. I still think it should be conditional on PCI || ISA || PCMCIA,
> not introducing a new kconfig symbol, and the next step should be to
> unify the __io() implementations for the platforms that need them.

As we discussed at Connect, that was my original intent. However, there
are a couple of issues as NEED_MACH_IO_H is not exactly equivalent to
PCI || ISA || PCMCIA.

There are a few platforms which still need io.h for custom accessor
functions: rpc, ixp4xx, s3c2410, and ebsa110. Also, a few platforms that
only select ISA don't do any translation in __io(). These are sa1100,
clps711x, and pxa. My understanding is that is wrong.

If we use CONFIG_PCI, then we have to move over all PCI enabled
platforms at once. With a separate kconfig option, then we can move
platforms one by one. Some are legacy and we may not want to move. This
also helped with omap, but Tony has now fixed it.

>> So, I think this patch series moves things in the wrong direction.
> 
> I would very much like to see a lot of the series get merged as it
> brings us closer to the single zimage, but I agree we have to be
> careful not to add extra complexity (or bugs, for that matter).

It is at least clear which platforms are special now and we can figure
out how to handle them from here.

Rob

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-13 22:22 ` [PATCH 00/15] mach/io.h cleanup and removal Tony Lindgren
  2012-02-13 23:56   ` Tony Lindgren
@ 2012-02-14  3:09   ` Rob Herring
  1 sibling, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-14  3:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/13/2012 04:22 PM, Tony Lindgren wrote:
> * Rob Herring <robherring2@gmail.com> [120213 13:12]:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> This series cleans-up mach/io.h and removes it for most platforms that have
>> the same definitions of __io() and __mem_pci(). This mainly leaves platforms
>> with PCI that need an io.h. Most of those can be converted once we have a
>> fixed IO space mapping. OMAP io.h also remains as moving all the extra io.h
>> stuff leaves it quite broken, so I'm leaving it to the OMAP folks to convert.
> 
> I'll do some patches to use iomap.h on omaps. Are you planning to queue
> these for v3.4 merge window?
> 
> If these are for v3.5 merge window, then I'll do a cleanup series that
> just leaves a minimal io.h for omaps that's easy to convert. If you're
> still planning these for v3.4 merge window, I'll rebase on your series.

I would like to get it in for 3.4, but it really depends on Russell. If
not, I'll at least get the header clean-ups in for 3.4.

Rob

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-13 23:41 ` Tony Lindgren
@ 2012-02-14  3:20   ` Rob Herring
  2012-02-14 17:24     ` Tony Lindgren
  0 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14  3:20 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/13/2012 05:41 PM, Tony Lindgren wrote:
> * Rob Herring <robherring2@gmail.com> [120213 13:12]:
>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++
>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
> ...
>>  arch/arm/mach-msm/include/mach/msm_iomap-7x00.h   |    6 ++
>>  arch/arm/mach-msm/include/mach/msm_iomap-7x30.h   |    4 ++
>>  arch/arm/mach-msm/include/mach/msm_iomap-8960.h   |    4 ++
>>  arch/arm/mach-msm/include/mach/msm_iomap-8x50.h   |    4 ++
>>  arch/arm/mach-msm/include/mach/msm_iomap-8x60.h   |    4 ++
> ...
> 
> Considering the naming above..
> 
>>  arch/arm/mach-tegra/include/mach/iomap.h          |   48 ++++++++++++++++++
> 
> ..should this be called tegra-iomap.h instead?

Probably, but it's not a new header. Fixing include paths or names is a
separate problem when we start having multiple mach include directories.
Perhaps we can get them removed altogether before we have to start
renaming. Much of it is device addresses that will go in dts files.

Rob

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14  2:54       ` Rob Herring
@ 2012-02-14  8:04         ` Arnd Bergmann
  2012-02-14 14:36           ` Rob Herring
  2012-02-27 22:31           ` Rob Herring
  0 siblings, 2 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Rob Herring wrote:
> Arnd,
> 
> On 02/13/2012 08:03 PM, Arnd Bergmann wrote:
> > On Monday 13 February 2012, Russell King - ARM Linux wrote:
> >> On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
> >>> From: Rob Herring <rob.herring@calxeda.com>
> >>>
> >>> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
> >>>
> >>> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
> >>> platforms don't need mach/io.h, but ebsa110 does.
> >>
> >> This is architecturally wrong.  If you have ISA, and your __io() macro
> >> is essentially a 1:1 translation, you're asking for ISA drivers to
> >> scribble on whatever is at virtual address 0-64K.  Too bad if that
> >> happens to be where your CPU vectors are stored, you'll lose control
> >> of the CPU in that case.
> > 
> > Right. I still think it should be conditional on PCI || ISA || PCMCIA,
> > not introducing a new kconfig symbol, and the next step should be to
> > unify the __io() implementations for the platforms that need them.
> 
> As we discussed at Connect, that was my original intent. However, there
> are a couple of issues as NEED_MACH_IO_H is not exactly equivalent to
> PCI || ISA || PCMCIA.
> 
> There are a few platforms which still need io.h for custom accessor
> functions: rpc, ixp4xx, s3c2410, and ebsa110.

I've tried to interpret what is there, please correct me if this is wrong:

RPC and ebsa110 have ISA, or some twisted version of that. I believe
RPC doesn't select CONFIG_ISA because it has no actual ISA slots but
it still uses legacy ISA I/O and we might just select it anyway.

s3c24xx seems to have ISA in a similar way on the "bast" machine,
while the setup code for that got copied into some platforms that
don't really require it.

ixp4xx has PCI, but does not always use direct MMIO to access the
memory or I/O spaces.

I guess the only way we can ever make these ones use a common header
file (in case we care) by letting them go through an indirect
struct io_ops { u8 (*inb)(int); void (*outb)(u8, int); ... };,
but we might not care enough.

> Also, a few platforms that
> only select ISA don't do any translation in __io(). These are sa1100,
> clps711x, and pxa. My understanding is that is wrong.

sa1100 has pcmcia slots that use their own method (setting io_offset)
of redirecting the i/o space into the right location. As Russell
mentioned, this is broken if you load an ISA device driver that
uses hardcoded port numbers, or as I might add when you use /dev/port.

pxa seems to do the same as sa1100 for PCMCIA and PCI, but I can't figure
out what they do for ISA. I suspect they only enable that in order to
get ISA device drivers for PCMCIA based add-on cards.

clps711x for all I can tell is broken as you say.

I think omap1 and at91 fit into the same category as sa1100 and pxa
regarding pcmcia. All four can in theory be converted to use a
common virtual mapping as we want to have for PCI.

> If we use CONFIG_PCI, then we have to move over all PCI enabled
> platforms at once. With a separate kconfig option, then we can move
> platforms one by one. Some are legacy and we may not want to move. This
> also helped with omap, but Tony has now fixed it.

We could also generalize the implementation from tegra, which seems
reasonable as a start:


#define IO_SPACE_LIMIT 0xffff

#if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
#include <mach/io.h>
#elif defined(CONFIG_PCI)
extern void __iomem *pci_io_base;

static inline void __iomem *__io(unsigned long addr)
{
        return pci_io_base + (addr & IO_SPACE_LIMIT);
}
#else
static inline void __iomem *__io(unsigned long addr)
{
        return NULL;
}
#endif
#define __io(a) __io(a)

Out of the platforms supporting PCI right now, we currently have these three classes:

1. portable, but using different virtual addresses:
arch/arm/mach-integrator/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCI_IO_VADDR + (a)))
arch/arm/mach-ixp23xx/include/mach/io.h:#define __io(p)         ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
arch/arm/mach-ixp2000/include/mach/io.h:#define __io(p)                 ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
arch/arm/mach-shark/include/mach/io.h:#define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
arch/arm/mach-footbridge/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCIO_BASE + (a)))
arch/arm/mach-tegra/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
arch/arm/mach-kirkwood/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
arch/arm/mach-dove/include/mach/io.h:#define __io(a)    ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \

2. Does not map the I/O space, or does not use it -- I cannot see how
   any of these use PIO based PCI devices at all, probably broken already:
arch/arm/mach-cns3xxx/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
arch/arm/mach-ixp4xx/include/mach/io.h:#define  __io(v)         __typesafe_io(v)
arch/arm/mach-ks8695/include/mach/io.h:#define __io(a)          __typesafe_io(a)
arch/arm/mach-orion5x/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
arch/arm/mach-sa1100/include/mach/io.h:#define __io(a)          __typesafe_io(a)
arch/arm/mach-pxa/include/mach/io.h:#define __io(a)             __typesafe_io(a)
arch/arm/mach-versatile/include/mach/io.h:#define __io(a)               __typesafe_io(a)

3. scary multi-way translation, needs someone to really understand (Nico?, Lennert?)
arch/arm/mach-iop32x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
arch/arm/mach-iop33x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
arch/arm/mach-iop13xx/include/mach/io.h:#define __io(a) __iop13xx_io(a)
arch/arm/mach-mv78xx0/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)

I think if we can figure out the third category, this should all become
fairly easy for PCI based platforms.


	Arnd

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-13 21:43 ` [PATCH 07/15] ARM: at91: " Rob Herring
@ 2012-02-14  9:21   ` Nicolas Ferre
  2012-02-14 13:24     ` Rob Herring
  0 siblings, 1 reply; 74+ messages in thread
From: Nicolas Ferre @ 2012-02-14  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/13/2012 10:43 PM, Rob Herring :
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Move most of io.h into at91_io.h and update includes.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
>  arch/arm/mach-at91/at91cap9.c                     |    1 +
>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +

Please do not touch the "*cap9*" files anymore: They are scheduled for
removal for 3.4 kernel:
Documentation/feature-removal-schedule.txt


>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
>  arch/arm/mach-at91/at91x40.c                      |    1 +
>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
>  arch/arm/mach-at91/board-eco920.c                 |    1 +
>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
>  arch/arm/mach-at91/clock.c                        |    1 +
>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
>  arch/arm/mach-at91/pm.c                           |    1 +
>  arch/arm/mach-at91/pm.h                           |    2 +
>  arch/arm/mach-at91/setup.c                        |    1 +
>  drivers/pcmcia/at91_cf.c                          |    1 +
>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
>  drivers/usb/gadget/at91_udc.c                     |    1 +
>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
>  34 files changed, 80 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
> 
> diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
> index a42edc2..1fc7082 100644
> --- a/arch/arm/mach-at91/at91cap9.c
> +++ b/arch/arm/mach-at91/at91cap9.c
> @@ -21,6 +21,7 @@
>  #include <mach/cpu.h>
>  #include <mach/at91cap9.h>
>  #include <mach/at91_pmc.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
> index d298fb7..f2edf2d 100644
> --- a/arch/arm/mach-at91/at91cap9_devices.c
> +++ b/arch/arm/mach-at91/at91cap9_devices.c
> @@ -27,6 +27,7 @@
>  #include <mach/at91cap9.h>
>  #include <mach/at91cap9_matrix.h>
>  #include <mach/at91sam9_smc.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
> index 99c3174..e8a4d50 100644
> --- a/arch/arm/mach-at91/at91rm9200.c
> +++ b/arch/arm/mach-at91/at91rm9200.c
> @@ -19,6 +19,7 @@
>  #include <mach/at91_pmc.h>
>  #include <mach/at91_st.h>
>  #include <mach/cpu.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
> index 18bacec..1566d68 100644
> --- a/arch/arm/mach-at91/at91rm9200_devices.c
> +++ b/arch/arm/mach-at91/at91rm9200_devices.c
> @@ -21,6 +21,7 @@
>  #include <mach/board.h>
>  #include <mach/at91rm9200.h>
>  #include <mach/at91rm9200_mc.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
> index a028cdf..45bddca 100644
> --- a/arch/arm/mach-at91/at91rm9200_time.c
> +++ b/arch/arm/mach-at91/at91rm9200_time.c
> @@ -27,6 +27,7 @@
>  #include <asm/mach/time.h>
>  
>  #include <mach/at91_st.h>
> +#include <mach/at91_io.h>
>  
>  static unsigned long last_crtr;
>  static u32 irqmask;
> diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
> index d4036ba..5aa78fa 100644
> --- a/arch/arm/mach-at91/at91sam9260.c
> +++ b/arch/arm/mach-at91/at91sam9260.c
> @@ -20,6 +20,7 @@
>  #include <mach/at91sam9260.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/at91_rstc.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
> index 642ccb6..94fdf96 100644
> --- a/arch/arm/mach-at91/at91sam9260_devices.c
> +++ b/arch/arm/mach-at91/at91sam9260_devices.c
> @@ -22,6 +22,7 @@
>  #include <mach/at91sam9260.h>
>  #include <mach/at91sam9260_matrix.h>
>  #include <mach/at91sam9_smc.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
> index 023c2ff..3b4aec7 100644
> --- a/arch/arm/mach-at91/at91sam9261.c
> +++ b/arch/arm/mach-at91/at91sam9261.c
> @@ -19,6 +19,7 @@
>  #include <mach/at91sam9261.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/at91_rstc.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
> index fc59cbd..bbd04c2 100644
> --- a/arch/arm/mach-at91/at91sam9261_devices.c
> +++ b/arch/arm/mach-at91/at91sam9261_devices.c
> @@ -25,6 +25,7 @@
>  #include <mach/at91sam9261.h>
>  #include <mach/at91sam9261_matrix.h>
>  #include <mach/at91sam9_smc.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
> index 75e876c..2e1a428 100644
> --- a/arch/arm/mach-at91/at91sam9263.c
> +++ b/arch/arm/mach-at91/at91sam9263.c
> @@ -18,6 +18,7 @@
>  #include <mach/at91sam9263.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/at91_rstc.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
> index 7b46b27..1e5e88d 100644
> --- a/arch/arm/mach-at91/at91sam9263_devices.c
> +++ b/arch/arm/mach-at91/at91sam9263_devices.c
> @@ -24,6 +24,7 @@
>  #include <mach/at91sam9263.h>
>  #include <mach/at91sam9263_matrix.h>
>  #include <mach/at91sam9_smc.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
> index 1cb6a96..2f2e061 100644
> --- a/arch/arm/mach-at91/at91sam9g45.c
> +++ b/arch/arm/mach-at91/at91sam9g45.c
> @@ -19,6 +19,7 @@
>  #include <mach/at91sam9g45.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/cpu.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
> index b7582dd..9e0de74 100644
> --- a/arch/arm/mach-at91/at91sam9g45_devices.c
> +++ b/arch/arm/mach-at91/at91sam9g45_devices.c
> @@ -27,6 +27,7 @@
>  #include <mach/at91sam9_smc.h>
>  #include <mach/at_hdmac.h>
>  #include <mach/atmel-mci.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
> index d2c91a8..c284d98 100644
> --- a/arch/arm/mach-at91/at91sam9rl.c
> +++ b/arch/arm/mach-at91/at91sam9rl.c
> @@ -19,6 +19,7 @@
>  #include <mach/at91sam9rl.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/at91_rstc.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
> index 61908dc..3311106 100644
> --- a/arch/arm/mach-at91/at91sam9rl_devices.c
> +++ b/arch/arm/mach-at91/at91sam9rl_devices.c
> @@ -22,6 +22,7 @@
>  #include <mach/at91sam9rl_matrix.h>
>  #include <mach/at91sam9_smc.h>
>  #include <mach/at_hdmac.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
> index 56ba3bd..838103e 100644
> --- a/arch/arm/mach-at91/at91x40.c
> +++ b/arch/arm/mach-at91/at91x40.c
> @@ -17,6 +17,7 @@
>  #include <mach/at91x40.h>
>  #include <mach/at91_st.h>
>  #include <mach/timex.h>
> +#include <mach/at91_io.h>
>  #include "generic.h"
>  
>  /*
> diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
> index dfff289..152cc7a 100644
> --- a/arch/arm/mach-at91/at91x40_time.c
> +++ b/arch/arm/mach-at91/at91x40_time.c
> @@ -27,6 +27,7 @@
>  #include <mach/hardware.h>
>  #include <asm/mach/time.h>
>  #include <mach/at91_tc.h>
> +#include <mach/at91_io.h>
>  
>  /*
>   *	3 counter/timer units present.
> diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
> index ac3de4f..b31791a 100644
> --- a/arch/arm/mach-at91/board-cap9adk.c
> +++ b/arch/arm/mach-at91/board-cap9adk.c
> @@ -44,6 +44,7 @@
>  #include <mach/board.h>
>  #include <mach/at91cap9_matrix.h>
>  #include <mach/at91sam9_smc.h>
> +#include <mach/at91_io.h>
>  #include <mach/system_rev.h>
>  
>  #include "sam9_smc.h"
> diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
> index 9ab3d1e..619d1d0 100644
> --- a/arch/arm/mach-at91/board-cpu9krea.c
> +++ b/arch/arm/mach-at91/board-cpu9krea.c
> @@ -43,6 +43,7 @@
>  #include <mach/board.h>
>  #include <mach/at91sam9_smc.h>
>  #include <mach/at91sam9260_matrix.h>
> +#include <mach/at91_io.h>
>  
>  #include "sam9_smc.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
> index 07ef35b..f56bf24 100644
> --- a/arch/arm/mach-at91/board-eco920.c
> +++ b/arch/arm/mach-at91/board-eco920.c
> @@ -27,6 +27,7 @@
>  #include <mach/board.h>
>  #include <mach/at91rm9200_mc.h>
>  #include <mach/cpu.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
> index bbd553e..bf889e5 100644
> --- a/arch/arm/mach-at91/board-yl-9200.c
> +++ b/arch/arm/mach-at91/board-yl-9200.c
> @@ -46,6 +46,7 @@
>  #include <mach/board.h>
>  #include <mach/at91rm9200_mc.h>
>  #include <mach/cpu.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  
> diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
> index 61873f3..0e8b318 100644
> --- a/arch/arm/mach-at91/clock.c
> +++ b/arch/arm/mach-at91/clock.c
> @@ -27,6 +27,7 @@
>  #include <mach/hardware.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/cpu.h>
> +#include <mach/at91_io.h>
>  
>  #include "clock.h"
>  #include "generic.h"
> diff --git a/arch/arm/mach-at91/include/mach/at91_io.h b/arch/arm/mach-at91/include/mach/at91_io.h
> new file mode 100644
> index 0000000..82e66de
> --- /dev/null
> +++ b/arch/arm/mach-at91/include/mach/at91_io.h
> @@ -0,0 +1,44 @@
> +/*
> + * arch/arm/mach-at91/include/mach/io.h

maybe change this line into:

 * at91_io.h

> + *
> + *  Copyright (C) 2003 SAN People
> + *
> + * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> + */
> +
> +#ifndef __ASM_ARCH_IO_H
> +#define __ASM_ARCH_IO_H

Maybe change this as well.

> +
> +#include <mach/hardware.h>
> +
> +#ifndef __ASSEMBLY__
> +
> +static inline unsigned int at91_sys_read(unsigned int reg_offset)
> +{
> +	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
> +
> +	return __raw_readl(addr + reg_offset);
> +}
> +
> +static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
> +{
> +	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
> +
> +	__raw_writel(value, addr + reg_offset);
> +}
> +
> +#endif
> +
> +#endif
> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> index e2f8da8..0427212 100644
> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> @@ -12,6 +12,8 @@
>  #ifndef AT91SAM9_DDRSDR_H
>  #define AT91SAM9_DDRSDR_H
>  
> +#include <mach/at91_io.h>

Do we need this include in header files?

> +
>  #define AT91_DDRSDRC_MR		0x00	/* Mode Register */
>  #define		AT91_DDRSDRC_MODE	(0x7 << 0)		/* Command Mode */
>  #define			AT91_DDRSDRC_MODE_NORMAL	0
> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
> index 100f5a5..4a3b2ec 100644
> --- a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
> +++ b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
> @@ -16,6 +16,8 @@
>  #ifndef AT91SAM9_SDRAMC_H
>  #define AT91SAM9_SDRAMC_H
>  
> +#include <mach/at91_io.h>
> +
>  /* SDRAM Controller (SDRAMC) registers */
>  #define AT91_SDRAMC_MR		0x00	/* SDRAM Controller Mode Register */
>  #define		AT91_SDRAMC_MODE	(0xf << 0)		/* Command Mode */
> diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
> index 0234fd9..96dd8e1 100644
> --- a/arch/arm/mach-at91/include/mach/uncompress.h
> +++ b/arch/arm/mach-at91/include/mach/uncompress.h
> @@ -23,6 +23,7 @@
>  
>  #include <linux/io.h>
>  #include <linux/atmel_serial.h>
> +#include <mach/at91_io.h>
>  
>  #if defined(CONFIG_AT91_EARLY_DBGU0)
>  #define UART_OFFSET AT91_BASE_DBGU0
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 1606379..f099c3e 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -27,6 +27,7 @@
>  
>  #include <mach/at91_pmc.h>
>  #include <mach/cpu.h>
> +#include <mach/at91_io.h>
>  
>  #include "generic.h"
>  #include "pm.h"
> diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
> index 7eb40d2..ac12592 100644
> --- a/arch/arm/mach-at91/pm.h
> +++ b/arch/arm/mach-at91/pm.h
> @@ -1,3 +1,5 @@
> +#include <mach/at91_io.h>
> +
>  #ifdef CONFIG_ARCH_AT91RM9200
>  #include <mach/at91rm9200_mc.h>
>  
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index 69d3fc4..cee8156 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -17,6 +17,7 @@
>  #include <mach/at91_dbgu.h>
>  #include <mach/at91_pmc.h>
>  #include <mach/at91_shdwc.h>
> +#include <mach/at91_io.h>
>  
>  #include "soc.h"
>  #include "generic.h"
> diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
> index 4902206..3edf52b 100644
> --- a/drivers/pcmcia/at91_cf.c
> +++ b/drivers/pcmcia/at91_cf.c
> @@ -26,6 +26,7 @@
>  
>  #include <mach/board.h>
>  #include <mach/at91rm9200_mc.h>
> +#include <mach/at91_io.h>
>  
>  
>  /*
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index a3ad957..d044f55 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -23,7 +23,7 @@
>  #include <mach/board.h>
>  #include <mach/at91_rtt.h>
>  #include <mach/cpu.h>
> -
> +#include <mach/at91_io.h>
>  
>  /*
>   * This driver uses two configurable hardware resources that live in the
> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
> index 143a725..e9da936 100644
> --- a/drivers/usb/gadget/at91_udc.c
> +++ b/drivers/usb/gadget/at91_udc.c
> @@ -41,6 +41,7 @@
>  #include <mach/board.h>
>  #include <mach/cpu.h>
>  #include <mach/at91sam9261_matrix.h>
> +#include <mach/at91_io.h>
>  
>  #include "at91_udc.h"
>  
> diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c
> index b3046dc..4073312 100644
> --- a/drivers/watchdog/at91rm9200_wdt.c
> +++ b/drivers/watchdog/at91rm9200_wdt.c
> @@ -22,6 +22,7 @@
>  #include <linux/types.h>
>  #include <linux/watchdog.h>
>  #include <linux/uaccess.h>
> +#include <mach/at91_io.h>
>  #include <mach/at91_st.h>
>  
>  #define WDT_DEFAULT_TIME	5	/* seconds */
> diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
> index 0056256..d4c0576 100644
> --- a/drivers/watchdog/at91sam9_wdt.c
> +++ b/drivers/watchdog/at91sam9_wdt.c
> @@ -31,6 +31,7 @@
>  #include <linux/bitops.h>
>  #include <linux/uaccess.h>
>  
> +#include <mach/at91_io.h>
>  #include "at91sam9_wdt.h"
>  
>  #define DRV_NAME "AT91SAM9 Watchdog"


-- 
Nicolas Ferre

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-14  9:21   ` Nicolas Ferre
@ 2012-02-14 13:24     ` Rob Herring
  2012-02-16  7:43       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14 13:24 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
> On 02/13/2012 10:43 PM, Rob Herring :
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> Move most of io.h into at91_io.h and update includes.
>>
>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>> ---
>>  arch/arm/mach-at91/at91cap9.c                     |    1 +
>>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
> 
> Please do not touch the "*cap9*" files anymore: They are scheduled for
> removal for 3.4 kernel:
> Documentation/feature-removal-schedule.txt

Okay.

> 
>>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
>>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
>>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
>>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
>>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
>>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
>>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
>>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
>>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
>>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
>>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
>>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
>>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
>>  arch/arm/mach-at91/at91x40.c                      |    1 +
>>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
>>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
>>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
>>  arch/arm/mach-at91/board-eco920.c                 |    1 +
>>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
>>  arch/arm/mach-at91/clock.c                        |    1 +
>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
>>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
>>  arch/arm/mach-at91/pm.c                           |    1 +
>>  arch/arm/mach-at91/pm.h                           |    2 +
>>  arch/arm/mach-at91/setup.c                        |    1 +
>>  drivers/pcmcia/at91_cf.c                          |    1 +
>>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
>>  drivers/usb/gadget/at91_udc.c                     |    1 +
>>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
>>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
>>  34 files changed, 80 insertions(+), 1 deletions(-)
>>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
>>

snip

>> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>> index e2f8da8..0427212 100644
>> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>> @@ -12,6 +12,8 @@
>>  #ifndef AT91SAM9_DDRSDR_H
>>  #define AT91SAM9_DDRSDR_H
>>  
>> +#include <mach/at91_io.h>
> 
> Do we need this include in header files?

Yes, for at91_sys_write/read used at the bottom.

Rob

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14  8:04         ` Arnd Bergmann
@ 2012-02-14 14:36           ` Rob Herring
  2012-02-14 17:16             ` Arnd Bergmann
  2012-02-27 22:31           ` Rob Herring
  1 sibling, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14 14:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Rob Herring wrote:
>> Arnd,
>>
>> On 02/13/2012 08:03 PM, Arnd Bergmann wrote:
>>> On Monday 13 February 2012, Russell King - ARM Linux wrote:
>>>> On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
>>>>> From: Rob Herring <rob.herring@calxeda.com>
>>>>>
>>>>> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
>>>>>
>>>>> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
>>>>> platforms don't need mach/io.h, but ebsa110 does.
>>>>
>>>> This is architecturally wrong.  If you have ISA, and your __io() macro
>>>> is essentially a 1:1 translation, you're asking for ISA drivers to
>>>> scribble on whatever is at virtual address 0-64K.  Too bad if that
>>>> happens to be where your CPU vectors are stored, you'll lose control
>>>> of the CPU in that case.
>>>
>>> Right. I still think it should be conditional on PCI || ISA || PCMCIA,
>>> not introducing a new kconfig symbol, and the next step should be to
>>> unify the __io() implementations for the platforms that need them.
>>
>> As we discussed at Connect, that was my original intent. However, there
>> are a couple of issues as NEED_MACH_IO_H is not exactly equivalent to
>> PCI || ISA || PCMCIA.
>>
>> There are a few platforms which still need io.h for custom accessor
>> functions: rpc, ixp4xx, s3c2410, and ebsa110.
> 
> I've tried to interpret what is there, please correct me if this is wrong:
> 
> RPC and ebsa110 have ISA, or some twisted version of that. I believe
> RPC doesn't select CONFIG_ISA because it has no actual ISA slots but
> it still uses legacy ISA I/O and we might just select it anyway.
> 
> s3c24xx seems to have ISA in a similar way on the "bast" machine,
> while the setup code for that got copied into some platforms that
> don't really require it.
> 
> ixp4xx has PCI, but does not always use direct MMIO to access the
> memory or I/O spaces.
> 
> I guess the only way we can ever make these ones use a common header
> file (in case we care) by letting them go through an indirect
> struct io_ops { u8 (*inb)(int); void (*outb)(u8, int); ... };,
> but we might not care enough.
> 
>> Also, a few platforms that
>> only select ISA don't do any translation in __io(). These are sa1100,
>> clps711x, and pxa. My understanding is that is wrong.
> 
> sa1100 has pcmcia slots that use their own method (setting io_offset)
> of redirecting the i/o space into the right location. As Russell
> mentioned, this is broken if you load an ISA device driver that
> uses hardcoded port numbers, or as I might add when you use /dev/port.
> 
> pxa seems to do the same as sa1100 for PCMCIA and PCI, but I can't figure
> out what they do for ISA. I suspect they only enable that in order to
> get ISA device drivers for PCMCIA based add-on cards.
> 
> clps711x for all I can tell is broken as you say.
> 
> I think omap1 and at91 fit into the same category as sa1100 and pxa
> regarding pcmcia. All four can in theory be converted to use a
> common virtual mapping as we want to have for PCI.
> 
>> If we use CONFIG_PCI, then we have to move over all PCI enabled
>> platforms at once. With a separate kconfig option, then we can move
>> platforms one by one. Some are legacy and we may not want to move. This
>> also helped with omap, but Tony has now fixed it.
> 
> We could also generalize the implementation from tegra, which seems
> reasonable as a start:
> 
> 
> #define IO_SPACE_LIMIT 0xffff
> 
> #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> #include <mach/io.h>
> #elif defined(CONFIG_PCI)
> extern void __iomem *pci_io_base;
> 
> static inline void __iomem *__io(unsigned long addr)
> {
>         return pci_io_base + (addr & IO_SPACE_LIMIT);

But don't we want a constant pci_io_base? This would certainly be a
quicker conversion, but I don't think we want to do it twice.

> }
> #else
> static inline void __iomem *__io(unsigned long addr)
> {
>         return NULL;
> }
> #endif
> #define __io(a) __io(a)
> 
> Out of the platforms supporting PCI right now, we currently have these three classes:
> 
> 1. portable, but using different virtual addresses:
> arch/arm/mach-integrator/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCI_IO_VADDR + (a)))
> arch/arm/mach-ixp23xx/include/mach/io.h:#define __io(p)         ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
> arch/arm/mach-ixp2000/include/mach/io.h:#define __io(p)                 ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
> arch/arm/mach-shark/include/mach/io.h:#define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
> arch/arm/mach-footbridge/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCIO_BASE + (a)))
> arch/arm/mach-tegra/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> arch/arm/mach-kirkwood/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> arch/arm/mach-dove/include/mach/io.h:#define __io(a)    ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
> 
> 2. Does not map the I/O space, or does not use it -- I cannot see how
>    any of these use PIO based PCI devices at all, probably broken already:
> arch/arm/mach-cns3xxx/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
> arch/arm/mach-ixp4xx/include/mach/io.h:#define  __io(v)         __typesafe_io(v)
> arch/arm/mach-ks8695/include/mach/io.h:#define __io(a)          __typesafe_io(a)
> arch/arm/mach-orion5x/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
> arch/arm/mach-sa1100/include/mach/io.h:#define __io(a)          __typesafe_io(a)
> arch/arm/mach-pxa/include/mach/io.h:#define __io(a)             __typesafe_io(a)
> arch/arm/mach-versatile/include/mach/io.h:#define __io(a)               __typesafe_io(a)
> 
> 3. scary multi-way translation, needs someone to really understand (Nico?, Lennert?)
> arch/arm/mach-iop32x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> arch/arm/mach-iop33x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> arch/arm/mach-iop13xx/include/mach/io.h:#define __io(a) __iop13xx_io(a)
> arch/arm/mach-mv78xx0/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> 
> I think if we can figure out the third category, this should all become
> fairly easy for PCI based platforms.
> 

This looks correct AFAICT.

We could just call the 3rd category legacy and move on.

Rob

> 
> 	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 14:36           ` Rob Herring
@ 2012-02-14 17:16             ` Arnd Bergmann
  2012-02-14 17:40               ` Russell King - ARM Linux
  2012-02-27 19:31               ` Rob Herring
  0 siblings, 2 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14 17:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Rob Herring wrote:
> On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
> > On Tuesday 14 February 2012, Rob Herring wrote:
> > 
> >> If we use CONFIG_PCI, then we have to move over all PCI enabled
> >> platforms at once. With a separate kconfig option, then we can move
> >> platforms one by one. Some are legacy and we may not want to move. This
> >> also helped with omap, but Tony has now fixed it.
> > 
> > We could also generalize the implementation from tegra, which seems
> > reasonable as a start:
> > 
> > 
> > #define IO_SPACE_LIMIT 0xffff
> > 
> > #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> > #include <mach/io.h>
> > #elif defined(CONFIG_PCI)
> > extern void __iomem *pci_io_base;
> > 
> > static inline void __iomem *__io(unsigned long addr)
> > {
> >         return pci_io_base + (addr & IO_SPACE_LIMIT);
> 
> But don't we want a constant pci_io_base? This would certainly be a
> quicker conversion, but I don't think we want to do it twice.

Yes, at least in the long run. Note that this should make no difference
at all from a performance point of view, but it does impact code size a bit.

> > }
> > #else
> > static inline void __iomem *__io(unsigned long addr)
> > {
> >         return NULL;
> > }
> > #endif
> > #define __io(a) __io(a)
> > 
> > Out of the platforms supporting PCI right now, we currently have these three classes:
> > 
> > 1. portable, but using different virtual addresses:
> > arch/arm/mach-integrator/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCI_IO_VADDR + (a)))
> > arch/arm/mach-ixp23xx/include/mach/io.h:#define __io(p)         ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
> > arch/arm/mach-ixp2000/include/mach/io.h:#define __io(p)                 ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
> > arch/arm/mach-shark/include/mach/io.h:#define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
> > arch/arm/mach-footbridge/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCIO_BASE + (a)))
> > arch/arm/mach-tegra/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> > arch/arm/mach-kirkwood/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> > arch/arm/mach-dove/include/mach/io.h:#define __io(a)    ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
> > 
> > 2. Does not map the I/O space, or does not use it -- I cannot see how
> >    any of these use PIO based PCI devices at all, probably broken already:
> > arch/arm/mach-cns3xxx/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
> > arch/arm/mach-ixp4xx/include/mach/io.h:#define  __io(v)         __typesafe_io(v)
> > arch/arm/mach-ks8695/include/mach/io.h:#define __io(a)          __typesafe_io(a)
> > arch/arm/mach-orion5x/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
> > arch/arm/mach-sa1100/include/mach/io.h:#define __io(a)          __typesafe_io(a)
> > arch/arm/mach-pxa/include/mach/io.h:#define __io(a)             __typesafe_io(a)
> > arch/arm/mach-versatile/include/mach/io.h:#define __io(a)               __typesafe_io(a)
> > 
> > 3. scary multi-way translation, needs someone to really understand (Nico?, Lennert?)
> > arch/arm/mach-iop32x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> > arch/arm/mach-iop33x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> > arch/arm/mach-iop13xx/include/mach/io.h:#define __io(a) __iop13xx_io(a)
> > arch/arm/mach-mv78xx0/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> > 
> > I think if we can figure out the third category, this should all become
> > fairly easy for PCI based platforms.
> > 
> 
> This looks correct AFAICT.
> 
> We could just call the 3rd category legacy and move on.

I'm not ready to give up that fast. The platforms seem to be implemented
reasonably well compared to category 2, but they can't be converted in
a completely mechanical way. The patch below should put iop13xx it into
category 1, but it really needs testing and review by a person who
understands that platform. I can also take a look at the others if we
agree that this is the right approach.

When we have all platforms done in that way, we can move the virtual
mapping base to a fixed location.

8<--------------
[PATCH] iop13xx: use more regular PCI I/O space handling

iop13xx confuses I/O port numbers with physical addresses, which breaks
legacy ISA I/O access behind PCI bridges and makes it unnecessarily hard
to unify the inb/outb accessors with other platforms. This removes the
special-casing and just puts all I/O ports into a single 128KB virtually
mapped I/O port range starting at port zero.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-iop13xx/include/mach/io.h      |    6 +++-
 arch/arm/mach-iop13xx/include/mach/iop13xx.h |   12 ++--------
 arch/arm/mach-iop13xx/io.c                   |   27 --------------------------
 arch/arm/mach-iop13xx/pci.c                  |   12 +++++-----
 4 files changed, 13 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-iop13xx/include/mach/io.h b/arch/arm/mach-iop13xx/include/mach/io.h
index dffb234..90bb7df 100644
--- a/arch/arm/mach-iop13xx/include/mach/io.h
+++ b/arch/arm/mach-iop13xx/include/mach/io.h
@@ -19,9 +19,11 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
+#include <mach/iop13xx.h>
 
-#define __io(a) __iop13xx_io(a)
+#define IO_SPACE_LIMIT (IOP13XX_PCIE_IO_WINDOW_SIZE + IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
+
+#define __io(a) (IOP13XX_PCIX_LOWER_IO_VA + ((a) & IO_SPACE_LIMIT))
 #define __mem_pci(a) (a)
 #define __mem_isa(a) (a)
 
diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
index 07e9ff7..ee1dfd2 100644
--- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
+++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
@@ -68,17 +68,15 @@ extern unsigned long get_iop_tick_rate(void);
  * 0x8000.0000 + 928M	0x2.8000.0000   (ioremap)	PCIE outbound memory window
  *
  * IO MAP
- * 0x1000 + 64K	0x0.fffb.1000	0xfec6.1000	PCIX outbound i/o window
+ * 0x1000 + 64K	0x0.fffb.1000	0xfed6.1000	PCIX outbound i/o window
  * 0x1000 + 64K	0x0.fffd.1000	0xfed7.1000	PCIE outbound i/o window
  */
 #define IOP13XX_PCIX_IO_WINDOW_SIZE   0x10000UL
 #define IOP13XX_PCIX_LOWER_IO_PA      0xfffb0000UL
-#define IOP13XX_PCIX_LOWER_IO_VA      0xfec60000UL
+#define IOP13XX_PCIX_LOWER_IO_VA      0xfed60000UL
 #define IOP13XX_PCIX_LOWER_IO_BA      0x0UL /* OIOTVR */
 #define IOP13XX_PCIX_IO_BUS_OFFSET    0x1000UL
-#define IOP13XX_PCIX_UPPER_IO_PA      (IOP13XX_PCIX_LOWER_IO_PA +\
-				       IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
-#define IOP13XX_PCIX_UPPER_IO_VA      (IOP13XX_PCIX_LOWER_IO_VA +\
+#define IOP13XX_PCIX_UPPER_IO_BA      (IOP13XX_PCIX_LOWER_IO_BA +\
 				       IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
 #define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
 					   (IOP13XX_PCIX_LOWER_IO_PA\
@@ -107,10 +105,6 @@ extern unsigned long get_iop_tick_rate(void);
 #define IOP13XX_PCIE_LOWER_IO_VA      	 0xfed70000UL
 #define IOP13XX_PCIE_LOWER_IO_BA      	 0x0UL  /* OIOTVR */
 #define IOP13XX_PCIE_IO_BUS_OFFSET	 0x1000UL
-#define IOP13XX_PCIE_UPPER_IO_PA      	 (IOP13XX_PCIE_LOWER_IO_PA +\
-					 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
-#define IOP13XX_PCIE_UPPER_IO_VA      	 (IOP13XX_PCIE_LOWER_IO_VA +\
-					 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
 #define IOP13XX_PCIE_UPPER_IO_BA      	 (IOP13XX_PCIE_LOWER_IO_BA +\
 					 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
 #define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
index 48642e6..7a1ab4d 100644
--- a/arch/arm/mach-iop13xx/io.c
+++ b/arch/arm/mach-iop13xx/io.c
@@ -21,25 +21,6 @@
 #include <linux/io.h>
 #include <mach/hardware.h>
 
-void * __iomem __iop13xx_io(unsigned long io_addr)
-{
-	void __iomem * io_virt;
-
-	switch (io_addr) {
-	case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
-		io_virt = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(io_addr);
-		break;
-	case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
-		io_virt = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(io_addr);
-		break;
-	default:
-		BUG();
-	}
-
-	return io_virt;
-}
-EXPORT_SYMBOL(__iop13xx_io);
-
 void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
 	unsigned int mtype)
 {
@@ -65,12 +46,6 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
 				       (cookie - IOP13XX_PBI_LOWER_MEM_RA),
 				       size, mtype, __builtin_return_address(0));
 		break;
-	case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
-		retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
-		break;
-	case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
-		retval = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(cookie);
-		break;
 	case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA:
 		retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
 		break;
@@ -100,8 +75,6 @@ void __iop13xx_iounmap(void __iomem *addr)
 		    goto skip;
 
 	switch ((u32) addr) {
-	case IOP13XX_PCIE_LOWER_IO_VA ... IOP13XX_PCIE_UPPER_IO_VA:
-	case IOP13XX_PCIX_LOWER_IO_VA ... IOP13XX_PCIX_UPPER_IO_VA:
 	case IOP13XX_PMMR_VIRT_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_VA:
 		goto skip;
 	}
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index b8f5a87..d72eddf 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -1042,8 +1042,8 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
 				  << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
 		__raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
 
-		res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET;
-		res[0].end   = IOP13XX_PCIX_UPPER_IO_PA;
+		res[0].start = IOP13XX_PCIX_LOWER_IO_BA + IOP13XX_PCIX_IO_BUS_OFFSET;
+		res[0].end   = IOP13XX_PCIX_UPPER_IO_BA;
 		res[0].name  = "IQ81340 ATUX PCI I/O Space";
 		res[0].flags = IORESOURCE_IO;
 
@@ -1052,7 +1052,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
 		res[1].name  = "IQ81340 ATUX PCI Memory Space";
 		res[1].flags = IORESOURCE_MEM;
 		sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
-		sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA;
+		sys->io_offset = IOP13XX_PCIX_LOWER_IO_BA;
 		break;
 	case IOP13XX_INIT_ATU_ATUE:
 		/* Note: the function number field in the PCSR is ro */
@@ -1063,8 +1063,8 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
 
 		__raw_writel(pcsr, IOP13XX_ATUE_PCSR);
 
-		res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET;
-		res[0].end   = IOP13XX_PCIE_UPPER_IO_PA;
+		res[0].start = IOP13XX_PCIE_LOWER_IO_BA + IOP13XX_PCIE_IO_BUS_OFFSET;
+		res[0].end   = IOP13XX_PCIE_UPPER_IO_BA;
 		res[0].name  = "IQ81340 ATUE PCI I/O Space";
 		res[0].flags = IORESOURCE_IO;
 
@@ -1073,7 +1073,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
 		res[1].name  = "IQ81340 ATUE PCI Memory Space";
 		res[1].flags = IORESOURCE_MEM;
 		sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
-		sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA;
+		sys->io_offset = IOP13XX_PCIE_LOWER_IO_BA;
 		sys->map_irq = iop13xx_pcie_map_irq;
 		break;
 	default:

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14  3:20   ` Rob Herring
@ 2012-02-14 17:24     ` Tony Lindgren
  2012-02-14 17:57       ` Arnd Bergmann
  0 siblings, 1 reply; 74+ messages in thread
From: Tony Lindgren @ 2012-02-14 17:24 UTC (permalink / raw)
  To: linux-arm-kernel

* Rob Herring <robherring2@gmail.com> [120213 18:49]:
> On 02/13/2012 05:41 PM, Tony Lindgren wrote:
> > * Rob Herring <robherring2@gmail.com> [120213 13:12]:
> >>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++
> >>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
> >>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
> > ...
> >>  arch/arm/mach-msm/include/mach/msm_iomap-7x00.h   |    6 ++
> >>  arch/arm/mach-msm/include/mach/msm_iomap-7x30.h   |    4 ++
> >>  arch/arm/mach-msm/include/mach/msm_iomap-8960.h   |    4 ++
> >>  arch/arm/mach-msm/include/mach/msm_iomap-8x50.h   |    4 ++
> >>  arch/arm/mach-msm/include/mach/msm_iomap-8x60.h   |    4 ++
> > ...
> > 
> > Considering the naming above..
> > 
> >>  arch/arm/mach-tegra/include/mach/iomap.h          |   48 ++++++++++++++++++
> > 
> > ..should this be called tegra-iomap.h instead?
> 
> Probably, but it's not a new header. Fixing include paths or names is a
> separate problem when we start having multiple mach include directories.
> Perhaps we can get them removed altogether before we have to start
> renaming. Much of it is device addresses that will go in dts files.

Yes should be just the legacy drivers needing this for most part,
so that's currently most of omap1 drivers for us.

Anyways I'm using plat/omap-iomap.h for the name, so if somebody
has better ideas for naming to avoid further search and replace
later on, let me know.

I guess in the long run we could have

#include <mach-omap1/iomap.h>

instead of

#include <plat/omap-iomap.h>

as the plat can't be used for multi-subarch builds.

Regards,

Tony

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14  1:06     ` Arnd Bergmann
@ 2012-02-14 17:38       ` H Hartley Sweeten
  2012-02-14 18:20         ` Arnd Bergmann
  0 siblings, 1 reply; 74+ messages in thread
From: H Hartley Sweeten @ 2012-02-14 17:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, February 13, 2012 6:07 PM, Arnd Bergmann wrote:
> On Monday 13 February 2012, H Hartley Sweeten wrote:
>>> +#ifdef CONFIG_NEED_MACH_IO_H
>>>  #include <mach/io.h>
>>> +#else
>>> +#define __io(a)              ({ (void)(a); __typesafe_io(0); })
>>> +#define __mem_pci(a) (a)
>>> +#endif
>> 
>> Rob,
>> 
>> I compile and boot tested these patches on EP93xxbut did not check them
>> with sparse.
>> 
>> Most of the mach/io.h headers you remove in Patch 14/15 have the __io
>> macro defined like:
>> 
>> #define __io(a)         __typesafe_io(a)
>> 
>> Does your change above still keep the __io macro typesafe?
>> 
>> They don't appear equivalent to me...
>
> It's not equivalent, but the new version is more correct for most
> platforms because it turns a random pointer dereference into a NULL
> pointer dereference.
>
> If you have none of PCI/ISA/PCMCIA, then inb/outb should never be
> used. Ideally we would undefine __io in that case, which results
> in the inb/outb stuff also not getting defined, but some drivers
> like 8250 serial then fail to build even for systems that only
> use the readl/writel path.

Sorry... I don't quite understand the change here.

__typesafe_io is an inline function in asm/io.h. Most of the mach/io.h
headers simply define __io to be __typesafe_io so they basically get
this:

void __iomem *__io(unsigned long addr)
{
	return (void __iomem *)addr;
}

With the change in Rob's patch they will get this:

void __iomem *__io(unsigned long addr)
{
	(void)addr;
	return (void __iomem *)(0);
}

If you then push these into something like the outb macro you get this:

#define outb(v,p)	({ __iowmb(); __raw_writeb(v,__io(p)); })

Original:

outb(v,p)
{
	__iowmb();
	__raw_writeb(v, (void __iomem*)p);
}

Rob's change:

outb(v,p)
{
	__iowmb();
	__raw_writeb(v, /* not sure what happens to the (void)p */ (void __iomem *)0);
}

To me the original one looks more correct. With Rob's change it looks to me like all
the in/out macros end up reading/writing to address 0.

I don't get what's happening in Rob's change. Could you enlighten me?

Regards,
Hartley

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 17:16             ` Arnd Bergmann
@ 2012-02-14 17:40               ` Russell King - ARM Linux
  2012-02-14 18:12                 ` Arnd Bergmann
  2012-02-14 23:09                 ` Rob Herring
  2012-02-27 19:31               ` Rob Herring
  1 sibling, 2 replies; 74+ messages in thread
From: Russell King - ARM Linux @ 2012-02-14 17:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 14, 2012 at 05:16:26PM +0000, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Rob Herring wrote:
> > On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
> > > On Tuesday 14 February 2012, Rob Herring wrote:
> > > 
> > >> If we use CONFIG_PCI, then we have to move over all PCI enabled
> > >> platforms at once. With a separate kconfig option, then we can move
> > >> platforms one by one. Some are legacy and we may not want to move. This
> > >> also helped with omap, but Tony has now fixed it.
> > > 
> > > We could also generalize the implementation from tegra, which seems
> > > reasonable as a start:
> > > 
> > > 
> > > #define IO_SPACE_LIMIT 0xffff
> > > 
> > > #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> > > #include <mach/io.h>
> > > #elif defined(CONFIG_PCI)
> > > extern void __iomem *pci_io_base;
> > > 
> > > static inline void __iomem *__io(unsigned long addr)
> > > {
> > >         return pci_io_base + (addr & IO_SPACE_LIMIT);
> > 
> > But don't we want a constant pci_io_base? This would certainly be a
> > quicker conversion, but I don't think we want to do it twice.
> 
> Yes, at least in the long run. Note that this should make no difference
> at all from a performance point of view, but it does impact code size a bit.

That depends whether the additional reloads of pci_io_base can be properly
scheduled by the compiler, and experience shows that you tend to end up
with the load delay slot _not_ being filled on older processors.

Not only that, but the compiler _will_ evaluate the entire:

	pci_io_base + (addr & IO_SPACE_LIMIT)

thing every time.  With a 64K mask, that will include _reloading_ the
mask every single access.

So, we'll probably end up with about three additional loads per IO
operation, none of which would be scheduled particularly well.

"Yuck" and "not in my kernel" comes to mind.

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 17:24     ` Tony Lindgren
@ 2012-02-14 17:57       ` Arnd Bergmann
  2012-02-14 18:28         ` Nicolas Pitre
  2012-02-14 19:41         ` Rob Herring
  0 siblings, 2 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14 17:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Tony Lindgren wrote:
> Yes should be just the legacy drivers needing this for most part,
> so that's currently most of omap1 drivers for us.
> 
> Anyways I'm using plat/omap-iomap.h for the name, so if somebody
> has better ideas for naming to avoid further search and replace
> later on, let me know.
> 
> I guess in the long run we could have
> 
> #include <mach-omap1/iomap.h>
> 
> instead of
> 
> #include <plat/omap-iomap.h>
> 
> as the plat can't be used for multi-subarch builds.

I think it /could/ be used, we just need to make a definite
decision which way we want to go for header files that
are defined by a platform and used by code outside of that
platform such as device drivers.

The two main approaches that I can see are

a) make every header file name unique for platforms that you want to
build together, and just add every path at the compiler command line.
Not too much work, but somewhat error prone when you start having
file name conflicts.

b) move all platform specific header files into a directory named after
the platform and change all device drivers using this. Lots of work, but
probably better in the long run.

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 17:40               ` Russell King - ARM Linux
@ 2012-02-14 18:12                 ` Arnd Bergmann
  2012-02-14 23:09                 ` Rob Herring
  1 sibling, 0 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14 18:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Russell King - ARM Linux wrote:
> > Yes, at least in the long run. Note that this should make no difference
> > at all from a performance point of view, but it does impact code size a bit.
> 
> That depends whether the additional reloads of pci_io_base can be properly
> scheduled by the compiler, and experience shows that you tend to end up
> with the load delay slot not being filled on older processors.
> 
> Not only that, but the compiler will evaluate the entire:
> 
>         pci_io_base + (addr & IO_SPACE_LIMIT)
> 
> thing every time.  With a 64K mask, that will include reloading the
> mask every single access.
> 
> So, we'll probably end up with about three additional loads per IO
> operation, none of which would be scheduled particularly well.
> 
> "Yuck" and "not in my kernel" comes to mind.

I totally agree with the code size point, but my point above was that
from performance perspective all that you mentioned should be dwarfed
by the overhead of actually doing a synchronous operation on an
external bus. writel may be reasonably fast on a CPU internal bus,
but inb/outb implies a full bus synchronization and is only
used on older PCI hardware, typically those that date back to
ISA in some form.

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 17:38       ` H Hartley Sweeten
@ 2012-02-14 18:20         ` Arnd Bergmann
  0 siblings, 0 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, H Hartley Sweeten wrote:

> outb(v,p)
> {
>         __iowmb();
>         __raw_writeb(v, /* not sure what happens to the (void)p */ (void __iomem *)0);
> }
> 
> To me the original one looks more correct. With Rob's change it looks to me like all
> the in/out macros end up reading/writing to address 0.

Correct.

> I don't get what's happening in Rob's change. Could you enlighten me?

This is the version that gets used when you have neither PCI nor ISA/PCMCIA.

Ideally we would turn outb into an undefined symbol so that we get a 
build error if someone tries to create a kernel that uses outb while
not providing any buses on which it has an effect. Doing that would
depend on a patch series that I started before but never completed,
to ensure that we don't actually try to build device drivers with port
I/O unless we also support one of the buses. The main problem is the 8250
device driver.

The macro from Rob's version always does a NULL pointer dereference, which
is still a bug, but much better than having a potential root hole from
letting (incorrectly built) ISA drivers poke at random addresses.

I guess it would make sense to split this patch into two separate ones,
one that moves all bogus definitions into a common place, and one that
changes them to the NULL pointer dereference.

	Arnd

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 17:57       ` Arnd Bergmann
@ 2012-02-14 18:28         ` Nicolas Pitre
  2012-02-14 19:41         ` Rob Herring
  1 sibling, 0 replies; 74+ messages in thread
From: Nicolas Pitre @ 2012-02-14 18:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 14 Feb 2012, Arnd Bergmann wrote:

> On Tuesday 14 February 2012, Tony Lindgren wrote:
> > Yes should be just the legacy drivers needing this for most part,
> > so that's currently most of omap1 drivers for us.
> > 
> > Anyways I'm using plat/omap-iomap.h for the name, so if somebody
> > has better ideas for naming to avoid further search and replace
> > later on, let me know.
> > 
> > I guess in the long run we could have
> > 
> > #include <mach-omap1/iomap.h>
> > 
> > instead of
> > 
> > #include <plat/omap-iomap.h>
> > 
> > as the plat can't be used for multi-subarch builds.
> 
> I think it /could/ be used, we just need to make a definite
> decision which way we want to go for header files that
> are defined by a platform and used by code outside of that
> platform such as device drivers.
> 
> The two main approaches that I can see are
> 
> a) make every header file name unique for platforms that you want to
> build together, and just add every path at the compiler command line.
> Not too much work, but somewhat error prone when you start having
> file name conflicts.

The preprocessor will happily take the first file that matches in its 
search path, masking any other files with the same name.  That can 
become rather confusing.

> b) move all platform specific header files into a directory named after
> the platform and change all device drivers using this. Lots of work, but
> probably better in the long run.

I clearly favor (b).


Nicolas

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 17:57       ` Arnd Bergmann
  2012-02-14 18:28         ` Nicolas Pitre
@ 2012-02-14 19:41         ` Rob Herring
  2012-02-14 20:43           ` Tony Lindgren
  1 sibling, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14 19:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 11:57 AM, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Tony Lindgren wrote:
>> Yes should be just the legacy drivers needing this for most part,
>> so that's currently most of omap1 drivers for us.
>>
>> Anyways I'm using plat/omap-iomap.h for the name, so if somebody
>> has better ideas for naming to avoid further search and replace
>> later on, let me know.
>>
>> I guess in the long run we could have
>>
>> #include <mach-omap1/iomap.h>
>>
>> instead of
>>
>> #include <plat/omap-iomap.h>
>>
>> as the plat can't be used for multi-subarch builds.
> 
> I think it /could/ be used, we just need to make a definite
> decision which way we want to go for header files that
> are defined by a platform and used by code outside of that
> platform such as device drivers.
> 
> The two main approaches that I can see are
> 
> a) make every header file name unique for platforms that you want to
> build together, and just add every path at the compiler command line.
> Not too much work, but somewhat error prone when you start having
> file name conflicts.
> 
> b) move all platform specific header files into a directory named after
> the platform and change all device drivers using this. Lots of work, but
> probably better in the long run.
> 

c) Don't allow mach includes in drivers and sound dirs for
multi-platform kernels. This is already the case for any multi-arch
driver. A lot of the headers are platform_data structs or things that
should be cleaned up or need common infrastructure. Some cases I've
found seem like the include is unnecessary. Also, just fixing up the
name or path is no guarantee of avoiding namespace collisions.

Rob

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 19:41         ` Rob Herring
@ 2012-02-14 20:43           ` Tony Lindgren
  2012-02-14 21:26             ` Arnd Bergmann
  0 siblings, 1 reply; 74+ messages in thread
From: Tony Lindgren @ 2012-02-14 20:43 UTC (permalink / raw)
  To: linux-arm-kernel

* Rob Herring <robherring2@gmail.com> [120214 11:10]:
> On 02/14/2012 11:57 AM, Arnd Bergmann wrote:
> > On Tuesday 14 February 2012, Tony Lindgren wrote:
> >> Yes should be just the legacy drivers needing this for most part,
> >> so that's currently most of omap1 drivers for us.
> >>
> >> Anyways I'm using plat/omap-iomap.h for the name, so if somebody
> >> has better ideas for naming to avoid further search and replace
> >> later on, let me know.
> >>
> >> I guess in the long run we could have
> >>
> >> #include <mach-omap1/iomap.h>
> >>
> >> instead of
> >>
> >> #include <plat/omap-iomap.h>
> >>
> >> as the plat can't be used for multi-subarch builds.
> > 
> > I think it /could/ be used, we just need to make a definite
> > decision which way we want to go for header files that
> > are defined by a platform and used by code outside of that
> > platform such as device drivers.
> > 
> > The two main approaches that I can see are
> > 
> > a) make every header file name unique for platforms that you want to
> > build together, and just add every path at the compiler command line.
> > Not too much work, but somewhat error prone when you start having
> > file name conflicts.
> > 
> > b) move all platform specific header files into a directory named after
> > the platform and change all device drivers using this. Lots of work, but
> > probably better in the long run.
> > 
> 
> c) Don't allow mach includes in drivers and sound dirs for
> multi-platform kernels. This is already the case for any multi-arch
> driver. A lot of the headers are platform_data structs or things that
> should be cleaned up or need common infrastructure. Some cases I've
> found seem like the include is unnecessary. Also, just fixing up the
> name or path is no guarantee of avoiding namespace collisions.

Out of the three options c) makes most sense for multi-subarch kernels.
And that avoids having to sort out the name collisions with defines.

For dealing with legacy platforms, I too would prefer b).

Regards,

Tony

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 20:43           ` Tony Lindgren
@ 2012-02-14 21:26             ` Arnd Bergmann
  2012-02-14 21:54               ` Rob Herring
  0 siblings, 1 reply; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Tony Lindgren wrote:
> > c) Don't allow mach includes in drivers and sound dirs for
> > multi-platform kernels. This is already the case for any multi-arch
> > driver. A lot of the headers are platform_data structs or things that
> > should be cleaned up or need common infrastructure. Some cases I've
> > found seem like the include is unnecessary. Also, just fixing up the
> > name or path is no guarantee of avoiding namespace collisions.
> 
> Out of the three options c) makes most sense for multi-subarch kernels.
> And that avoids having to sort out the name collisions with defines.

I agree that this is the ideal, but as far as I can tell, we have a
significant amount of functions that are defined in platform specific
code but used in platform specific drivers. E.g. when you have a
piece of code dealing with system management registers in your platform,
that would be used in the cpufreq, irqchip, watchdog and more drivers.

There has to be some place where we can put function declarations
for stuff like this, while at the same time we should try to minimise
the amount that is required.

> For dealing with legacy platforms, I too would prefer b).

How about this:

* We stop providing arch/arm/{mach,plat}-*/include/ to C files
outside of arch/arm/{mach,plat}-* when CONFIG_MULTIPLATFORM is
enabled.

* Any symbol that is required to be visible in device drivers
gets declared in arch/arm/include/mach-*/*.h, but we are very
careful about adding only the absolute minimum here.

	Arnd

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 21:26             ` Arnd Bergmann
@ 2012-02-14 21:54               ` Rob Herring
  2012-02-14 22:38                 ` Arnd Bergmann
  0 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 03:26 PM, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Tony Lindgren wrote:
>>> c) Don't allow mach includes in drivers and sound dirs for
>>> multi-platform kernels. This is already the case for any multi-arch
>>> driver. A lot of the headers are platform_data structs or things that
>>> should be cleaned up or need common infrastructure. Some cases I've
>>> found seem like the include is unnecessary. Also, just fixing up the
>>> name or path is no guarantee of avoiding namespace collisions.
>>
>> Out of the three options c) makes most sense for multi-subarch kernels.
>> And that avoids having to sort out the name collisions with defines.
> 
> I agree that this is the ideal, but as far as I can tell, we have a
> significant amount of functions that are defined in platform specific
> code but used in platform specific drivers. E.g. when you have a
> piece of code dealing with system management registers in your platform,
> that would be used in the cpufreq, irqchip, watchdog and more drivers.

>From my quick survey, those categories are really the exception. I would
guess platform_data structs is at least half of it. Older platforms seem
to be another big chunk.

Lack of a common usb phy infrastructure is another example of custom
platform functions (tegra usb_phy.h).

> There has to be some place where we can put function declarations
> for stuff like this, while at the same time we should try to minimise
> the amount that is required.
> 
>> For dealing with legacy platforms, I too would prefer b).
> 
> How about this:
> 
> * We stop providing arch/arm/{mach,plat}-*/include/ to C files
> outside of arch/arm/{mach,plat}-* when CONFIG_MULTIPLATFORM is
> enabled.
> 
> * Any symbol that is required to be visible in device drivers
> gets declared in arch/arm/include/mach-*/*.h, but we are very
> careful about adding only the absolute minimum here.

Why not include/linux? Any includes for drivers which are either
multiple arches (ahci_platform.h) or multiple ARM machines
(linux/amba/pl061.h) are already there. Every platform trying to dump
dozens of includes there would certainly get attention and force some
clean-up.

Rob

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-14 21:54               ` Rob Herring
@ 2012-02-14 22:38                 ` Arnd Bergmann
  0 siblings, 0 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-14 22:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Rob Herring wrote:
> > I agree that this is the ideal, but as far as I can tell, we have a
> > significant amount of functions that are defined in platform specific
> > code but used in platform specific drivers. E.g. when you have a
> > piece of code dealing with system management registers in your platform,
> > that would be used in the cpufreq, irqchip, watchdog and more drivers.
> 
> From my quick survey, those categories are really the exception. I would
> guess platform_data structs is at least half of it. Older platforms seem
> to be another big chunk.

Good to hear. We can certainly take care of the platform data by moving
it to include/linux/platform_data/*.h and the older platforms can
usually keep exporting their header files because we won't get them
to build into the same kernel with other platforms.

> Lack of a common usb phy infrastructure is another example of custom
> platform functions (tegra usb_phy.h).

Good point.

> > * Any symbol that is required to be visible in device drivers
> > gets declared in arch/arm/include/mach-*/*.h, but we are very
> > careful about adding only the absolute minimum here.
> 
> Why not include/linux? Any includes for drivers which are either
> multiple arches (ahci_platform.h) or multiple ARM machines
> (linux/amba/pl061.h) are already there. Every platform trying to dump
> dozens of includes there would certainly get attention and force some
> clean-up.

I strongly believe that any header file should be as localized as possible:

a) no header, all declarations in the one file using it
b) header file in local directory
c) header file in per-platform directory
d) header file in per-architecture directory
e) global header file

We need to get rid of category c in order to make cross-platform kernels
work. Ideally we would move everything into categories a and b, which is
often possible, but for those cases where it doesn't work the logical step
is to have it in arch specific code, not global.

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 17:40               ` Russell King - ARM Linux
  2012-02-14 18:12                 ` Arnd Bergmann
@ 2012-02-14 23:09                 ` Rob Herring
  2012-02-14 23:43                   ` Russell King - ARM Linux
  1 sibling, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-14 23:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 11:40 AM, Russell King - ARM Linux wrote:
> On Tue, Feb 14, 2012 at 05:16:26PM +0000, Arnd Bergmann wrote:
>> On Tuesday 14 February 2012, Rob Herring wrote:
>>> On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
>>>> On Tuesday 14 February 2012, Rob Herring wrote:
>>>>
>>>>> If we use CONFIG_PCI, then we have to move over all PCI enabled
>>>>> platforms at once. With a separate kconfig option, then we can move
>>>>> platforms one by one. Some are legacy and we may not want to move. This
>>>>> also helped with omap, but Tony has now fixed it.
>>>>
>>>> We could also generalize the implementation from tegra, which seems
>>>> reasonable as a start:
>>>>
>>>>
>>>> #define IO_SPACE_LIMIT 0xffff
>>>>
>>>> #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
>>>> #include <mach/io.h>
>>>> #elif defined(CONFIG_PCI)
>>>> extern void __iomem *pci_io_base;
>>>>
>>>> static inline void __iomem *__io(unsigned long addr)
>>>> {
>>>>         return pci_io_base + (addr & IO_SPACE_LIMIT);
>>>
>>> But don't we want a constant pci_io_base? This would certainly be a
>>> quicker conversion, but I don't think we want to do it twice.
>>
>> Yes, at least in the long run. Note that this should make no difference
>> at all from a performance point of view, but it does impact code size a bit.
> 
> That depends whether the additional reloads of pci_io_base can be properly
> scheduled by the compiler, and experience shows that you tend to end up
> with the load delay slot _not_ being filled on older processors.
> 
> Not only that, but the compiler _will_ evaluate the entire:
> 
> 	pci_io_base + (addr & IO_SPACE_LIMIT)
> 
> thing every time.  With a 64K mask, that will include _reloading_ the
> mask every single access.
> 
> So, we'll probably end up with about three additional loads per IO
> operation, none of which would be scheduled particularly well.
> 
> "Yuck" and "not in my kernel" comes to mind.

What about something like this:

io.h:
#define PCI_IO_VIRT_BASE 0xfef00000

arch/arm/common/pci.c (new file):
static struct map_desc pci_io_desc[] __initdata = {
	{
		.virtual	= PCI_IO_VIRT_BASE,
		.pfn		= 0,
		.length		= SZ_1M,
		.type		= MT_DEVICE,
	},
};

void __init pci_map_io(unsigned long paddr)
{
	pci_io_desc[0].pfn = __phys_to_pfn(paddr);
	iotable_init(pci_io_desc, ARRAY_SIZE(pci_io_desc));
}


This is using the last 1MB of vmalloc region. This may require some
adjustment of platform's static memory, but most PCI platforms I've
checked don't use this address, so it shouldn't be too painful.

orion5x maps 2 1MB regions for PCI and PCIE. How would you support 2 io
ranges?

BTW, I noticed some static mappings at 0xffxxxxxx. Are those even a
valid address?

Rob

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 23:09                 ` Rob Herring
@ 2012-02-14 23:43                   ` Russell King - ARM Linux
  2012-02-15  0:25                     ` Nicolas Pitre
  2012-02-15  0:57                     ` Arnd Bergmann
  0 siblings, 2 replies; 74+ messages in thread
From: Russell King - ARM Linux @ 2012-02-14 23:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 14, 2012 at 05:09:01PM -0600, Rob Herring wrote:
> What about something like this:
> 
> io.h:
> #define PCI_IO_VIRT_BASE 0xfef00000
> 
> arch/arm/common/pci.c (new file):
> static struct map_desc pci_io_desc[] __initdata = {
> 	{
> 		.virtual	= PCI_IO_VIRT_BASE,
> 		.pfn		= 0,
> 		.length		= SZ_1M,
> 		.type		= MT_DEVICE,
> 	},
> };
> 
> void __init pci_map_io(unsigned long paddr)
> {
> 	pci_io_desc[0].pfn = __phys_to_pfn(paddr);
> 	iotable_init(pci_io_desc, ARRAY_SIZE(pci_io_desc));
> }
> 
> 
> This is using the last 1MB of vmalloc region. This may require some
> adjustment of platform's static memory, but most PCI platforms I've
> checked don't use this address, so it shouldn't be too painful.

Yes, something like that.  There's arch/arm/kernel/isa.c which could
take this, which only a few platforms use (it allows glibc inb() etc
to work.)

> orion5x maps 2 1MB regions for PCI and PCIE. How would you support 2 io
> ranges?

That's not the only platform which effectively has two IO ranges.  The
PCMCIA sockets on SA11x0 and probably PXA both have their own separate
IO region.  Arnd's idea for this was to map 32k from one and 32k from
the other into a single 64k space, and adapt soc_common to cope.

> BTW, I noticed some static mappings at 0xffxxxxxx. Are those even a
> valid address?

Nothing invalid about them as such, but I have tried to discourage their
use in case we decide that we want to go for a default 14MB DMA region.

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 23:43                   ` Russell King - ARM Linux
@ 2012-02-15  0:25                     ` Nicolas Pitre
  2012-02-15 14:14                       ` Rob Herring
  2012-02-15  0:57                     ` Arnd Bergmann
  1 sibling, 1 reply; 74+ messages in thread
From: Nicolas Pitre @ 2012-02-15  0:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 14 Feb 2012, Russell King - ARM Linux wrote:

> On Tue, Feb 14, 2012 at 05:09:01PM -0600, Rob Herring wrote:
> > BTW, I noticed some static mappings at 0xffxxxxxx. Are those even a
> > valid address?
> 
> Nothing invalid about them as such, but I have tried to discourage their
> use in case we decide that we want to go for a default 14MB DMA region.

They should be invalid, and would be flagged by this code in 
create_mapping():

        if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
            md->virtual >= PAGE_OFFSET &&
            (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) 
        {
                printk(KERN_WARNING "BUG: mapping for 0x%08llx"
                       " at 0x%08lx out of vmalloc space\n",
                       (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
        }

given that VMALLOC_END is now defined as 0xff000000.

What are those static mappings at 0xffxxxxxx?  I was looking for them 
while reworking this code but I might have missed some.


Nicolas

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 23:43                   ` Russell King - ARM Linux
  2012-02-15  0:25                     ` Nicolas Pitre
@ 2012-02-15  0:57                     ` Arnd Bergmann
  1 sibling, 0 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-15  0:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 14 February 2012, Russell King - ARM Linux wrote:
> > orion5x maps 2 1MB regions for PCI and PCIE. How would you support 2 io
> > ranges?
> 
> That's not the only platform which effectively has two IO ranges.  The
> PCMCIA sockets on SA11x0 and probably PXA both have their own separate
> IO region.  Arnd's idea for this was to map 32k from one and 32k from
> the other into a single 64k space, and adapt soc_common to cope.

When going through the list today, I found that mv78xx0 in fact has eight
PCIe root complexes with their own I/O spaces.
This could still work with the method I suggested but it would limit
the I/O space per bus to 8kb, which is fairly small, so I'd still consider
using a 1MB space (allowing 16 separte 64 I/O windows) an equally
reasonable option.

> > BTW, I noticed some static mappings at 0xffxxxxxx. Are those even a
> > valid address?
> 
> Nothing invalid about them as such, but I have tried to discourage their
> use in case we decide that we want to go for a default 14MB DMA region.

We still have the option to either put the I/O spaces in the vmalloc area
where they typically are now, or (provided it's small enough) put them
into the fixmap area, which is a little under 1MB in total size and
almost entirely unused on ARM today.

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-15  0:25                     ` Nicolas Pitre
@ 2012-02-15 14:14                       ` Rob Herring
  0 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-15 14:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 06:25 PM, Nicolas Pitre wrote:
> On Tue, 14 Feb 2012, Russell King - ARM Linux wrote:
> 
>> On Tue, Feb 14, 2012 at 05:09:01PM -0600, Rob Herring wrote:
>>> BTW, I noticed some static mappings at 0xffxxxxxx. Are those even a
>>> valid address?
>>
>> Nothing invalid about them as such, but I have tried to discourage their
>> use in case we decide that we want to go for a default 14MB DMA region.
> 
> They should be invalid, and would be flagged by this code in 
> create_mapping():
> 
>         if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
>             md->virtual >= PAGE_OFFSET &&
>             (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) 
>         {
>                 printk(KERN_WARNING "BUG: mapping for 0x%08llx"
>                        " at 0x%08lx out of vmalloc space\n",
>                        (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
>         }
> 
> given that VMALLOC_END is now defined as 0xff000000.
> 
> What are those static mappings at 0xffxxxxxx?  I was looking for them 
> while reworking this code but I might have missed some.
> 

TS78XX_FPGA_REGS_VIRT_BASE
IXP4XX_PERIPHERAL_BASE_VIRT
IXP4XX_EXP_CFG_BASE_VIRT
IXP4XX_PCI_CFG_BASE_VIRT
IXP4XX_DEBUG_UART_BASE_VIRT
CLPS7111_VIRT_BASE
u300-regs.h
cns3xxx.h

Rob

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

* [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook
  2012-02-13 21:43 ` [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook Rob Herring
@ 2012-02-16  0:17   ` Shawn Guo
  0 siblings, 0 replies; 74+ messages in thread
From: Shawn Guo @ 2012-02-16  0:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 13, 2012 at 03:43:17PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Convert i.MX platforms to use the common run-time ioremap hook instead of
> the imx specific hook.
> 
> Also, move addr_in_module out of io.h.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>

Acked-by: Shawn Guo <shawn.guo@linaro.org>

-- 
Regards,
Shawn

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

* [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files
  2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
  2012-02-13 22:16   ` H Hartley Sweeten
@ 2012-02-16  0:19   ` Shawn Guo
  2012-02-16 18:57   ` Linus Walleij
  2 siblings, 0 replies; 74+ messages in thread
From: Shawn Guo @ 2012-02-16  0:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 13, 2012 at 03:43:27PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Now that many platforms don't need mach/io.h, remove the usused ones.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
...
>  delete mode 100644 arch/arm/mach-mxs/include/mach/io.h
...
>  delete mode 100644 arch/arm/plat-mxc/include/mach/io.h

Acked-by: Shawn Guo <shawn.guo@linaro.org>

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-14 13:24     ` Rob Herring
@ 2012-02-16  7:43       ` Jean-Christophe PLAGNIOL-VILLARD
  2012-02-16 14:08         ` Rob Herring
  0 siblings, 1 reply; 74+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-02-16  7:43 UTC (permalink / raw)
  To: linux-arm-kernel

On 07:24 Tue 14 Feb     , Rob Herring wrote:
> On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
> > On 02/13/2012 10:43 PM, Rob Herring :
> >> From: Rob Herring <rob.herring@calxeda.com>
> >>
> >> Move most of io.h into at91_io.h and update includes.
> >>
> >> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> >> ---
> >>  arch/arm/mach-at91/at91cap9.c                     |    1 +
> >>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
> > 
> > Please do not touch the "*cap9*" files anymore: They are scheduled for
> > removal for 3.4 kernel:
> > Documentation/feature-removal-schedule.txt
> 
> Okay.
> 
> > 
> >>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
> >>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
> >>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
> >>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
> >>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
> >>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
> >>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
> >>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
> >>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
> >>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
> >>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
> >>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
> >>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
> >>  arch/arm/mach-at91/at91x40.c                      |    1 +
> >>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
> >>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
> >>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
> >>  arch/arm/mach-at91/board-eco920.c                 |    1 +
> >>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
> >>  arch/arm/mach-at91/clock.c                        |    1 +
> >>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
> >>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
> >>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
> >>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
> >>  arch/arm/mach-at91/pm.c                           |    1 +
> >>  arch/arm/mach-at91/pm.h                           |    2 +
> >>  arch/arm/mach-at91/setup.c                        |    1 +
> >>  drivers/pcmcia/at91_cf.c                          |    1 +
> >>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
> >>  drivers/usb/gadget/at91_udc.c                     |    1 +
> >>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
> >>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
> >>  34 files changed, 80 insertions(+), 1 deletions(-)
> >>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
> >>
> 
> snip
> 
> >> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >> index e2f8da8..0427212 100644
> >> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >> @@ -12,6 +12,8 @@
> >>  #ifndef AT91SAM9_DDRSDR_H
> >>  #define AT91SAM9_DDRSDR_H
> >>  
> >> +#include <mach/at91_io.h>
> > 
> > Do we need this include in header files?
> 
> Yes, for at91_sys_write/read used at the bottom.
no need I droped the at91_sys_read/write for 3.4

Best Regards,
J.

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-16  7:43       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-02-16 14:08         ` Rob Herring
  2012-02-16 14:23           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-16 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/16/2012 01:43 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 07:24 Tue 14 Feb     , Rob Herring wrote:
>> On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
>>> On 02/13/2012 10:43 PM, Rob Herring :
>>>> From: Rob Herring <rob.herring@calxeda.com>
>>>>
>>>> Move most of io.h into at91_io.h and update includes.
>>>>
>>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>>>> ---
>>>>  arch/arm/mach-at91/at91cap9.c                     |    1 +
>>>>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
>>>
>>> Please do not touch the "*cap9*" files anymore: They are scheduled for
>>> removal for 3.4 kernel:
>>> Documentation/feature-removal-schedule.txt
>>
>> Okay.
>>
>>>
>>>>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
>>>>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
>>>>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
>>>>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
>>>>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
>>>>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
>>>>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
>>>>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
>>>>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
>>>>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
>>>>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
>>>>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
>>>>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
>>>>  arch/arm/mach-at91/at91x40.c                      |    1 +
>>>>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
>>>>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
>>>>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
>>>>  arch/arm/mach-at91/board-eco920.c                 |    1 +
>>>>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
>>>>  arch/arm/mach-at91/clock.c                        |    1 +
>>>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
>>>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>>>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
>>>>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
>>>>  arch/arm/mach-at91/pm.c                           |    1 +
>>>>  arch/arm/mach-at91/pm.h                           |    2 +
>>>>  arch/arm/mach-at91/setup.c                        |    1 +
>>>>  drivers/pcmcia/at91_cf.c                          |    1 +
>>>>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
>>>>  drivers/usb/gadget/at91_udc.c                     |    1 +
>>>>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
>>>>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
>>>>  34 files changed, 80 insertions(+), 1 deletions(-)
>>>>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
>>>>
>>
>> snip
>>
>>>> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>> index e2f8da8..0427212 100644
>>>> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>> @@ -12,6 +12,8 @@
>>>>  #ifndef AT91SAM9_DDRSDR_H
>>>>  #define AT91SAM9_DDRSDR_H
>>>>  
>>>> +#include <mach/at91_io.h>
>>>
>>> Do we need this include in header files?
>>
>> Yes, for at91_sys_write/read used at the bottom.
> no need I droped the at91_sys_read/write for 3.4
> 

Everywhere or just this header? Is this in a stable branch somewhere?

Rob

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-16 14:08         ` Rob Herring
@ 2012-02-16 14:23           ` Jean-Christophe PLAGNIOL-VILLARD
  2012-02-23 17:26             ` Nicolas Ferre
  0 siblings, 1 reply; 74+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-02-16 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 08:08 Thu 16 Feb     , Rob Herring wrote:
> On 02/16/2012 01:43 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 07:24 Tue 14 Feb     , Rob Herring wrote:
> >> On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
> >>> On 02/13/2012 10:43 PM, Rob Herring :
> >>>> From: Rob Herring <rob.herring@calxeda.com>
> >>>>
> >>>> Move most of io.h into at91_io.h and update includes.
> >>>>
> >>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> >>>> ---
> >>>>  arch/arm/mach-at91/at91cap9.c                     |    1 +
> >>>>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
> >>>
> >>> Please do not touch the "*cap9*" files anymore: They are scheduled for
> >>> removal for 3.4 kernel:
> >>> Documentation/feature-removal-schedule.txt
> >>
> >> Okay.
> >>
> >>>
> >>>>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
> >>>>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
> >>>>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
> >>>>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
> >>>>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
> >>>>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
> >>>>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
> >>>>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
> >>>>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
> >>>>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
> >>>>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
> >>>>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
> >>>>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
> >>>>  arch/arm/mach-at91/at91x40.c                      |    1 +
> >>>>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
> >>>>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
> >>>>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
> >>>>  arch/arm/mach-at91/board-eco920.c                 |    1 +
> >>>>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
> >>>>  arch/arm/mach-at91/clock.c                        |    1 +
> >>>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
> >>>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
> >>>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
> >>>>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
> >>>>  arch/arm/mach-at91/pm.c                           |    1 +
> >>>>  arch/arm/mach-at91/pm.h                           |    2 +
> >>>>  arch/arm/mach-at91/setup.c                        |    1 +
> >>>>  drivers/pcmcia/at91_cf.c                          |    1 +
> >>>>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
> >>>>  drivers/usb/gadget/at91_udc.c                     |    1 +
> >>>>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
> >>>>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
> >>>>  34 files changed, 80 insertions(+), 1 deletions(-)
> >>>>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
> >>>>
> >>
> >> snip
> >>
> >>>> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >>>> index e2f8da8..0427212 100644
> >>>> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >>>> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >>>> @@ -12,6 +12,8 @@
> >>>>  #ifndef AT91SAM9_DDRSDR_H
> >>>>  #define AT91SAM9_DDRSDR_H
> >>>>  
> >>>> +#include <mach/at91_io.h>
> >>>
> >>> Do we need this include in header files?
> >>
> >> Yes, for at91_sys_write/read used at the bottom.
> > no need I droped the at91_sys_read/write for 3.4
> > 
> 
> Everywhere or just this header? Is this in a stable branch somewhere?
everywhere

I'm preparing it

Best Regards,
J.

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

* [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files
  2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
  2012-02-13 22:16   ` H Hartley Sweeten
  2012-02-16  0:19   ` Shawn Guo
@ 2012-02-16 18:57   ` Linus Walleij
  2 siblings, 0 replies; 74+ messages in thread
From: Linus Walleij @ 2012-02-16 18:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 13, 2012 at 10:43 PM, Rob Herring <robherring2@gmail.com> wrote:

> Now that many platforms don't need mach/io.h, remove the usused ones.
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>

Great!

For these:
> ?arch/arm/mach-nomadik/include/mach/io.h ? | ? 22 -------------
> ?arch/arm/mach-u300/include/mach/io.h ? ? ?| ? 20 ------------
> ?arch/arm/mach-ux500/include/mach/io.h ? ? | ? 22 -------------

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* [PATCH 00/15] mach/io.h cleanup and removal
  2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
                   ` (16 preceding siblings ...)
  2012-02-13 23:41 ` Tony Lindgren
@ 2012-02-21 22:47 ` Stephen Warren
  17 siblings, 0 replies; 74+ messages in thread
From: Stephen Warren @ 2012-02-21 22:47 UTC (permalink / raw)
  To: linux-arm-kernel

Rob Herring wrote at Monday, February 13, 2012 2:43 PM:
> This series cleans-up mach/io.h and removes it for most platforms that have
> the same definitions of __io() and __mem_pci(). This mainly leaves platforms
> with PCI that need an io.h. Most of those can be converted once we have a
> fixed IO space mapping. OMAP io.h also remains as moving all the extra io.h
> stuff leaves it quite broken, so I'm leaving it to the OMAP folks to convert.

Sorry for the very slow response, but for the Tegra-specific parts,

Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>

-- 
nvpublic

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-16 14:23           ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-02-23 17:26             ` Nicolas Ferre
  2012-02-27 16:55               ` Rob Herring
  0 siblings, 1 reply; 74+ messages in thread
From: Nicolas Ferre @ 2012-02-23 17:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/16/2012 03:23 PM, Jean-Christophe PLAGNIOL-VILLARD :
> On 08:08 Thu 16 Feb     , Rob Herring wrote:
>> On 02/16/2012 01:43 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>> On 07:24 Tue 14 Feb     , Rob Herring wrote:
>>>> On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
>>>>> On 02/13/2012 10:43 PM, Rob Herring :
>>>>>> From: Rob Herring <rob.herring@calxeda.com>
>>>>>>
>>>>>> Move most of io.h into at91_io.h and update includes.
>>>>>>
>>>>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>>>>>> ---
>>>>>>  arch/arm/mach-at91/at91cap9.c                     |    1 +
>>>>>>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
>>>>>
>>>>> Please do not touch the "*cap9*" files anymore: They are scheduled for
>>>>> removal for 3.4 kernel:
>>>>> Documentation/feature-removal-schedule.txt
>>>>
>>>> Okay.
>>>>
>>>>>
>>>>>>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
>>>>>>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
>>>>>>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
>>>>>>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
>>>>>>  arch/arm/mach-at91/at91x40.c                      |    1 +
>>>>>>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
>>>>>>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
>>>>>>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
>>>>>>  arch/arm/mach-at91/board-eco920.c                 |    1 +
>>>>>>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
>>>>>>  arch/arm/mach-at91/clock.c                        |    1 +
>>>>>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
>>>>>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>>>>>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
>>>>>>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
>>>>>>  arch/arm/mach-at91/pm.c                           |    1 +
>>>>>>  arch/arm/mach-at91/pm.h                           |    2 +
>>>>>>  arch/arm/mach-at91/setup.c                        |    1 +
>>>>>>  drivers/pcmcia/at91_cf.c                          |    1 +
>>>>>>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
>>>>>>  drivers/usb/gadget/at91_udc.c                     |    1 +
>>>>>>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
>>>>>>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
>>>>>>  34 files changed, 80 insertions(+), 1 deletions(-)
>>>>>>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
>>>>>>
>>>>
>>>> snip
>>>>
>>>>>> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>>>> index e2f8da8..0427212 100644
>>>>>> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>>>> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>>>> @@ -12,6 +12,8 @@
>>>>>>  #ifndef AT91SAM9_DDRSDR_H
>>>>>>  #define AT91SAM9_DDRSDR_H
>>>>>>  
>>>>>> +#include <mach/at91_io.h>
>>>>>
>>>>> Do we need this include in header files?
>>>>
>>>> Yes, for at91_sys_write/read used at the bottom.
>>> no need I droped the at91_sys_read/write for 3.4
>>>
>>
>> Everywhere or just this header? Is this in a stable branch somewhere?
> everywhere
> 
> I'm preparing it

Jean and I have worked on this for the last two weeks... and I think
that we have something you can take as an example:
  git://github.com/at91linux/linux-at91.git at91-3.4-base2+cleanup

I will not qualify this branch as "stable" as it is not yet included in
arm-soc git tree (pull request sent at the very moment). But I think
that you will be able to rely on it once it will be included in arm-soc.
On the other hand, if it sound too late for you, we can adapt your work
on top of that new branch of ours.

Best regards,
-- 
Nicolas Ferre

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

* [PATCH] ARM: ep93xx: clean-up mach/io.h
  2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
  2012-02-13 21:52   ` Ryan Mallon
  2012-02-13 22:16   ` H Hartley Sweeten
@ 2012-02-27 15:17   ` Rob Herring
  2 siblings, 0 replies; 74+ messages in thread
From: Rob Herring @ 2012-02-27 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

Move ep93xx specifics in mach/io.h to ep93xx-regs.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
---
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    9 +++++++++
 arch/arm/mach-ep93xx/include/mach/io.h          |    9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index c4a7b84..6e0625e 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -25,6 +25,15 @@
  *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
  */
 
+/*
+ * A typesafe __io() variation for variable initialisers
+ */
+#ifdef __ASSEMBLER__
+#define IOMEM(p)                p
+#else
+#define IOMEM(p)                ((void __iomem __force *)(p))
+#endif
+
 #define EP93XX_CS0_PHYS_BASE_ASYNC	0x00000000	/* ASDO Pin = 0 */
 #define EP93XX_SDCE3_PHYS_BASE_SYNC	0x00000000	/* ASDO Pin = 1 */
 #define EP93XX_CS1_PHYS_BASE		0x10000000
diff --git a/arch/arm/mach-ep93xx/include/mach/io.h b/arch/arm/mach-ep93xx/include/mach/io.h
index 594b77f..17e76ef 100644
--- a/arch/arm/mach-ep93xx/include/mach/io.h
+++ b/arch/arm/mach-ep93xx/include/mach/io.h
@@ -10,13 +10,4 @@
 #define __io(p)			__typesafe_io(p)
 #define __mem_pci(p)		(p)
 
-/*
- * A typesafe __io() variation for variable initialisers
- */
-#ifdef __ASSEMBLER__
-#define IOMEM(p)		p
-#else
-#define IOMEM(p)		((void __iomem __force *)(p))
-#endif
-
 #endif /* __ASM_MACH_IO_H */
-- 
1.7.5.4

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-23 17:26             ` Nicolas Ferre
@ 2012-02-27 16:55               ` Rob Herring
  2012-02-27 17:27                 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-27 16:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/23/2012 11:26 AM, Nicolas Ferre wrote:
> On 02/16/2012 03:23 PM, Jean-Christophe PLAGNIOL-VILLARD :
>> On 08:08 Thu 16 Feb     , Rob Herring wrote:
>>> On 02/16/2012 01:43 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>> On 07:24 Tue 14 Feb     , Rob Herring wrote:
>>>>> On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
>>>>>> On 02/13/2012 10:43 PM, Rob Herring :
>>>>>>> From: Rob Herring <rob.herring@calxeda.com>
>>>>>>>
>>>>>>> Move most of io.h into at91_io.h and update includes.
>>>>>>>
>>>>>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>>>>>>> ---
>>>>>>>  arch/arm/mach-at91/at91cap9.c                     |    1 +
>>>>>>>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
>>>>>>
>>>>>> Please do not touch the "*cap9*" files anymore: They are scheduled for
>>>>>> removal for 3.4 kernel:
>>>>>> Documentation/feature-removal-schedule.txt
>>>>>
>>>>> Okay.
>>>>>
>>>>>>
>>>>>>>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
>>>>>>>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
>>>>>>>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
>>>>>>>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
>>>>>>>  arch/arm/mach-at91/at91x40.c                      |    1 +
>>>>>>>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
>>>>>>>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
>>>>>>>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
>>>>>>>  arch/arm/mach-at91/board-eco920.c                 |    1 +
>>>>>>>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
>>>>>>>  arch/arm/mach-at91/clock.c                        |    1 +
>>>>>>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
>>>>>>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
>>>>>>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
>>>>>>>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
>>>>>>>  arch/arm/mach-at91/pm.c                           |    1 +
>>>>>>>  arch/arm/mach-at91/pm.h                           |    2 +
>>>>>>>  arch/arm/mach-at91/setup.c                        |    1 +
>>>>>>>  drivers/pcmcia/at91_cf.c                          |    1 +
>>>>>>>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
>>>>>>>  drivers/usb/gadget/at91_udc.c                     |    1 +
>>>>>>>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
>>>>>>>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
>>>>>>>  34 files changed, 80 insertions(+), 1 deletions(-)
>>>>>>>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
>>>>>>>
>>>>>
>>>>> snip
>>>>>
>>>>>>> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>>>>> index e2f8da8..0427212 100644
>>>>>>> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>>>>> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
>>>>>>> @@ -12,6 +12,8 @@
>>>>>>>  #ifndef AT91SAM9_DDRSDR_H
>>>>>>>  #define AT91SAM9_DDRSDR_H
>>>>>>>  
>>>>>>> +#include <mach/at91_io.h>
>>>>>>
>>>>>> Do we need this include in header files?
>>>>>
>>>>> Yes, for at91_sys_write/read used at the bottom.
>>>> no need I droped the at91_sys_read/write for 3.4
>>>>
>>>
>>> Everywhere or just this header? Is this in a stable branch somewhere?
>> everywhere
>>
>> I'm preparing it
> 
> Jean and I have worked on this for the last two weeks... and I think
> that we have something you can take as an example:
>   git://github.com/at91linux/linux-at91.git at91-3.4-base2+cleanup
> 
> I will not qualify this branch as "stable" as it is not yet included in
> arm-soc git tree (pull request sent at the very moment). But I think
> that you will be able to rely on it once it will be included in arm-soc.
> On the other hand, if it sound too late for you, we can adapt your work
> on top of that new branch of ours.

With this branch and io.h removed, I just get 1 error with uncompress.h
needing an explicit include:

In file included from
/home/rob/proj/git/linux-2.6/arch/arm/boot/compressed/misc.c:28:0:
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
In function ?putc?:
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
note: each undeclared identifier is reported only once for each function
it appears in
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
In function ?flush?:
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:66:39:
error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
make[3]: *** [arch/arm/boot/compressed/misc.o] Error 1
  CC      arch/arm/boot/compressed/decompress.o
In file included from
/home/rob/proj/git/linux-2.6/arch/arm/boot/compressed/misc.c:28:0:
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
In function ?putc?:
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
note: each undeclared identifier is reported only once for each function
it appears in
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
In function ?flush?:
/home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:66:39:
error: ?AT91_BASE_DBGU0? undeclared (first use in this function)

Rob

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

* [PATCH 07/15] ARM: at91: clean-up mach/io.h
  2012-02-27 16:55               ` Rob Herring
@ 2012-02-27 17:27                 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 74+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-02-27 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

On 10:55 Mon 27 Feb     , Rob Herring wrote:
> On 02/23/2012 11:26 AM, Nicolas Ferre wrote:
> > On 02/16/2012 03:23 PM, Jean-Christophe PLAGNIOL-VILLARD :
> >> On 08:08 Thu 16 Feb     , Rob Herring wrote:
> >>> On 02/16/2012 01:43 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >>>> On 07:24 Tue 14 Feb     , Rob Herring wrote:
> >>>>> On 02/14/2012 03:21 AM, Nicolas Ferre wrote:
> >>>>>> On 02/13/2012 10:43 PM, Rob Herring :
> >>>>>>> From: Rob Herring <rob.herring@calxeda.com>
> >>>>>>>
> >>>>>>> Move most of io.h into at91_io.h and update includes.
> >>>>>>>
> >>>>>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> >>>>>>> ---
> >>>>>>>  arch/arm/mach-at91/at91cap9.c                     |    1 +
> >>>>>>>  arch/arm/mach-at91/at91cap9_devices.c             |    1 +
> >>>>>>
> >>>>>> Please do not touch the "*cap9*" files anymore: They are scheduled for
> >>>>>> removal for 3.4 kernel:
> >>>>>> Documentation/feature-removal-schedule.txt
> >>>>>
> >>>>> Okay.
> >>>>>
> >>>>>>
> >>>>>>>  arch/arm/mach-at91/at91rm9200.c                   |    1 +
> >>>>>>>  arch/arm/mach-at91/at91rm9200_devices.c           |    1 +
> >>>>>>>  arch/arm/mach-at91/at91rm9200_time.c              |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9260.c                  |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9260_devices.c          |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9261.c                  |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9261_devices.c          |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9263.c                  |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9263_devices.c          |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9g45.c                  |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9g45_devices.c          |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9rl.c                   |    1 +
> >>>>>>>  arch/arm/mach-at91/at91sam9rl_devices.c           |    1 +
> >>>>>>>  arch/arm/mach-at91/at91x40.c                      |    1 +
> >>>>>>>  arch/arm/mach-at91/at91x40_time.c                 |    1 +
> >>>>>>>  arch/arm/mach-at91/board-cap9adk.c                |    1 +
> >>>>>>>  arch/arm/mach-at91/board-cpu9krea.c               |    1 +
> >>>>>>>  arch/arm/mach-at91/board-eco920.c                 |    1 +
> >>>>>>>  arch/arm/mach-at91/board-yl-9200.c                |    1 +
> >>>>>>>  arch/arm/mach-at91/clock.c                        |    1 +
> >>>>>>>  arch/arm/mach-at91/include/mach/at91_io.h         |   44 +++++++++++++++++++++
> >>>>>>>  arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    2 +
> >>>>>>>  arch/arm/mach-at91/include/mach/at91sam9_sdramc.h |    2 +
> >>>>>>>  arch/arm/mach-at91/include/mach/uncompress.h      |    1 +
> >>>>>>>  arch/arm/mach-at91/pm.c                           |    1 +
> >>>>>>>  arch/arm/mach-at91/pm.h                           |    2 +
> >>>>>>>  arch/arm/mach-at91/setup.c                        |    1 +
> >>>>>>>  drivers/pcmcia/at91_cf.c                          |    1 +
> >>>>>>>  drivers/rtc/rtc-at91sam9.c                        |    2 +-
> >>>>>>>  drivers/usb/gadget/at91_udc.c                     |    1 +
> >>>>>>>  drivers/watchdog/at91rm9200_wdt.c                 |    1 +
> >>>>>>>  drivers/watchdog/at91sam9_wdt.c                   |    1 +
> >>>>>>>  34 files changed, 80 insertions(+), 1 deletions(-)
> >>>>>>>  create mode 100644 arch/arm/mach-at91/include/mach/at91_io.h
> >>>>>>>
> >>>>>
> >>>>> snip
> >>>>>
> >>>>>>> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >>>>>>> index e2f8da8..0427212 100644
> >>>>>>> --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >>>>>>> +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
> >>>>>>> @@ -12,6 +12,8 @@
> >>>>>>>  #ifndef AT91SAM9_DDRSDR_H
> >>>>>>>  #define AT91SAM9_DDRSDR_H
> >>>>>>>  
> >>>>>>> +#include <mach/at91_io.h>
> >>>>>>
> >>>>>> Do we need this include in header files?
> >>>>>
> >>>>> Yes, for at91_sys_write/read used at the bottom.
> >>>> no need I droped the at91_sys_read/write for 3.4
> >>>>
> >>>
> >>> Everywhere or just this header? Is this in a stable branch somewhere?
> >> everywhere
> >>
> >> I'm preparing it
> > 
> > Jean and I have worked on this for the last two weeks... and I think
> > that we have something you can take as an example:
> >   git://github.com/at91linux/linux-at91.git at91-3.4-base2+cleanup
> > 
> > I will not qualify this branch as "stable" as it is not yet included in
> > arm-soc git tree (pull request sent at the very moment). But I think
> > that you will be able to rely on it once it will be included in arm-soc.
> > On the other hand, if it sound too late for you, we can adapt your work
> > on top of that new branch of ours.
> 
> With this branch and io.h removed, I just get 1 error with uncompress.h
> needing an explicit include:
> 
> In file included from
> /home/rob/proj/git/linux-2.6/arch/arm/boot/compressed/misc.c:28:0:
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
> In function ?putc?:
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
> error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
> note: each undeclared identifier is reported only once for each function
> it appears in
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
> In function ?flush?:
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:66:39:
> error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
> make[3]: *** [arch/arm/boot/compressed/misc.o] Error 1
>   CC      arch/arm/boot/compressed/decompress.o
> In file included from
> /home/rob/proj/git/linux-2.6/arch/arm/boot/compressed/misc.c:28:0:
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
> In function ?putc?:
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
> error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:55:39:
> note: each undeclared identifier is reported only once for each function
> it appears in
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:
> In function ?flush?:
> /home/rob/proj/git/linux-2.6/arch/arm/mach-at91/include/mach/uncompress.h:66:39:
> error: ?AT91_BASE_DBGU0? undeclared (first use in this function)
> 
so you need to include mach/hardware.h

as io.h was including it

Best Regards,
J.

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14 17:16             ` Arnd Bergmann
  2012-02-14 17:40               ` Russell King - ARM Linux
@ 2012-02-27 19:31               ` Rob Herring
  2012-02-28 16:10                 ` Arnd Bergmann
  1 sibling, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-27 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 11:16 AM, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Rob Herring wrote:
>> On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
>>> On Tuesday 14 February 2012, Rob Herring wrote:
>>>
>>>> If we use CONFIG_PCI, then we have to move over all PCI enabled
>>>> platforms at once. With a separate kconfig option, then we can move
>>>> platforms one by one. Some are legacy and we may not want to move. This
>>>> also helped with omap, but Tony has now fixed it.
>>>
>>> We could also generalize the implementation from tegra, which seems
>>> reasonable as a start:
>>>
>>>
>>> #define IO_SPACE_LIMIT 0xffff
>>>
>>> #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
>>> #include <mach/io.h>
>>> #elif defined(CONFIG_PCI)
>>> extern void __iomem *pci_io_base;
>>>
>>> static inline void __iomem *__io(unsigned long addr)
>>> {
>>>         return pci_io_base + (addr & IO_SPACE_LIMIT);
>>
>> But don't we want a constant pci_io_base? This would certainly be a
>> quicker conversion, but I don't think we want to do it twice.
> 
> Yes, at least in the long run. Note that this should make no difference
> at all from a performance point of view, but it does impact code size a bit.
> 
>>> }
>>> #else
>>> static inline void __iomem *__io(unsigned long addr)
>>> {
>>>         return NULL;
>>> }
>>> #endif
>>> #define __io(a) __io(a)
>>>
>>> Out of the platforms supporting PCI right now, we currently have these three classes:
>>>
>>> 1. portable, but using different virtual addresses:
>>> arch/arm/mach-integrator/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCI_IO_VADDR + (a)))
>>> arch/arm/mach-ixp23xx/include/mach/io.h:#define __io(p)         ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
>>> arch/arm/mach-ixp2000/include/mach/io.h:#define __io(p)                 ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
>>> arch/arm/mach-shark/include/mach/io.h:#define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
>>> arch/arm/mach-footbridge/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCIO_BASE + (a)))
>>> arch/arm/mach-tegra/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
>>> arch/arm/mach-kirkwood/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
>>> arch/arm/mach-dove/include/mach/io.h:#define __io(a)    ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
>>>
>>> 2. Does not map the I/O space, or does not use it -- I cannot see how
>>>    any of these use PIO based PCI devices at all, probably broken already:
>>> arch/arm/mach-cns3xxx/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
>>> arch/arm/mach-ixp4xx/include/mach/io.h:#define  __io(v)         __typesafe_io(v)
>>> arch/arm/mach-ks8695/include/mach/io.h:#define __io(a)          __typesafe_io(a)
>>> arch/arm/mach-orion5x/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
>>> arch/arm/mach-sa1100/include/mach/io.h:#define __io(a)          __typesafe_io(a)
>>> arch/arm/mach-pxa/include/mach/io.h:#define __io(a)             __typesafe_io(a)
>>> arch/arm/mach-versatile/include/mach/io.h:#define __io(a)               __typesafe_io(a)
>>>
>>> 3. scary multi-way translation, needs someone to really understand (Nico?, Lennert?)
>>> arch/arm/mach-iop32x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
>>> arch/arm/mach-iop33x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
>>> arch/arm/mach-iop13xx/include/mach/io.h:#define __io(a) __iop13xx_io(a)
>>> arch/arm/mach-mv78xx0/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
>>>
>>> I think if we can figure out the third category, this should all become
>>> fairly easy for PCI based platforms.
>>>
>>
>> This looks correct AFAICT.
>>
>> We could just call the 3rd category legacy and move on.
> 
> I'm not ready to give up that fast. The platforms seem to be implemented
> reasonably well compared to category 2, but they can't be converted in
> a completely mechanical way. The patch below should put iop13xx it into
> category 1, but it really needs testing and review by a person who
> understands that platform. I can also take a look at the others if we
> agree that this is the right approach.
> 

It looks fine to me and I'm happy to pull it in, but who can test?
There's almost no commits specific to iop13xx going back to 2009. The
PCI related code goes back to 2007. I've added a couple of Intel folks
that did the original support.

Rob

> When we have all platforms done in that way, we can move the virtual
> mapping base to a fixed location.
> 
> 8<--------------
> [PATCH] iop13xx: use more regular PCI I/O space handling
> 
> iop13xx confuses I/O port numbers with physical addresses, which breaks
> legacy ISA I/O access behind PCI bridges and makes it unnecessarily hard
> to unify the inb/outb accessors with other platforms. This removes the
> special-casing and just puts all I/O ports into a single 128KB virtually
> mapped I/O port range starting at port zero.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-iop13xx/include/mach/io.h      |    6 +++-
>  arch/arm/mach-iop13xx/include/mach/iop13xx.h |   12 ++--------
>  arch/arm/mach-iop13xx/io.c                   |   27 --------------------------
>  arch/arm/mach-iop13xx/pci.c                  |   12 +++++-----
>  4 files changed, 13 insertions(+), 44 deletions(-)
> 
> diff --git a/arch/arm/mach-iop13xx/include/mach/io.h b/arch/arm/mach-iop13xx/include/mach/io.h
> index dffb234..90bb7df 100644
> --- a/arch/arm/mach-iop13xx/include/mach/io.h
> +++ b/arch/arm/mach-iop13xx/include/mach/io.h
> @@ -19,9 +19,11 @@
>  #ifndef __ASM_ARM_ARCH_IO_H
>  #define __ASM_ARM_ARCH_IO_H
>  
> -#define IO_SPACE_LIMIT 0xffffffff
> +#include <mach/iop13xx.h>
>  
> -#define __io(a) __iop13xx_io(a)
> +#define IO_SPACE_LIMIT (IOP13XX_PCIE_IO_WINDOW_SIZE + IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
> +
> +#define __io(a) (IOP13XX_PCIX_LOWER_IO_VA + ((a) & IO_SPACE_LIMIT))
>  #define __mem_pci(a) (a)
>  #define __mem_isa(a) (a)
>  
> diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> index 07e9ff7..ee1dfd2 100644
> --- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> +++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
> @@ -68,17 +68,15 @@ extern unsigned long get_iop_tick_rate(void);
>   * 0x8000.0000 + 928M	0x2.8000.0000   (ioremap)	PCIE outbound memory window
>   *
>   * IO MAP
> - * 0x1000 + 64K	0x0.fffb.1000	0xfec6.1000	PCIX outbound i/o window
> + * 0x1000 + 64K	0x0.fffb.1000	0xfed6.1000	PCIX outbound i/o window
>   * 0x1000 + 64K	0x0.fffd.1000	0xfed7.1000	PCIE outbound i/o window
>   */
>  #define IOP13XX_PCIX_IO_WINDOW_SIZE   0x10000UL
>  #define IOP13XX_PCIX_LOWER_IO_PA      0xfffb0000UL
> -#define IOP13XX_PCIX_LOWER_IO_VA      0xfec60000UL
> +#define IOP13XX_PCIX_LOWER_IO_VA      0xfed60000UL
>  #define IOP13XX_PCIX_LOWER_IO_BA      0x0UL /* OIOTVR */
>  #define IOP13XX_PCIX_IO_BUS_OFFSET    0x1000UL
> -#define IOP13XX_PCIX_UPPER_IO_PA      (IOP13XX_PCIX_LOWER_IO_PA +\
> -				       IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
> -#define IOP13XX_PCIX_UPPER_IO_VA      (IOP13XX_PCIX_LOWER_IO_VA +\
> +#define IOP13XX_PCIX_UPPER_IO_BA      (IOP13XX_PCIX_LOWER_IO_BA +\
>  				       IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
>  #define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
>  					   (IOP13XX_PCIX_LOWER_IO_PA\
> @@ -107,10 +105,6 @@ extern unsigned long get_iop_tick_rate(void);
>  #define IOP13XX_PCIE_LOWER_IO_VA      	 0xfed70000UL
>  #define IOP13XX_PCIE_LOWER_IO_BA      	 0x0UL  /* OIOTVR */
>  #define IOP13XX_PCIE_IO_BUS_OFFSET	 0x1000UL
> -#define IOP13XX_PCIE_UPPER_IO_PA      	 (IOP13XX_PCIE_LOWER_IO_PA +\
> -					 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
> -#define IOP13XX_PCIE_UPPER_IO_VA      	 (IOP13XX_PCIE_LOWER_IO_VA +\
> -					 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
>  #define IOP13XX_PCIE_UPPER_IO_BA      	 (IOP13XX_PCIE_LOWER_IO_BA +\
>  					 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
>  #define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
> diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
> index 48642e6..7a1ab4d 100644
> --- a/arch/arm/mach-iop13xx/io.c
> +++ b/arch/arm/mach-iop13xx/io.c
> @@ -21,25 +21,6 @@
>  #include <linux/io.h>
>  #include <mach/hardware.h>
>  
> -void * __iomem __iop13xx_io(unsigned long io_addr)
> -{
> -	void __iomem * io_virt;
> -
> -	switch (io_addr) {
> -	case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
> -		io_virt = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(io_addr);
> -		break;
> -	case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
> -		io_virt = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(io_addr);
> -		break;
> -	default:
> -		BUG();
> -	}
> -
> -	return io_virt;
> -}
> -EXPORT_SYMBOL(__iop13xx_io);
> -
>  void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
>  	unsigned int mtype)
>  {
> @@ -65,12 +46,6 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
>  				       (cookie - IOP13XX_PBI_LOWER_MEM_RA),
>  				       size, mtype, __builtin_return_address(0));
>  		break;
> -	case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
> -		retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
> -		break;
> -	case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
> -		retval = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(cookie);
> -		break;
>  	case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA:
>  		retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
>  		break;
> @@ -100,8 +75,6 @@ void __iop13xx_iounmap(void __iomem *addr)
>  		    goto skip;
>  
>  	switch ((u32) addr) {
> -	case IOP13XX_PCIE_LOWER_IO_VA ... IOP13XX_PCIE_UPPER_IO_VA:
> -	case IOP13XX_PCIX_LOWER_IO_VA ... IOP13XX_PCIX_UPPER_IO_VA:
>  	case IOP13XX_PMMR_VIRT_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_VA:
>  		goto skip;
>  	}
> diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
> index b8f5a87..d72eddf 100644
> --- a/arch/arm/mach-iop13xx/pci.c
> +++ b/arch/arm/mach-iop13xx/pci.c
> @@ -1042,8 +1042,8 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
>  				  << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
>  		__raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
>  
> -		res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET;
> -		res[0].end   = IOP13XX_PCIX_UPPER_IO_PA;
> +		res[0].start = IOP13XX_PCIX_LOWER_IO_BA + IOP13XX_PCIX_IO_BUS_OFFSET;
> +		res[0].end   = IOP13XX_PCIX_UPPER_IO_BA;
>  		res[0].name  = "IQ81340 ATUX PCI I/O Space";
>  		res[0].flags = IORESOURCE_IO;
>  
> @@ -1052,7 +1052,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
>  		res[1].name  = "IQ81340 ATUX PCI Memory Space";
>  		res[1].flags = IORESOURCE_MEM;
>  		sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
> -		sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA;
> +		sys->io_offset = IOP13XX_PCIX_LOWER_IO_BA;
>  		break;
>  	case IOP13XX_INIT_ATU_ATUE:
>  		/* Note: the function number field in the PCSR is ro */
> @@ -1063,8 +1063,8 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
>  
>  		__raw_writel(pcsr, IOP13XX_ATUE_PCSR);
>  
> -		res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET;
> -		res[0].end   = IOP13XX_PCIE_UPPER_IO_PA;
> +		res[0].start = IOP13XX_PCIE_LOWER_IO_BA + IOP13XX_PCIE_IO_BUS_OFFSET;
> +		res[0].end   = IOP13XX_PCIE_UPPER_IO_BA;
>  		res[0].name  = "IQ81340 ATUE PCI I/O Space";
>  		res[0].flags = IORESOURCE_IO;
>  
> @@ -1073,7 +1073,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
>  		res[1].name  = "IQ81340 ATUE PCI Memory Space";
>  		res[1].flags = IORESOURCE_MEM;
>  		sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
> -		sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA;
> +		sys->io_offset = IOP13XX_PCIE_LOWER_IO_BA;
>  		sys->map_irq = iop13xx_pcie_map_irq;
>  		break;
>  	default:

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-14  8:04         ` Arnd Bergmann
  2012-02-14 14:36           ` Rob Herring
@ 2012-02-27 22:31           ` Rob Herring
  2012-02-28 16:32             ` Arnd Bergmann
  1 sibling, 1 reply; 74+ messages in thread
From: Rob Herring @ 2012-02-27 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Rob Herring wrote:
>> Arnd,
>>
>> On 02/13/2012 08:03 PM, Arnd Bergmann wrote:
>>> On Monday 13 February 2012, Russell King - ARM Linux wrote:
>>>> On Mon, Feb 13, 2012 at 03:43:26PM -0600, Rob Herring wrote:
>>>>> From: Rob Herring <rob.herring@calxeda.com>
>>>>>
>>>>> Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h.
>>>>>
>>>>> Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA
>>>>> platforms don't need mach/io.h, but ebsa110 does.
>>>>
>>>> This is architecturally wrong.  If you have ISA, and your __io() macro
>>>> is essentially a 1:1 translation, you're asking for ISA drivers to
>>>> scribble on whatever is at virtual address 0-64K.  Too bad if that
>>>> happens to be where your CPU vectors are stored, you'll lose control
>>>> of the CPU in that case.
>>>
>>> Right. I still think it should be conditional on PCI || ISA || PCMCIA,
>>> not introducing a new kconfig symbol, and the next step should be to
>>> unify the __io() implementations for the platforms that need them.
>>
>> As we discussed at Connect, that was my original intent. However, there
>> are a couple of issues as NEED_MACH_IO_H is not exactly equivalent to
>> PCI || ISA || PCMCIA.
>>
>> There are a few platforms which still need io.h for custom accessor
>> functions: rpc, ixp4xx, s3c2410, and ebsa110.
> 
> I've tried to interpret what is there, please correct me if this is wrong:
> 
> RPC and ebsa110 have ISA, or some twisted version of that. I believe
> RPC doesn't select CONFIG_ISA because it has no actual ISA slots but
> it still uses legacy ISA I/O and we might just select it anyway.
> 
> s3c24xx seems to have ISA in a similar way on the "bast" machine,
> while the setup code for that got copied into some platforms that
> don't really require it.
> 
> ixp4xx has PCI, but does not always use direct MMIO to access the
> memory or I/O spaces.
> 
> I guess the only way we can ever make these ones use a common header
> file (in case we care) by letting them go through an indirect
> struct io_ops { u8 (*inb)(int); void (*outb)(u8, int); ... };,
> but we might not care enough.
> 
>> Also, a few platforms that
>> only select ISA don't do any translation in __io(). These are sa1100,
>> clps711x, and pxa. My understanding is that is wrong.
> 
> sa1100 has pcmcia slots that use their own method (setting io_offset)
> of redirecting the i/o space into the right location. As Russell
> mentioned, this is broken if you load an ISA device driver that
> uses hardcoded port numbers, or as I might add when you use /dev/port.
> 
> pxa seems to do the same as sa1100 for PCMCIA and PCI, but I can't figure
> out what they do for ISA. I suspect they only enable that in order to
> get ISA device drivers for PCMCIA based add-on cards.
> 
> clps711x for all I can tell is broken as you say.
> 
> I think omap1 and at91 fit into the same category as sa1100 and pxa
> regarding pcmcia. All four can in theory be converted to use a
> common virtual mapping as we want to have for PCI.
> 
>> If we use CONFIG_PCI, then we have to move over all PCI enabled
>> platforms at once. With a separate kconfig option, then we can move
>> platforms one by one. Some are legacy and we may not want to move. This
>> also helped with omap, but Tony has now fixed it.
> 
> We could also generalize the implementation from tegra, which seems
> reasonable as a start:
> 
> 
> #define IO_SPACE_LIMIT 0xffff
> 
> #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> #include <mach/io.h>
> #elif defined(CONFIG_PCI)
> extern void __iomem *pci_io_base;
> 
> static inline void __iomem *__io(unsigned long addr)
> {
>         return pci_io_base + (addr & IO_SPACE_LIMIT);
> }
> #else
> static inline void __iomem *__io(unsigned long addr)
> {
>         return NULL;
> }
> #endif
> #define __io(a) __io(a)
> 
> Out of the platforms supporting PCI right now, we currently have these three classes:
> 
> 1. portable, but using different virtual addresses:
> arch/arm/mach-integrator/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCI_IO_VADDR + (a)))
> arch/arm/mach-ixp23xx/include/mach/io.h:#define __io(p)         ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
> arch/arm/mach-ixp2000/include/mach/io.h:#define __io(p)                 ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
> arch/arm/mach-shark/include/mach/io.h:#define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
> arch/arm/mach-footbridge/include/mach/io.h:#define __io(a)                      ((void __iomem *)(PCIO_BASE + (a)))
> arch/arm/mach-tegra/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> arch/arm/mach-kirkwood/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> arch/arm/mach-dove/include/mach/io.h:#define __io(a)    ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
> 
> 2. Does not map the I/O space, or does not use it -- I cannot see how
>    any of these use PIO based PCI devices at all, probably broken already:
> arch/arm/mach-cns3xxx/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
> arch/arm/mach-ixp4xx/include/mach/io.h:#define  __io(v)         __typesafe_io(v)
> arch/arm/mach-ks8695/include/mach/io.h:#define __io(a)          __typesafe_io(a)
> arch/arm/mach-orion5x/include/mach/io.h:#define __io(a)                 __typesafe_io(a)
> arch/arm/mach-sa1100/include/mach/io.h:#define __io(a)          __typesafe_io(a)
> arch/arm/mach-pxa/include/mach/io.h:#define __io(a)             __typesafe_io(a)
> arch/arm/mach-versatile/include/mach/io.h:#define __io(a)               __typesafe_io(a)
> 
> 3. scary multi-way translation, needs someone to really understand (Nico?, Lennert?)
> arch/arm/mach-iop32x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> arch/arm/mach-iop33x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> arch/arm/mach-iop13xx/include/mach/io.h:#define __io(a) __iop13xx_io(a)
> arch/arm/mach-mv78xx0/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)

It seems iop3xx and mv78xx0 are just setting the PCI bus address to the
local bus address. The OIOWTVR register controls local bus to PCI
address translation. It is set to 0x90000000 which is effectively no
translation. But don't we really want 0x9000xxxx local bus translated to
0x0000xxxx PCI bus? Then the io resource region is setup for 0x9000xxxx
as well. If both the PCI bus address and i/o resources are moved to 0x0
that should make these category 1.

Also, you've left off ixp4xx from this list. It has PCI and needs io.h,
so fixing all the PCI platforms above will not make using CONFIG_PCI,
ISA or PCMCIA to include mach/io.h or not work. However, if indirect io
is all that io.h is needed for then perhaps a config option called
NEEDS_INDIRECT_IO would be a better name.

Rob

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-27 19:31               ` Rob Herring
@ 2012-02-28 16:10                 ` Arnd Bergmann
  0 siblings, 0 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-28 16:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 27 February 2012, Rob Herring wrote:
> >>
> >> This looks correct AFAICT.
> >>
> >> We could just call the 3rd category legacy and move on.
> > 
> > I'm not ready to give up that fast. The platforms seem to be implemented
> > reasonably well compared to category 2, but they can't be converted in
> > a completely mechanical way. The patch below should put iop13xx it into
> > category 1, but it really needs testing and review by a person who
> > understands that platform. I can also take a look at the others if we
> > agree that this is the right approach.
> > 
> 
> It looks fine to me and I'm happy to pull it in, but who can test?
> There's almost no commits specific to iop13xx going back to 2009. The
> PCI related code goes back to 2007. I've added a couple of Intel folks
> that did the original support.

Lennert and Dan are still listed as maintainers, so I would hope that
at least one of them would be able to Ack the patch and do the amount
of testing they see as appropriate. If they have both moved on and
cannot test it any more, the chances are that the platform is already
bitrotted and broken.

	Arnd

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

* [PATCH 13/15] ARM: make mach/io.h include optional
  2012-02-27 22:31           ` Rob Herring
@ 2012-02-28 16:32             ` Arnd Bergmann
  0 siblings, 0 replies; 74+ messages in thread
From: Arnd Bergmann @ 2012-02-28 16:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 27 February 2012, Rob Herring wrote:

> > 3. scary multi-way translation, needs someone to really understand (Nico?, Lennert?)
> > arch/arm/mach-iop32x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> > arch/arm/mach-iop33x/include/mach/io.h:#define __io(p)          ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
> > arch/arm/mach-iop13xx/include/mach/io.h:#define __io(a) __iop13xx_io(a)
> > arch/arm/mach-mv78xx0/include/mach/io.h:static inline void __iomem *__io(unsigned long addr)
> 
> It seems iop3xx and mv78xx0 are just setting the PCI bus address to the
> local bus address. The OIOWTVR register controls local bus to PCI
> address translation. It is set to 0x90000000 which is effectively no
> translation.

I'm not sure about this. IOP3XX_PCI_LOWER_IO_PA and IOP3XX_PCI_LOWER_IO_BA
are set to 0x90000000, so sys->io_offset is set to zero. However,
IOP3XX_PCI_LOWER_IO_PA gets put into the start of the ioport_resource,
which seems rather misguided because it means that any 16 bit port
number from a BAR plus the zero sys->io_offset are way outside of the
I/O resource, and the translation using IOP3XX_PCI_IO_PHYS_TO_VIRT(x)
ends up in the jungle.

> But don't we really want 0x9000xxxx local bus translated to
> 0x0000xxxx PCI bus? Then the io resource region is setup for 0x9000xxxx
> as well. If both the PCI bus address and i/o resources are moved to 0x0
> that should make these category 1.

The plan is certainly to put them into category 1.

> Also, you've left off ixp4xx from this list. It has PCI and needs io.h,
> so fixing all the PCI platforms above will not make using CONFIG_PCI,
> ISA or PCMCIA to include mach/io.h or not work. However, if indirect io
> is all that io.h is needed for then perhaps a config option called
> NEEDS_INDIRECT_IO would be a better name.

Yes, makes sense. From what I can tell, ixp4xx always uses indirect
access for I/O space but can use either direct or indirect access
for memory space.

	Arnd

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

end of thread, other threads:[~2012-02-28 16:32 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
2012-02-13 21:43 ` [PATCH 01/15] usb: ohci-pxa27x: add explicit include of hardware.h Rob Herring
2012-02-13 21:43 ` [PATCH 02/15] ARM: add explicit include of system.h to processor.h Rob Herring
2012-02-13 22:14   ` H Hartley Sweeten
2012-02-13 21:43 ` [PATCH 03/15] ARM: provide runtime hook for ioremap Rob Herring
2012-02-13 22:13   ` H Hartley Sweeten
2012-02-13 22:30   ` Russell King - ARM Linux
2012-02-13 22:48     ` Rob Herring
2012-02-13 21:43 ` [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook Rob Herring
2012-02-16  0:17   ` Shawn Guo
2012-02-13 21:43 ` [PATCH 05/15] ARM: msm: use " Rob Herring
2012-02-13 23:05   ` David Brown
2012-02-13 21:43 ` [PATCH 06/15] ARM: msm: clean-up mach/io.h Rob Herring
2012-02-13 21:43 ` [PATCH 07/15] ARM: at91: " Rob Herring
2012-02-14  9:21   ` Nicolas Ferre
2012-02-14 13:24     ` Rob Herring
2012-02-16  7:43       ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-16 14:08         ` Rob Herring
2012-02-16 14:23           ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-23 17:26             ` Nicolas Ferre
2012-02-27 16:55               ` Rob Herring
2012-02-27 17:27                 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-13 21:43 ` [PATCH 08/15] ARM: davinci: remove unneeded mach/io.h include Rob Herring
2012-02-13 21:43 ` [PATCH 09/15] ARM: orion5x: clean-up mach/io.h Rob Herring
2012-02-13 21:43 ` [PATCH 10/15] ARM: tegra: " Rob Herring
2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
2012-02-13 21:52   ` Ryan Mallon
2012-02-13 22:15     ` Rob Herring
2012-02-13 22:16   ` H Hartley Sweeten
2012-02-27 15:17   ` [PATCH] " Rob Herring
2012-02-13 21:43 ` [PATCH 12/15] ARM: clps711x: remove unneeded include of mach/io.h Rob Herring
2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
2012-02-13 22:14   ` H Hartley Sweeten
2012-02-13 22:36   ` Russell King - ARM Linux
2012-02-13 22:55     ` Rob Herring
2012-02-14  2:03     ` Arnd Bergmann
2012-02-14  2:54       ` Rob Herring
2012-02-14  8:04         ` Arnd Bergmann
2012-02-14 14:36           ` Rob Herring
2012-02-14 17:16             ` Arnd Bergmann
2012-02-14 17:40               ` Russell King - ARM Linux
2012-02-14 18:12                 ` Arnd Bergmann
2012-02-14 23:09                 ` Rob Herring
2012-02-14 23:43                   ` Russell King - ARM Linux
2012-02-15  0:25                     ` Nicolas Pitre
2012-02-15 14:14                       ` Rob Herring
2012-02-15  0:57                     ` Arnd Bergmann
2012-02-27 19:31               ` Rob Herring
2012-02-28 16:10                 ` Arnd Bergmann
2012-02-27 22:31           ` Rob Herring
2012-02-28 16:32             ` Arnd Bergmann
2012-02-13 23:15   ` H Hartley Sweeten
2012-02-14  1:06     ` Arnd Bergmann
2012-02-14 17:38       ` H Hartley Sweeten
2012-02-14 18:20         ` Arnd Bergmann
2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
2012-02-13 22:16   ` H Hartley Sweeten
2012-02-16  0:19   ` Shawn Guo
2012-02-16 18:57   ` Linus Walleij
2012-02-13 21:43 ` [PATCH 15/15] ARM: kill off __mem_pci Rob Herring
2012-02-13 22:22 ` [PATCH 00/15] mach/io.h cleanup and removal Tony Lindgren
2012-02-13 23:56   ` Tony Lindgren
2012-02-14  3:09   ` Rob Herring
2012-02-13 23:41 ` Tony Lindgren
2012-02-14  3:20   ` Rob Herring
2012-02-14 17:24     ` Tony Lindgren
2012-02-14 17:57       ` Arnd Bergmann
2012-02-14 18:28         ` Nicolas Pitre
2012-02-14 19:41         ` Rob Herring
2012-02-14 20:43           ` Tony Lindgren
2012-02-14 21:26             ` Arnd Bergmann
2012-02-14 21:54               ` Rob Herring
2012-02-14 22:38                 ` Arnd Bergmann
2012-02-21 22:47 ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.