linux/arch/arm/mach-ixp4xx/ixp4xx-of.c
Linus Walleij 713ce38d46 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>
2021-06-16 15:14:21 +02:00

65 lines
1.6 KiB
C

// SPDX-License-Identifier: GPL-2.0
/*
* IXP4xx Device Tree boot support
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
/*
* These are the only fixed phys to virt mappings we ever need
* we put it right after the UART mapping at 0xffc80000-0xffc81fff
*/
#define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000
#define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000
static struct map_desc ixp4xx_of_io_desc[] __initdata = {
/*
* This is needed for runtime system configuration checks,
* such as reading if hardware so-and-so is present. This
* could eventually be converted into a syscon once all boards
* are converted to device tree.
*/
{
.virtual = IXP4XX_EXP_CFG_BASE_VIRT,
.pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
.length = SZ_4K,
.type = MT_DEVICE,
},
#ifdef CONFIG_DEBUG_UART_8250
/* This is needed for LL-debug/earlyprintk/debug-macro.S */
{
.virtual = CONFIG_DEBUG_UART_VIRT,
.pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
.length = SZ_4K,
.type = MT_DEVICE,
},
#endif
};
static void __init ixp4xx_of_map_io(void)
{
iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc));
}
/*
* We handle 4 differen SoC families. These compatible strings are enough
* to provide the core so that different boards can add their more detailed
* specifics.
*/
static const char *ixp4xx_of_board_compat[] = {
"intel,ixp42x",
"intel,ixp43x",
"intel,ixp45x",
"intel,ixp46x",
NULL,
};
DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)")
.map_io = ixp4xx_of_map_io,
.dt_compat = ixp4xx_of_board_compat,
MACHINE_END