Commit 19ec6cac authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge branch 'cleanup/io-pci' into next/cleanups



From Rob Herring <robherring2@gmail.com>:

This is the 2nd part of mach/io.h removals. This series removes io.h on
platforms with PCI by creating a fixed virtual I/O mapping and a common
__io() macro.

This version has changed a bit to accommodate Tegra converting its PCIe
host to a platform driver. Now the virtual space is only reserved during
early boot before .map_io() is called. The mapping is not created until
calling pci_ioremap_io which can be done at any point after vmalloc is
initialized.

I've gone back to fixed 64K windows for each PCI bus. This allows
removing all the i/o resource setup from the individually platforms and
placing it within the common ARM PCI code.

I've only tested versatilepb under qemu (with the model hacked up to
actually enable i/o space), so any testing is appreciated. iop3xx and
mv78xx0 have some risk of breaking as the PCI bus addresses are moved
to 0 from matching the cpu host bus addesss.

* cleanup/io-pci:
  ARM: iop3xx: use fixed PCI i/o mapping
  ARM: mv78xx0: use fixed pci i/o mapping
  ARM: iop13xx: use fixed PCI i/o mapping
  iop13xx: use more regular PCI I/O space handling
  ARM: orion5x: use fixed PCI i/o mapping
  ARM: kirkwood: use fixed PCI i/o mapping
  ARM: dove: use fixed PCI i/o mapping
  ARM: footbridge: use fixed PCI i/o mapping
  ARM: shark: use fixed PCI i/o mapping
  ARM: integrator: remove trailing whitespace on pci_v3.c
  ARM: integrator: use fixed PCI i/o mapping
  ARM: tegra: use fixed PCI i/o mapping
  ARM: versatile: use fixed PCI i/o mapping
  ARM: move PCI i/o resource setup into common code
  ARM: Add fixed PCI i/o mapping
  i2c: iop3xx: use standard gpiolib functions
  i2c: iop3xx: clean-up trailing whitespace

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 0d7614f0 dd9bf780
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ ffc00000 ffefffff DMA memory mapping region. Memory returned
ff000000	ffbfffff	Reserved for future expansion of DMA
				mapping region.

fee00000	feffffff	Mapping of PCI I/O space. This is a static
				mapping within the vmalloc space.

VMALLOC_START	VMALLOC_END-1	vmalloc() / ioremap() space.
				Memory returned by vmalloc/ioremap will
				be dynamically placed in this region.
+1 −12
Original line number Diff line number Diff line
@@ -285,7 +285,6 @@ config ARCH_INTEGRATOR
	select GENERIC_CLOCKEVENTS
	select PLAT_VERSATILE
	select PLAT_VERSATILE_FPGA_IRQ
	select NEED_MACH_IO_H
	select NEED_MACH_MEMORY_H
	select SPARSE_IRQ
	select MULTI_IRQ_HANDLER
@@ -318,7 +317,6 @@ config ARCH_VERSATILE
	select ICST
	select GENERIC_CLOCKEVENTS
	select ARCH_WANT_OPTIONAL_GPIOLIB
	select NEED_MACH_IO_H if PCI
	select PLAT_VERSATILE
	select PLAT_VERSATILE_CLOCK
	select PLAT_VERSATILE_CLCD
@@ -462,7 +460,7 @@ config ARCH_FOOTBRIDGE
	select FOOTBRIDGE
	select GENERIC_CLOCKEVENTS
	select HAVE_IDE
	select NEED_MACH_IO_H
	select NEED_MACH_IO_H if !MMU
	select NEED_MACH_MEMORY_H
	help
	  Support for systems based on the DC21285 companion chip
@@ -519,7 +517,6 @@ config ARCH_IOP13XX
	select PCI
	select ARCH_SUPPORTS_MSI
	select VMSPLIT_1G
	select NEED_MACH_IO_H
	select NEED_MACH_MEMORY_H
	select NEED_RET_TO_USER
	help
@@ -529,7 +526,6 @@ config ARCH_IOP32X
	bool "IOP32x-based"
	depends on MMU
	select CPU_XSCALE
	select NEED_MACH_IO_H
	select NEED_RET_TO_USER
	select PLAT_IOP
	select PCI
@@ -542,7 +538,6 @@ config ARCH_IOP33X
	bool "IOP33x-based"
	depends on MMU
	select CPU_XSCALE
	select NEED_MACH_IO_H
	select NEED_RET_TO_USER
	select PLAT_IOP
	select PCI
@@ -582,7 +577,6 @@ 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
@@ -593,7 +587,6 @@ 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:
@@ -620,7 +613,6 @@ 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:
@@ -633,7 +625,6 @@ config ARCH_ORION5X
	select PCI
	select ARCH_REQUIRE_GPIOLIB
	select GENERIC_CLOCKEVENTS
	select NEED_MACH_IO_H
	select PLAT_ORION
	help
	  Support for the following Marvell Orion 5x series SoCs:
@@ -689,7 +680,6 @@ config ARCH_TEGRA
	select HAVE_CLK
	select HAVE_SMP
	select MIGHT_HAVE_CACHE_L2X0
	select NEED_MACH_IO_H if PCI
	select ARCH_HAS_CPUFREQ
	select USE_OF
	help
@@ -918,7 +908,6 @@ 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>).
+1 −11
Original line number Diff line number Diff line
@@ -217,18 +217,8 @@ extern int iop3xx_get_init_atu(void);
#define IOP3XX_PCI_LOWER_MEM_PA	0x80000000
#define IOP3XX_PCI_MEM_WINDOW_SIZE	0x08000000

#define IOP3XX_PCI_IO_WINDOW_SIZE	0x00010000
#define IOP3XX_PCI_LOWER_IO_PA		0x90000000
#define IOP3XX_PCI_LOWER_IO_VA		0xfe000000
#define IOP3XX_PCI_LOWER_IO_BA		0x90000000
#define IOP3XX_PCI_UPPER_IO_PA		(IOP3XX_PCI_LOWER_IO_PA +\
					IOP3XX_PCI_IO_WINDOW_SIZE - 1)
#define IOP3XX_PCI_UPPER_IO_VA		(IOP3XX_PCI_LOWER_IO_VA +\
					IOP3XX_PCI_IO_WINDOW_SIZE - 1)
#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\
					IOP3XX_PCI_LOWER_IO_PA) +\
					IOP3XX_PCI_LOWER_IO_VA)

#define IOP3XX_PCI_LOWER_IO_BA		0x00000000

#ifndef __ASSEMBLY__

+8 −0
Original line number Diff line number Diff line
@@ -113,11 +113,19 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
#define __iowmb()		do { } while (0)
#endif

/* PCI fixed i/o mapping */
#define PCI_IO_VIRT_BASE	0xfee00000

extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);

/*
 * Now, pick up the machine-defined IO definitions
 */
#ifdef CONFIG_NEED_MACH_IO_H
#include <mach/io.h>
#elif defined(CONFIG_PCI)
#define IO_SPACE_LIMIT	((resource_size_t)0xfffff)
#define __io(a)		__typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT))
#else
#define __io(a)		__typesafe_io((a) & IO_SPACE_LIMIT)
#endif
+8 −0
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@
 *
 *  Page table mapping constructs and function prototypes
 */
#ifndef __ASM_MACH_MAP_H
#define __ASM_MACH_MAP_H

#include <asm/io.h>

struct map_desc {
@@ -34,6 +37,8 @@ struct map_desc {

#ifdef CONFIG_MMU
extern void iotable_init(struct map_desc *, int);
extern void vm_reserve_area_early(unsigned long addr, unsigned long size,
				  void *caller);

struct mem_type;
extern const struct mem_type *get_mem_type(unsigned int type);
@@ -44,4 +49,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
			const struct mem_type *mtype);
#else
#define iotable_init(map,num)	do { } while (0)
#define vm_reserve_area_early(a,s,c)	do { } while (0)
#endif

#endif
Loading