^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * IXP4xx Device Tree boot support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/mach/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <mach/hardware.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <mach/ixp4xx-regs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) static struct map_desc ixp4xx_of_io_desc[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * This is needed for runtime system configuration checks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * such as reading if hardware so-and-so is present. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * could eventually be converted into a syscon once all boards
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * are converted to device tree.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) .virtual = IXP4XX_EXP_CFG_BASE_VIRT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) .length = SZ_4K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) .type = MT_DEVICE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #ifdef CONFIG_DEBUG_UART_8250
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /* This is needed for LL-debug/earlyprintk/debug-macro.S */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) .virtual = CONFIG_DEBUG_UART_VIRT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) .length = SZ_4K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) .type = MT_DEVICE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) static void __init ixp4xx_of_map_io(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * We handle 4 differen SoC families. These compatible strings are enough
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * to provide the core so that different boards can add their more detailed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * specifics.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) static const char *ixp4xx_of_board_compat[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) "intel,ixp42x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) "intel,ixp43x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) "intel,ixp45x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) "intel,ixp46x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) .map_io = ixp4xx_of_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) .dt_compat = ixp4xx_of_board_compat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) MACHINE_END