Skip to contentSkip to conversation

mach/io.h cleanup and removal

PATCH New Rob Herring 13 participants 74 messages Feb 13, 2012 – Feb 28, 2012

Subsystems (28)
lore
Share & tools
lore
#0 lore raw

cover mach/io.h cleanup and removal

From: Rob Herring <[email protected]>

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
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/15 usb: ohci-pxa27x: add explicit include of hardware.h

From: Rob Herring <[email protected]>

ohci-pxa27x needs cpu_is_pxa3xx macro.

---
 drivers/usb/host/ohci-pxa27x.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/usb/host/ohci-pxa27x.c +1 -0
index 6313e44..4db399c 100644
@@ -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>
 
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/15 ARM: add explicit include of system.h to processor.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/include/asm/processor.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/include/asm/processor.h +1 -0
index ce280b8..cb8d638 100644
@@ -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) ? \
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 2/15 ARM: add explicit include of system.h to processor.h

Quoted 13 lines · Rob Herring

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

---
 arch/arm/include/asm/processor.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/include/asm/processor.h +0 -0
index ce280b8..cb8d638 100644

arch/arm/include/asm/processor.h line 28

Quoted 7 lines
arch/arm/include/asm/processor.h +1 -0
@@ -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

#4 lore raw

PATCH 3/15 ARM: provide runtime hook for ioremap

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/include/asm/io.h |    5 ++++-
 arch/arm/mm/ioremap.c     |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/include/asm/io.h +4 -1
index 9275828..f5c6968 100644
@@ -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
 
arch/arm/mm/ioremap.c +3 -0
index 80632e8..f551c13 100644
@@ -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
Signature · 1 line
1.7.5.4
#5 lore raw

PATCH 3/15 ARM: provide runtime hook for ioremap

Quoted 32 lines · Rob Herring

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

---
 arch/arm/include/asm/io.h |    5 ++++-
 arch/arm/mm/ioremap.c     |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/include/asm/io.h +4 -1
index 9275828..f5c6968 100644
@@ -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
 
arch/arm/mm/ioremap.c +0 -0
index 80632e8..f551c13 100644

arch/arm/mm/ioremap.c __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) · line 322

Quoted 9 lines
arch/arm/mm/ioremap.c +3 -0
@@ -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:

#7 lore raw

PATCH 3/15 ARM: provide runtime hook for ioremap

Quoted 7 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

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

#8 lore raw

PATCH 4/15 ARM: imx: convert to common runtime ioremap hook

In reply to Rob Herring

From: Rob Herring <[email protected]>

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.

---
 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(-)
arch/arm/mach-imx/mm-imx3.c +2 -2
index 31807d2..b33f736 100644
@@ -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)
arch/arm/plat-mxc/include/mach/hardware.h +3 -0
index a599f01..ca06a68 100644
@@ -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)
arch/arm/plat-mxc/include/mach/io.h +0 -17
index 338300b..ea9d95e 100644
@@ -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)
 
Signature · 1 line
1.7.5.4
#10 lore raw

PATCH 5/15 ARM: msm: use runtime ioremap hook

In reply to Rob Herring

From: Rob Herring <[email protected]>

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.

---
 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(-)
arch/arm/mach-msm/board-halibut.c +6 -0
index a60ab6d..b6cff3a 100644
@@ -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,
arch/arm/mach-msm/board-trout.c +6 -0
index 6b9b227..509d94c 100644
@@ -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,
arch/arm/mach-msm/include/mach/io.h +0 -5
index dc1b928..c6ff9bb 100644
@@ -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)
 
arch/arm/mach-msm/include/mach/msm_iomap-7x00.h +6 -0
index 8af4612..c355886 100644
@@ -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
arch/arm/mach-msm/io.c +0 -1
index 578b04e..283cdff 100644
@@ -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);
Signature · 1 line
1.7.5.4
#11 lore raw

PATCH 5/15 ARM: msm: use runtime ioremap hook

Quoted 7 lines · Rob Herring

From: Rob Herring <[email protected]>

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.

Quoted 8 lines
---
 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).

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#12 lore raw

PATCH 6/15 ARM: msm: clean-up mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 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(-)
arch/arm/mach-msm/include/mach/io.h +0 -7
index c6ff9bb..1071f98 100644
@@ -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
arch/arm/mach-msm/include/mach/msm_iomap-7x30.h +4 -0
index 198202c..f944fe6 100644
@@ -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
arch/arm/mach-msm/include/mach/msm_iomap-8960.h +4 -0
index 800b557..a1752c0 100644
@@ -50,4 +50,8 @@
 #define MSM_DEBUG_UART_PHYS	0x16440000
 #endif
 
+#ifndef __ASSEMBLY__
+extern void msm_map_msm8960_io(void);
+#endif
+
 #endif
arch/arm/mach-msm/include/mach/msm_iomap-8x50.h +4 -0
index 0faa894..da77cc1 100644
@@ -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
arch/arm/mach-msm/include/mach/msm_iomap-8x60.h +4 -0
index 54e12ca..5aed57d 100644
@@ -67,4 +67,8 @@
 #define MSM_DEBUG_UART_PHYS	0x19C40000
 #endif
 
+#ifndef __ASSEMBLY__
+extern void msm_map_msm8x60_io(void);
+#endif
+
 #endif
Signature · 1 line
1.7.5.4
#13 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 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
arch/arm/mach-at91/at91cap9.c +1 -0
index a42edc2..1fc7082 100644
@@ -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"
arch/arm/mach-at91/at91cap9_devices.c +1 -0
index d298fb7..f2edf2d 100644
@@ -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"
 
arch/arm/mach-at91/at91rm9200.c +1 -0
index 99c3174..e8a4d50 100644
@@ -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"
arch/arm/mach-at91/at91rm9200_devices.c +1 -0
index 18bacec..1566d68 100644
@@ -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"
 
arch/arm/mach-at91/at91rm9200_time.c +1 -0
index a028cdf..45bddca 100644
@@ -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;
arch/arm/mach-at91/at91sam9260.c +1 -0
index d4036ba..5aa78fa 100644
@@ -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"
arch/arm/mach-at91/at91sam9260_devices.c +1 -0
index 642ccb6..94fdf96 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9261.c +1 -0
index 023c2ff..3b4aec7 100644
@@ -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"
arch/arm/mach-at91/at91sam9261_devices.c +1 -0
index fc59cbd..bbd04c2 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9263.c +1 -0
index 75e876c..2e1a428 100644
@@ -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"
arch/arm/mach-at91/at91sam9263_devices.c +1 -0
index 7b46b27..1e5e88d 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9g45.c +1 -0
index 1cb6a96..2f2e061 100644
@@ -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"
arch/arm/mach-at91/at91sam9g45_devices.c +1 -0
index b7582dd..9e0de74 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9rl.c +1 -0
index d2c91a8..c284d98 100644
@@ -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"
arch/arm/mach-at91/at91sam9rl_devices.c +1 -0
index 61908dc..3311106 100644
@@ -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"
 
arch/arm/mach-at91/at91x40.c +1 -0
index 56ba3bd..838103e 100644
@@ -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"
 
 /*
arch/arm/mach-at91/at91x40_time.c +1 -0
index dfff289..152cc7a 100644
@@ -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.
arch/arm/mach-at91/board-cap9adk.c +1 -0
index ac3de4f..b31791a 100644
@@ -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"
arch/arm/mach-at91/board-cpu9krea.c +1 -0
index 9ab3d1e..619d1d0 100644
@@ -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"
arch/arm/mach-at91/board-eco920.c +1 -0
index 07ef35b..f56bf24 100644
@@ -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"
 
arch/arm/mach-at91/board-yl-9200.c +1 -0
index bbd553e..bf889e5 100644
@@ -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"
 
arch/arm/mach-at91/clock.c +1 -0
index 61873f3..0e8b318 100644
@@ -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"
arch/arm/mach-at91/include/mach/at91_io.h new file +44 -0

44 lines not on this page · raw message

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +2 -0
index e2f8da8..0427212 100644
@@ -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
arch/arm/mach-at91/include/mach/at91sam9_sdramc.h +2 -0
index 100f5a5..4a3b2ec 100644
@@ -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 */
arch/arm/mach-at91/include/mach/uncompress.h +1 -0
index 0234fd9..96dd8e1 100644
@@ -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
arch/arm/mach-at91/pm.c +1 -0
index 1606379..f099c3e 100644
@@ -27,6 +27,7 @@
 
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 #include "pm.h"
arch/arm/mach-at91/pm.h +2 -0
index 7eb40d2..ac12592 100644
@@ -1,3 +1,5 @@
+#include <mach/at91_io.h>
+
 #ifdef CONFIG_ARCH_AT91RM9200
 #include <mach/at91rm9200_mc.h>
 
arch/arm/mach-at91/setup.c +1 -0
index 69d3fc4..cee8156 100644
@@ -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"
drivers/pcmcia/at91_cf.c +1 -0
index 4902206..3edf52b 100644
@@ -26,6 +26,7 @@
 
 #include <mach/board.h>
 #include <mach/at91rm9200_mc.h>
+#include <mach/at91_io.h>
 
 
 /*
drivers/rtc/rtc-at91sam9.c +1 -1
index a3ad957..d044f55 100644
@@ -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
drivers/usb/gadget/at91_udc.c +1 -0
index 143a725..e9da936 100644
@@ -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"
 
drivers/watchdog/at91rm9200_wdt.c +1 -0
index b3046dc..4073312 100644
@@ -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 */
drivers/watchdog/at91sam9_wdt.c +1 -0
index 0056256..d4c0576 100644
@@ -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"
Signature · 1 line
1.7.5.4
#14 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 8 lines

From: Rob Herring <[email protected]>

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

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

Quoted 305 lines
 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
arch/arm/mach-at91/at91cap9.c +1 -0
index a42edc2..1fc7082 100644
@@ -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"
arch/arm/mach-at91/at91cap9_devices.c +1 -0
index d298fb7..f2edf2d 100644
@@ -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"
 
arch/arm/mach-at91/at91rm9200.c +1 -0
index 99c3174..e8a4d50 100644
@@ -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"
arch/arm/mach-at91/at91rm9200_devices.c +1 -0
index 18bacec..1566d68 100644
@@ -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"
 
arch/arm/mach-at91/at91rm9200_time.c +1 -0
index a028cdf..45bddca 100644
@@ -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;
arch/arm/mach-at91/at91sam9260.c +1 -0
index d4036ba..5aa78fa 100644
@@ -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"
arch/arm/mach-at91/at91sam9260_devices.c +1 -0
index 642ccb6..94fdf96 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9261.c +1 -0
index 023c2ff..3b4aec7 100644
@@ -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"
arch/arm/mach-at91/at91sam9261_devices.c +1 -0
index fc59cbd..bbd04c2 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9263.c +1 -0
index 75e876c..2e1a428 100644
@@ -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"
arch/arm/mach-at91/at91sam9263_devices.c +1 -0
index 7b46b27..1e5e88d 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9g45.c +1 -0
index 1cb6a96..2f2e061 100644
@@ -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"
arch/arm/mach-at91/at91sam9g45_devices.c +1 -0
index b7582dd..9e0de74 100644
@@ -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"
 
arch/arm/mach-at91/at91sam9rl.c +1 -0
index d2c91a8..c284d98 100644
@@ -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"
arch/arm/mach-at91/at91sam9rl_devices.c +1 -0
index 61908dc..3311106 100644
@@ -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"
 
arch/arm/mach-at91/at91x40.c +1 -0
index 56ba3bd..838103e 100644
@@ -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"
 
 /*
arch/arm/mach-at91/at91x40_time.c +1 -0
index dfff289..152cc7a 100644
@@ -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.
arch/arm/mach-at91/board-cap9adk.c +1 -0
index ac3de4f..b31791a 100644
@@ -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"
arch/arm/mach-at91/board-cpu9krea.c +1 -0
index 9ab3d1e..619d1d0 100644
@@ -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"
arch/arm/mach-at91/board-eco920.c +1 -0
index 07ef35b..f56bf24 100644
@@ -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"
 
arch/arm/mach-at91/board-yl-9200.c +1 -0
index bbd553e..bf889e5 100644
@@ -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"
 
arch/arm/mach-at91/clock.c +1 -0
index 61873f3..0e8b318 100644
@@ -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"
arch/arm/mach-at91/include/mach/at91_io.h new file +0 -0
new file mode 100644
index 0000000..82e66de

arch/arm/mach-at91/include/mach/at91_io.h line 2

Quoted 2 lines
arch/arm/mach-at91/include/mach/at91_io.h new file +2 -0
@@ -0,0 +1,44 @@
+/*
+ * arch/arm/mach-at91/include/mach/io.h

maybe change this line into:

* at91_io.h

Quoted 10 lines
arch/arm/mach-at91/include/mach/at91_io.h new file +10 -0
+ *
+ *  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

arch/arm/mach-at91/include/mach/at91_io.h line 22

Quoted 10 lines
arch/arm/mach-at91/include/mach/at91_io.h new file +10 -0
+ * 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.

Quoted 27 lines
arch/arm/mach-at91/include/mach/at91_io.h new file +22 -0
+
+#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
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +0 -0
index e2f8da8..0427212 100644

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 4 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
@@ -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?

Quoted 124 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
+
 #define AT91_DDRSDRC_MR		0x00	/* Mode Register */
 #define		AT91_DDRSDRC_MODE	(0x7 << 0)		/* Command Mode */
 #define			AT91_DDRSDRC_MODE_NORMAL	0
arch/arm/mach-at91/include/mach/at91sam9_sdramc.h +2 -0
index 100f5a5..4a3b2ec 100644
@@ -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 */
arch/arm/mach-at91/include/mach/uncompress.h +1 -0
index 0234fd9..96dd8e1 100644
@@ -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
arch/arm/mach-at91/pm.c +1 -0
index 1606379..f099c3e 100644
@@ -27,6 +27,7 @@
 
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
+#include <mach/at91_io.h>
 
 #include "generic.h"
 #include "pm.h"
arch/arm/mach-at91/pm.h +2 -0
index 7eb40d2..ac12592 100644
@@ -1,3 +1,5 @@
+#include <mach/at91_io.h>
+
 #ifdef CONFIG_ARCH_AT91RM9200
 #include <mach/at91rm9200_mc.h>
 
arch/arm/mach-at91/setup.c +1 -0
index 69d3fc4..cee8156 100644
@@ -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"
drivers/pcmcia/at91_cf.c +1 -0
index 4902206..3edf52b 100644
@@ -26,6 +26,7 @@
 
 #include <mach/board.h>
 #include <mach/at91rm9200_mc.h>
+#include <mach/at91_io.h>
 
 
 /*
drivers/rtc/rtc-at91sam9.c +1 -1
index a3ad957..d044f55 100644
@@ -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
drivers/usb/gadget/at91_udc.c +1 -0
index 143a725..e9da936 100644
@@ -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"
 
drivers/watchdog/at91rm9200_wdt.c +1 -0
index b3046dc..4073312 100644
@@ -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 */
drivers/watchdog/at91sam9_wdt.c +1 -0
index 0056256..d4c0576 100644
@@ -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"
Signature · 1 line
Nicolas Ferre
#15 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

Quoted 5 lines · Nicolas Ferre

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 11 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 9 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
index e2f8da8..0427212 100644
@@ -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

#16 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

Quoted 64 lines · Rob Herring
Quoted 5 lines · Nicolas Ferre

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 8 lines
Quoted 8 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +0 -0
index e2f8da8..0427212 100644
@@ -12,6 +12,8 @@
 #ifndef AT91SAM9_DDRSDR_H
 #define AT91SAM9_DDRSDR_H
 
Quoted 5 lines
Quoted 3 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 1 line
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
+#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.

#17 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

Quoted 65 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 64 lines · Rob Herring
Quoted 5 lines · Nicolas Ferre

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 8 lines
Quoted 8 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +0 -0
index e2f8da8..0427212 100644
@@ -12,6 +12,8 @@
 #ifndef AT91SAM9_DDRSDR_H
 #define AT91SAM9_DDRSDR_H
 
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 1 line
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
+#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

#18 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

Quoted 70 lines · Rob Herring
Quoted 69 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 68 lines · Rob Herring
Quoted 5 lines · Nicolas Ferre

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 11 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 9 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
index e2f8da8..0427212 100644
@@ -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?

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

#19 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

On 02/16/2012 03:23 PM, Jean-Christophe PLAGNIOL-VILLARD :

Quoted 71 lines · Rob Herring
Quoted 70 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 69 lines · Rob Herring
Quoted 68 lines · Nicolas Ferre
Quoted 5 lines

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 11 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 9 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
index e2f8da8..0427212 100644
@@ -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?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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,

Signature · 1 line
Nicolas Ferre
#20 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

Quoted 85 lines · Nicolas Ferre

On 02/16/2012 03:23 PM, Jean-Christophe PLAGNIOL-VILLARD :

Quoted 71 lines · Rob Herring
Quoted 70 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 69 lines · Rob Herring
Quoted 68 lines · Nicolas Ferre
Quoted 5 lines

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 11 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 9 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
index e2f8da8..0427212 100644
@@ -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?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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

Quoted 5 lines

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

#21 lore raw

PATCH 7/15 ARM: at91: clean-up mach/io.h

Quoted 115 lines · Rob Herring
Quoted 85 lines · Nicolas Ferre

On 02/16/2012 03:23 PM, Jean-Christophe PLAGNIOL-VILLARD :

Quoted 71 lines · Rob Herring
Quoted 70 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 69 lines · Rob Herring
Quoted 68 lines · Nicolas Ferre
Quoted 5 lines

On 02/13/2012 10:43 PM, Rob Herring :

Quoted 4 lines

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 36 lines
Quoted 36 lines
 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

Quoted 11 lines

arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h line 15

Quoted 9 lines
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +1 -0
index e2f8da8..0427212 100644
@@ -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?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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

Quoted 5 lines

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:

Quoted 9 lines

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.

#22 lore raw

PATCH 8/15 ARM: davinci: remove unneeded mach/io.h include

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/mach-davinci/include/mach/entry-macro.S |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-davinci/include/mach/entry-macro.S +0 -1
index e14c0dc..f6e1d33 100644
@@ -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
Signature · 1 line
1.7.5.4
#23 lore raw

PATCH 9/15 ARM: orion5x: clean-up mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 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(-)
arch/arm/mach-orion5x/common.h +9 -0
index d2513ac..2e6454c 100644
@@ -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
arch/arm/mach-orion5x/include/mach/io.h +0 -12
index e9d9afd..444136d 100644
@@ -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
arch/arm/mach-orion5x/pci.c +1 -0
index 09a045f..a9d2151 100644
@@ -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"
 
 /*****************************************************************************
arch/arm/mach-orion5x/tsx09-common.c +1 -0
index c9abb8f..7189827 100644
@@ -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"
 
Signature · 1 line
1.7.5.4
#24 lore raw

PATCH 10/15 ARM: tegra: clean-up mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 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(-)
arch/arm/mach-tegra/include/mach/io.h +0 -48
index f15deff..47b4b61 100644
@@ -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;
 
arch/arm/mach-tegra/include/mach/iomap.h +48 -0

52 lines not on this page · raw message

arch/arm/mach-tegra/io.c +1 -0
index d23ee2d..58b4baf 100644
@@ -26,6 +26,7 @@
 
 #include <asm/page.h>
 #include <asm/mach/map.h>
+#include <mach/iomap.h>
 
 #include "board.h"
 
Signature · 1 line
1.7.5.4
#25 lore raw

PATCH 11/15 ARM: ep93xx: clean-up mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +6 -0
index c4a7b84..8933c62 100644
@@ -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
Signature · 1 line
1.7.5.4
#26 lore raw

PATCH 11/15 ARM: ep93xx: clean-up mach/io.h

Quoted 14 lines · Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -0
index c4a7b84..8933c62 100644

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h line 33

Quoted 9 lines
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +6 -0
@@ -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

#27 lore raw

PATCH 11/15 ARM: ep93xx: clean-up mach/io.h

Quoted 19 lines · Ryan Mallon
Quoted 17 lines · Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -0
index c4a7b84..8933c62 100644
@@ -25,6 +25,12 @@
  *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
  */
 
Quoted 13 lines

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h line 33

Quoted 6 lines
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +6 -0
+#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

#28 lore raw

PATCH 11/15 ARM: ep93xx: clean-up mach/io.h

In reply to Rob Herring
Quoted 15 lines · Rob Herring

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

---
 arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -0
index c4a7b84..8933c62 100644
@@ -25,6 +25,12 @@
  *	http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
  */

arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h line 36

Quoted 10 lines
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +6 -0
 
+#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

#29 lore raw

PATCH 1/1 ARM: ep93xx: clean-up mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

Cc Hartley Sweeten <[email protected]>
Cc Ryan Mallon <[email protected]>
---
 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(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +9 -0
index c4a7b84..6e0625e 100644
@@ -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
arch/arm/mach-ep93xx/include/mach/io.h +0 -9
index 594b77f..17e76ef 100644
@@ -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 */
Signature · 1 line
1.7.5.4
#30 lore raw

PATCH 12/15 ARM: clps711x: remove unneeded include of mach/io.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 arch/arm/mach-clps711x/include/mach/uncompress.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-clps711x/include/mach/uncompress.h +0 -1
index 7164310..35ed731 100644
@@ -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>
 
Signature · 1 line
1.7.5.4
#31 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Rob Herring

From: Rob Herring <[email protected]>

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.

---
 arch/arm/Kconfig          |   21 +++++++++++++++++++++
 arch/arm/include/asm/io.h |    5 +++++
 2 files changed, 26 insertions(+), 0 deletions(-)
arch/arm/Kconfig +21 -0
index a48aecc..fce05b8 100644
@@ -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.
 
arch/arm/include/asm/io.h +5 -0
index f5c6968..5e0ca53 100644
@@ -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
Signature · 1 line
1.7.5.4
#32 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 9 lines · Rob Herring

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.

Quoted 5 lines
---
 arch/arm/Kconfig          |   21 +++++++++++++++++++++
 arch/arm/include/asm/io.h |    5 +++++
 2 files changed, 26 insertions(+), 0 deletions(-)

On EP93xx:

#33 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Rob Herring
Quoted 6 lines · Rob Herring

From: Rob Herring <[email protected]>

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.

#34 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 14 lines · Russell King - ARM Linux
Quoted 6 lines · Rob Herring

From: Rob Herring <[email protected]>

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.

Quoted 4 lines

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

#35 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 2 lines

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.

Quoted 1 line

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

#36 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Arnd,

Quoted 15 lines · Arnd Bergmann
Quoted 5 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 5 lines
Quoted 1 line

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

#37 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 22 lines · Rob Herring

Arnd,

Quoted 15 lines · Arnd Bergmann
Quoted 5 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 6 lines

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.

Quoted 3 lines

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.

Quoted 4 lines

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

#38 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 78 lines · Arnd Bergmann
Quoted 22 lines · Rob Herring

Arnd,

Quoted 15 lines · Arnd Bergmann
Quoted 5 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 6 lines

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.

Quoted 3 lines

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.

Quoted 4 lines

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

Quoted 8 lines

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

Quoted 31 lines

}
#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)

Quoted 9 lines

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

Quoted 2 lines

Arnd

#39 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 19 lines · Rob Herring
Quoted 18 lines · Arnd Bergmann
Quoted 4 lines · Rob Herring

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;

Quoted 6 lines
Quoted 3 lines

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.

Quoted 37 lines
Quoted 37 lines

}
#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)

Quoted 7 lines
Quoted 3 lines

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.

---
 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(-)
arch/arm/mach-iop13xx/include/mach/io.h +4 -2
index dffb234..90bb7df 100644
@@ -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)
 
arch/arm/mach-iop13xx/include/mach/iop13xx.h +3 -9
index 07e9ff7..ee1dfd2 100644
@@ -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 -\
arch/arm/mach-iop13xx/io.c +0 -27
index 48642e6..7a1ab4d 100644
@@ -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;
 	}
arch/arm/mach-iop13xx/pci.c +6 -6
index b8f5a87..d72eddf 100644
@@ -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:
#40 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 24 lines · Arnd Bergmann
Quoted 23 lines · Rob Herring
Quoted 21 lines · Arnd Bergmann
Quoted 4 lines · Rob Herring

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);
Quoted 5 lines
Quoted 2 lines

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.

#41 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 11 lines · Russell King - ARM Linux
Quoted 2 lines

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)

Quoted 7 lines

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

#42 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Russell King - ARM Linux
Quoted 39 lines · Russell King - ARM Linux
Quoted 24 lines · Arnd Bergmann
Quoted 23 lines · Rob Herring
Quoted 21 lines · Arnd Bergmann
Quoted 4 lines · Rob Herring

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);
Quoted 5 lines
Quoted 2 lines

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)

Quoted 7 lines

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

#43 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 22 lines · Rob Herring

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));
}
Quoted 3 lines

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

Quoted 2 lines

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.

Quoted 2 lines

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.

#44 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 6 lines · Russell King - ARM Linux
Quoted 2 lines · Rob Herring

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

#45 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 21 lines · Nicolas Pitre
Quoted 6 lines · Russell King - ARM Linux
Quoted 2 lines · Rob Herring

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);
        }
Quoted 5 lines

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

#46 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Russell King - ARM Linux
Quoted 7 lines · Russell King - ARM Linux
Quoted 2 lines

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.

Quoted 5 lines
Quoted 2 lines

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

#47 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Arnd Bergmann
Quoted 73 lines · Arnd Bergmann
Quoted 19 lines · Rob Herring
Quoted 18 lines · Arnd Bergmann
Quoted 4 lines · Rob Herring

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;

Quoted 6 lines
Quoted 3 lines

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.

Quoted 43 lines
Quoted 31 lines

}
#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)

Quoted 9 lines

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.

Quoted 9 lines
Quoted 1 line

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

Quoted 170 lines

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.

---
 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(-)
arch/arm/mach-iop13xx/include/mach/io.h +4 -2
index dffb234..90bb7df 100644
@@ -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)
 
arch/arm/mach-iop13xx/include/mach/iop13xx.h +3 -9
index 07e9ff7..ee1dfd2 100644
@@ -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 -\
arch/arm/mach-iop13xx/io.c +0 -27
index 48642e6..7a1ab4d 100644
@@ -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;
 	}
arch/arm/mach-iop13xx/pci.c +6 -6
index b8f5a87..d72eddf 100644
@@ -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:
#48 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 13 lines · Rob Herring
Quoted 12 lines
Quoted 4 lines

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.

Quoted 4 lines

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

#49 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Arnd Bergmann
Quoted 117 lines · Arnd Bergmann
Quoted 22 lines · Rob Herring

Arnd,

Quoted 15 lines · Arnd Bergmann
Quoted 5 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

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

Quoted 8 lines
Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 6 lines

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.

Quoted 3 lines

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.

Quoted 4 lines

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)

Quoted 5 lines

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

#50 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 10 lines · Rob Herring
Quoted 5 lines

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.

Quoted 4 lines

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.

Quoted 5 lines

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

#51 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

In reply to Rob Herring
Quoted 10 lines · Rob Herring

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.

<snip>

arch/arm/include/asm/io.h static inline void __iomem *__typesafe_io(unsigned long addr) · line 117

Quoted 6 lines
arch/arm/include/asm/io.h +5 -0
+#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

#52 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 12 lines · H Hartley Sweeten

arch/arm/include/asm/io.h static inline void __iomem *__typesafe_io(unsigned long addr) · line 117

Quoted 6 lines
arch/arm/include/asm/io.h +5 -0
+#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.

Quoted 8 lines

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

#53 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 26 lines · Arnd Bergmann
Quoted 12 lines · H Hartley Sweeten

arch/arm/include/asm/io.h static inline void __iomem *__typesafe_io(unsigned long addr) · line 117

Quoted 6 lines
arch/arm/include/asm/io.h +5 -0
+#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.

Quoted 8 lines

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.

Quoted 5 lines

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

#54 lore raw

PATCH 13/15 ARM: make mach/io.h include optional

Quoted 8 lines · H Hartley Sweeten

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.

Quoted 1 line

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

#55 lore raw

PATCH 14/15 ARM: remove bunch of now unused mach/io.h files

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 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
arch/arm/mach-at91/include/mach/io.h deleted +0 -49
deleted file mode 100644
index 4ca09ef..0000000
@@ -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
arch/arm/mach-bcmring/include/mach/io.h deleted +0 -33
deleted file mode 100644
index dae5e9b..0000000
@@ -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
arch/arm/mach-clps711x/include/mach/io.h deleted +0 -36
deleted file mode 100644
index 2e0b3ce..0000000
@@ -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
arch/arm/mach-cns3xxx/include/mach/io.h deleted +0 -17
deleted file mode 100644
index 33b6fc1..0000000
@@ -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
arch/arm/mach-davinci/include/mach/io.h deleted +0 -24
deleted file mode 100644
index b2267d1..0000000
@@ -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 */
arch/arm/mach-ep93xx/include/mach/io.h deleted +0 -22
deleted file mode 100644
index 594b77f..0000000
@@ -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 */
arch/arm/mach-exynos/include/mach/io.h deleted +0 -26
deleted file mode 100644
index d5478d2..0000000
@@ -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 <[email protected]>
- *
- * 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 */
arch/arm/mach-gemini/include/mach/io.h deleted +0 -18
deleted file mode 100644
index c548056..0000000
@@ -1,18 +0,0 @@
-/*
- *  Copyright (C) 2001-2006 Storlink, Corp.
- *  Copyright (C) 2008-2009 Paulius Zaleckas <[email protected]>
- *
- * 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 */
arch/arm/mach-h720x/include/mach/io.h deleted +0 -22
deleted file mode 100644
index 2c8659c..0000000
@@ -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 <[email protected]>:
- *  		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
arch/arm/mach-highbank/include/mach/io.h deleted +0 -7
deleted file mode 100644
index 70cfa3b..0000000
@@ -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
arch/arm/mach-ks8695/include/mach/io.h deleted +0 -19
deleted file mode 100644
index a7a63ac..0000000
@@ -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
arch/arm/mach-lpc32xx/include/mach/io.h deleted +0 -27
deleted file mode 100644
index 9b59ab5..0000000
@@ -1,27 +0,0 @@
-/*
- * arch/arm/mach-lpc32xx/include/mach/io.h
- *
- * Author: Kevin Wells <[email protected]>
- *
- * 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
arch/arm/mach-mmp/include/mach/io.h deleted +0 -21
deleted file mode 100644
index e7adf3d..0000000
@@ -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 */
arch/arm/mach-msm/include/mach/io.h deleted +0 -24
deleted file mode 100644
index 1071f98..0000000
@@ -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
arch/arm/mach-mxs/include/mach/io.h deleted +0 -22
deleted file mode 100644
index 289b722..0000000
@@ -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__ */
arch/arm/mach-netx/include/mach/io.h deleted +0 -28
deleted file mode 100644
index c3921cb..0000000
@@ -1,28 +0,0 @@
-/*
- *  arch/arm/mach-netx/include/mach/io.h
- *
- * Copyright (C) 2005 Sascha Hauer <[email protected]>, 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
arch/arm/mach-nomadik/include/mach/io.h deleted +0 -22
deleted file mode 100644
index 2e1eca1..0000000
@@ -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
arch/arm/mach-orion5x/include/mach/io.h deleted +0 -21
deleted file mode 100644
index 444136d..0000000
@@ -1,21 +0,0 @@
-/*
- * arch/arm/mach-orion5x/include/mach/io.h
- *
- * Tzachi Perelstein <[email protected]>
- *
- * 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
arch/arm/mach-picoxcell/include/mach/io.h deleted +0 -22
deleted file mode 100644
index 7573ec7..0000000
@@ -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 */
arch/arm/mach-pnx4008/include/mach/io.h deleted +0 -21
deleted file mode 100644
index cbf0904..0000000
@@ -1,21 +0,0 @@
-
-/*
- *  arch/arm/mach-pnx4008/include/mach/io.h
- *
- * Author: Dmitry Chigirev <[email protected]>
- *
- * 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
arch/arm/mach-prima2/include/mach/io.h deleted +0 -16
deleted file mode 100644
index 6c31e9e..0000000
@@ -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
arch/arm/mach-pxa/include/mach/io.h deleted +0 -20
deleted file mode 100644
index fdca3be..0000000
@@ -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
arch/arm/mach-realview/include/mach/io.h deleted +0 -28
deleted file mode 100644
index f05bcdf..0000000
@@ -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
arch/arm/mach-s3c64xx/include/mach/io.h deleted +0 -18
deleted file mode 100644
index de5716d..0000000
@@ -1,18 +0,0 @@
-/* arch/arm/mach-s3c64xxinclude/mach/io.h
- *
- * Copyright 2008 Simtec Electronics
- *	Ben Dooks <[email protected]>
- *
- * 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
arch/arm/mach-s5p64x0/include/mach/io.h deleted +0 -25
deleted file mode 100644
index a3e095c..0000000
@@ -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 <[email protected]>
- *
- * 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
arch/arm/mach-s5pc100/include/mach/io.h deleted +0 -18
deleted file mode 100644
index 819acf5..0000000
@@ -1,18 +0,0 @@
-/* arch/arm/mach-s5pc100/include/mach/io.h
- *
- * Copyright 2008 Simtec Electronics
- *	Ben Dooks <[email protected]>
- *
- * 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
arch/arm/mach-s5pv210/include/mach/io.h deleted +0 -26
deleted file mode 100644
index 5ab9d56..0000000
@@ -1,26 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/include/mach/io.h
- *
- * Copyright 2008-2010 Ben Dooks <[email protected]>
- *
- * 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 */
arch/arm/mach-sa1100/include/mach/io.h deleted +0 -20
deleted file mode 100644
index dfc27ff..0000000
@@ -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
arch/arm/mach-shmobile/include/mach/io.h deleted +0 -9
deleted file mode 100644
index 7339fe4..0000000
@@ -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 */
arch/arm/mach-spear3xx/include/mach/io.h deleted +0 -19
deleted file mode 100644
index 30cff8a..0000000
@@ -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<[email protected]>
- *
- * 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 */
arch/arm/mach-spear6xx/include/mach/io.h deleted +0 -20
deleted file mode 100644
index fb7c106..0000000
@@ -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<[email protected]>
- *
- * 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 */
-
arch/arm/mach-u300/include/mach/io.h deleted +0 -20
deleted file mode 100644
index 5d6b4c1..0000000
@@ -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 <[email protected]>
- */
-#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
arch/arm/mach-ux500/include/mach/io.h deleted +0 -22
deleted file mode 100644
index 1cf3f44..0000000
@@ -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
arch/arm/mach-versatile/include/mach/io.h deleted +0 -28
deleted file mode 100644
index f067c14..0000000
@@ -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
arch/arm/mach-vexpress/include/mach/io.h deleted +0 -26
deleted file mode 100644
index 13522d8..0000000
@@ -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
arch/arm/mach-w90x900/include/mach/io.h deleted +0 -30
deleted file mode 100644
index d96ab99..0000000
@@ -1,30 +0,0 @@
-/*
- * arch/arm/mach-w90x900/include/mach/io.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <[email protected]>
- *
- * 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
arch/arm/mach-zynq/include/mach/io.h deleted +0 -33
deleted file mode 100644
index 39d9885..0000000
@@ -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
arch/arm/plat-mxc/include/mach/io.h deleted +0 -22
deleted file mode 100644
index ea9d95e..0000000
@@ -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
arch/arm/plat-spear/include/plat/io.h deleted +0 -22
deleted file mode 100644
index 4d4ba82..0000000
@@ -1,22 +0,0 @@
-/*
- * arch/arm/plat-spear/include/plat/io.h
- *
- * IO definitions for SPEAr platform
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<[email protected]>
- *
- * 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 */
Signature · 1 line
1.7.5.4
#56 lore raw

PATCH 14/15 ARM: remove bunch of now unused mach/io.h files

Quoted 5 lines · Rob Herring

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

---

<snip>

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

<snip>

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

<snip>

Quoted 8 lines
arch/arm/mach-ep93xx/include/mach/io.h deleted +0 -2
deleted file mode 100644
index 594b77f..0000000
@@ -1,22 +0,0 @@
-/*
- * arch/arm/mach-ep93xx/include/mach/io.h

arch/arm/mach-ep93xx/include/mach/io.h line 12

Quoted 10 lines
arch/arm/mach-ep93xx/include/mach/io.h deleted +0 -10
- */
-
-#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:

arch/arm/mach-ep93xx/include/mach/io.h line 20

Quoted 8 lines
arch/arm/mach-ep93xx/include/mach/io.h deleted +0 -8
-/*
- * 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.

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

Quoted 2 lines
arch/arm/mach-ep93xx/include/mach/io.h deleted +0 -2
-
-#endif /* __ASM_MACH_IO_H */

Regards,
Hartley

#58 lore raw

PATCH 14/15 ARM: remove bunch of now unused mach/io.h files

In reply to Rob Herring
Quoted 2 lines · Rob Herring

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

Great!

For these:

Quoted 3 lines
?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 -------------

Yours,
Linus Walleij

#59 lore raw

PATCH 15/15 ARM: kill off __mem_pci

In reply to Rob Herring

From: Rob Herring <[email protected]>

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

---
 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(-)
arch/arm/include/asm/io.h +17 -29
index 5e0ca53..0f506a8 100644
@@ -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.
arch/arm/mach-dove/include/mach/io.h +0 -1
index eb4936f..29c8b85 100644
@@ -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
arch/arm/mach-footbridge/include/mach/io.h +0 -13
index 15a7039..aba531ee 100644
@@ -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
arch/arm/mach-integrator/include/mach/io.h +0 -1
index 37beed3..8de70de 100644
@@ -29,6 +29,5 @@
 #define PCI_IO_VADDR            0xee000000
 
 #define __io(a)			((void __iomem *)(PCI_IO_VADDR + (a)))
-#define __mem_pci(a)		(a)
 
 #endif
arch/arm/mach-iop13xx/include/mach/io.h +0 -2
index dffb234..858ba98 100644
@@ -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,
arch/arm/mach-iop32x/include/mach/io.h +0 -1
index 2d88264..e2ada26 100644
@@ -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
arch/arm/mach-iop33x/include/mach/io.h +0 -1
index a8a66fc..f7c1b65 100644
@@ -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
arch/arm/mach-ixp2000/include/mach/io.h +0 -1
index 859e584..f6552d6 100644
@@ -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
arch/arm/mach-ixp23xx/include/mach/io.h +0 -1
index 4ce4353..a7aceb5 100644
@@ -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
arch/arm/mach-ixp4xx/include/mach/io.h +1 -5
index ffb9d6a..d76a9bb 100644
@@ -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
arch/arm/mach-kirkwood/include/mach/io.h +0 -2
index 49dd0cb..5d0ab61 100644
@@ -20,7 +20,5 @@ static inline void __iomem *__io(unsigned long addr)
 }
 
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
arch/arm/mach-mv78xx0/include/mach/io.h +0 -2
index 450e0e1..c7d9d00 100644
@@ -20,7 +20,5 @@ static inline void __iomem *__io(unsigned long addr)
 }
 
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
arch/arm/mach-rpc/include/mach/io.h +0 -5
index 695f4ed..707071a 100644
@@ -28,9 +28,4 @@
  */
 #define __io(a)		(PCIO_BASE + ((a) << 2))
 
-/*
- * 1:1 mapping for ioremapped regions.
- */
-#define __mem_pci(x)	(x)
-
 #endif
arch/arm/mach-s3c2410/include/mach/io.h +0 -5
index 118749f..5dd1db4 100644
@@ -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
arch/arm/mach-shark/include/mach/io.h +0 -2
index 9ccbcec..1a45fc0 100644
@@ -15,6 +15,4 @@
 
 #define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
 
-#define __mem_pci(addr) (addr)
-
 #endif
arch/arm/mach-tegra/include/mach/io.h +0 -1
index 47b4b61..fe700f9 100644
@@ -40,7 +40,6 @@ static inline void __iomem *__io(unsigned long addr)
 #endif
 
 #define __io(a)         __io(a)
-#define __mem_pci(a)    (a)
 
 #endif
 
arch/arm/mach-vt8500/include/mach/io.h +0 -1
index 46181ee..fe30fa9 100644
@@ -21,6 +21,5 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io((a) + 0xf0000000)
-#define __mem_pci(a)	(a)
 
 #endif
Signature · 1 line
1.7.5.4
#60 lore raw

cover mach/io.h cleanup and removal

In reply to Rob Herring
Quoted 7 lines · Rob Herring

From: Rob Herring <[email protected]>

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

#61 lore raw

cover mach/io.h cleanup and removal

Quoted 9 lines · Tony Lindgren
Quoted 7 lines · Rob Herring

From: Rob Herring <[email protected]>

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.

Quoted 6 lines

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

#62 lore raw

cover mach/io.h cleanup and removal

In reply to Tony Lindgren
Quoted 9 lines · Tony Lindgren
Quoted 7 lines · Rob Herring

From: Rob Herring <[email protected]>

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.

Quoted 6 lines

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

#63 lore raw

cover mach/io.h cleanup and removal

In reply to Rob Herring
Quoted 3 lines · Rob Herring
 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 +

...

Quoted 5 lines
 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..

Quoted 1 line
 arch/arm/mach-tegra/include/mach/iomap.h          |   48 ++++++++++++++++++

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

Tony

#64 lore raw

cover mach/io.h cleanup and removal

Quoted 10 lines · Tony Lindgren
Quoted 3 lines · Rob Herring
 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 +

...

Quoted 5 lines
 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 ++
Quoted 7 lines

...

Considering the naming above..

Quoted 1 line
 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

#65 lore raw

cover mach/io.h cleanup and removal

Quoted 15 lines · Rob Herring
Quoted 14 lines · Tony Lindgren
Quoted 3 lines · Rob Herring
 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 +

...

Quoted 5 lines
 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..

Quoted 8 lines
Quoted 3 lines
Quoted 1 line
 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

#66 lore raw

cover mach/io.h cleanup and removal

Quoted 9 lines · Tony Lindgren

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

Quoted 7 lines

#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

#67 lore raw

cover mach/io.h cleanup and removal

Quoted 23 lines · Arnd Bergmann
Quoted 9 lines · Tony Lindgren

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

Quoted 7 lines

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

Quoted 6 lines

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.

Quoted 3 lines

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

#68 lore raw

cover mach/io.h cleanup and removal

In reply to Arnd Bergmann
Quoted 25 lines · Arnd Bergmann
Quoted 9 lines · Tony Lindgren

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

Quoted 7 lines

#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

Quoted 9 lines

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

#69 lore raw

cover mach/io.h cleanup and removal

Quoted 36 lines · Rob Herring
Quoted 25 lines · Arnd Bergmann
Quoted 9 lines · Tony Lindgren

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

Quoted 7 lines

#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

Quoted 9 lines

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.

Quoted 6 lines

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

#70 lore raw

cover mach/io.h cleanup and removal

Quoted 9 lines · Tony Lindgren
Quoted 6 lines

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.

Quoted 1 line

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

#71 lore raw

cover mach/io.h cleanup and removal

Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Tony Lindgren
Quoted 6 lines

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.

Quoted 7 lines

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

Quoted 8 lines

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.

Quoted 1 line

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

How about this:

Quoted 7 lines

* 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

#72 lore raw

cover mach/io.h cleanup and removal

Quoted 9 lines · Rob Herring
Quoted 5 lines

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.

Quoted 2 lines

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

Good point.

Quoted 9 lines
Quoted 3 lines

* 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

#73 lore raw

cover mach/io.h cleanup and removal

In reply to Rob Herring

Rob Herring wrote at Monday, February 13, 2012 2:43 PM:

Quoted 5 lines

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,

Signature · 1 line
nvpublic