Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM/ixp4xx: Move the virtual IObases

UART1, UART2 and the expansion bus config registers
are the only registers mapped in a fixed location
when using device tree.

For device tree we also want to get rid of the custom
<mach/io.h> for IXP4xx. So we need to undefine
CONFIG_NEED_MACH_IO_H. Doing that activates the fixed
mapping of the PCI IO space to PCI_IO_VIRT_BASE which
is hardcoded to 0xFEE00000 and this would collide with
the old fixed mappings.

Move the fixed virtual IO base address from 0xFEF00000
to 0xFEC00000 in order to avoid the collision.

For the OF-only boot path let's even cut the reliance
on <mach/io.h> and just hardcode the one single virtbase
we need apart from the UART, which is hardcoded in
Kconfig.debug.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Krzysztof Halasa <khalasa@piap.pl>
Cc: Zoltan HERPAI <wigyori@uid0.hu>
Cc: Raylynn Knight <rayknight@me.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+12 -7
+2 -2
arch/arm/Kconfig.debug
··· 1803 1803 default 0xfedc0000 if DEBUG_EP93XX 1804 1804 default 0xfee003f8 if DEBUG_FOOTBRIDGE_COM1 1805 1805 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1806 - default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1807 - default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1806 + default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1807 + default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1808 1808 default 0xfef36000 if DEBUG_HIGHBANK_UART 1809 1809 default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 1810 1810 default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
+4 -3
arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
··· 45 45 * it can be used with the low-level debug code. 46 46 */ 47 47 #define IXP4XX_PERIPHERAL_BASE_PHYS 0xC8000000 48 - #define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEF00000) 48 + #define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEC00000) 49 49 #define IXP4XX_PERIPHERAL_REGION_SIZE 0x00013000 50 50 51 51 /* 52 52 * PCI Config registers 53 53 */ 54 54 #define IXP4XX_PCI_CFG_BASE_PHYS 0xC0000000 55 - #define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEF13000) 55 + #define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEC13000) 56 56 #define IXP4XX_PCI_CFG_REGION_SIZE 0x00001000 57 57 58 58 /* 59 59 * Expansion BUS Configuration registers 60 60 */ 61 61 #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000 62 - #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEF14000 62 + #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000 63 63 #define IXP4XX_EXP_CFG_REGION_SIZE 0x00001000 64 64 65 65 #define IXP4XX_EXP_CS0_OFFSET 0x00 ··· 120 120 #define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000) 121 121 122 122 123 + /* The UART is explicitly put in the beginning of fixmap */ 123 124 #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) 124 125 #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) 125 126 #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000)
+6 -2
arch/arm/mach-ixp4xx/ixp4xx-of.c
··· 9 9 #include <asm/mach/arch.h> 10 10 #include <asm/mach/map.h> 11 11 12 - #include <mach/hardware.h> 13 - #include <mach/ixp4xx-regs.h> 12 + /* 13 + * These are the only fixed phys to virt mappings we ever need 14 + * we put it right after the UART mapping at 0xffc80000-0xffc81fff 15 + */ 16 + #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000 17 + #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000 14 18 15 19 static struct map_desc ixp4xx_of_io_desc[] __initdata = { 16 20 /*