xref: /openbmc/linux/arch/arm/mach-ixp4xx/ixp4xx-of.c (revision dc6e328a)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * IXP4xx Device Tree boot support
4  */
5 #include <linux/kernel.h>
6 #include <linux/init.h>
7 #include <linux/io.h>
8 
9 #include <asm/mach/arch.h>
10 #include <asm/mach/map.h>
11 
12 #ifdef CONFIG_DEBUG_UART_8250
13 static struct map_desc ixp4xx_of_io_desc[] __initdata = {
14 	/* This is needed for LL-debug/earlyprintk/debug-macro.S */
15 	{
16 		.virtual = CONFIG_DEBUG_UART_VIRT,
17 		.pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
18 		.length = SZ_4K,
19 		.type = MT_DEVICE,
20 	},
21 };
22 
23 static void __init ixp4xx_of_map_io(void)
24 {
25 	iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc));
26 }
27 #else
28 #define ixp4xx_of_map_io NULL
29 #endif
30 
31 /*
32  * We handle 4 different SoC families. These compatible strings are enough
33  * to provide the core so that different boards can add their more detailed
34  * specifics.
35  */
36 static const char *ixp4xx_of_board_compat[] = {
37 	"intel,ixp42x",
38 	"intel,ixp43x",
39 	"intel,ixp45x",
40 	"intel,ixp46x",
41 	NULL,
42 };
43 
44 DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)")
45 	.map_io		= ixp4xx_of_map_io,
46 	.dt_compat	= ixp4xx_of_board_compat,
47 MACHINE_END
48