Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * IXP4xx Device Tree boot support
0004  */
0005 #include <linux/kernel.h>
0006 #include <linux/init.h>
0007 #include <linux/io.h>
0008 
0009 #include <asm/mach/arch.h>
0010 #include <asm/mach/map.h>
0011 
0012 /*
0013  * These are the only fixed phys to virt mappings we ever need
0014  * we put it right after the UART mapping at 0xffc80000-0xffc81fff
0015  */
0016 #define IXP4XX_EXP_CFG_BASE_PHYS    0xC4000000
0017 #define IXP4XX_EXP_CFG_BASE_VIRT    0xFEC14000
0018 
0019 static struct map_desc ixp4xx_of_io_desc[] __initdata = {
0020     /*
0021      * This is needed for runtime system configuration checks,
0022      * such as reading if hardware so-and-so is present. This
0023      * could eventually be converted into a syscon once all boards
0024      * are converted to device tree.
0025      */
0026     {
0027         .virtual = IXP4XX_EXP_CFG_BASE_VIRT,
0028         .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
0029         .length = SZ_4K,
0030         .type = MT_DEVICE,
0031     },
0032 #ifdef CONFIG_DEBUG_UART_8250
0033     /* This is needed for LL-debug/earlyprintk/debug-macro.S */
0034     {
0035         .virtual = CONFIG_DEBUG_UART_VIRT,
0036         .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
0037         .length = SZ_4K,
0038         .type = MT_DEVICE,
0039     },
0040 #endif
0041 };
0042 
0043 static void __init ixp4xx_of_map_io(void)
0044 {
0045     iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc));
0046 }
0047 
0048 /*
0049  * We handle 4 different SoC families. These compatible strings are enough
0050  * to provide the core so that different boards can add their more detailed
0051  * specifics.
0052  */
0053 static const char *ixp4xx_of_board_compat[] = {
0054     "intel,ixp42x",
0055     "intel,ixp43x",
0056     "intel,ixp45x",
0057     "intel,ixp46x",
0058     NULL,
0059 };
0060 
0061 DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)")
0062     .map_io     = ixp4xx_of_map_io,
0063     .dt_compat  = ixp4xx_of_board_compat,
0064 MACHINE_END