2 * SAMSUNG EXYNOS5250 Flattened Device Tree enabled machine
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/of_platform.h>
13 #include <linux/serial_core.h>
14 #include <linux/memblock.h>
15 #include <linux/of_fdt.h>
17 #include <asm/mach/arch.h>
18 #include <asm/hardware/gic.h>
22 #include <plat/regs-serial.h>
28 * The following lookup table is used to override device names when devices
29 * are registered from device tree. This is temporarily added to enable
30 * device tree support addition for the EXYNOS5 architecture.
32 * For drivers that require platform data to be provided from the machine
33 * file, a platform data pointer can also be supplied along with the
34 * devices names. Usually, the platform data elements that cannot be parsed
35 * from the device tree by the drivers (example: function pointers) are
36 * supplied. But it should be noted that this is a temporary mechanism and
37 * at some point, the drivers should be capable of parsing all the platform
38 * data from the device tree.
40 static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
41 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART0,
42 "exynos4210-uart.0", NULL),
43 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART1,
44 "exynos4210-uart.1", NULL),
45 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART2,
46 "exynos4210-uart.2", NULL),
47 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART3,
48 "exynos4210-uart.3", NULL),
49 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(0),
50 "s3c2440-i2c.0", NULL),
51 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
52 "s3c2440-i2c.1", NULL),
53 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
55 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1,
57 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI2,
59 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI3,
61 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI0,
62 "exynos4210-spi.0", NULL),
63 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI1,
64 "exynos4210-spi.1", NULL),
65 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI2,
66 "exynos4210-spi.2", NULL),
67 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL),
68 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL),
69 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
70 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC0,
71 "exynos-gsc.0", NULL),
72 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC1,
73 "exynos-gsc.1", NULL),
74 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC2,
75 "exynos-gsc.2", NULL),
76 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
77 "exynos-gsc.3", NULL),
78 OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
79 OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000,
84 static void __init exynos5250_dt_map_io(void)
86 exynos_init_io(NULL, 0);
87 s3c24xx_init_clocks(24000000);
90 static void __init exynos5250_dt_machine_init(void)
92 of_platform_populate(NULL, of_default_bus_match_table,
93 exynos5250_auxdata_lookup, NULL);
96 static char const *exynos5250_dt_compat[] __initdata = {
101 static void __init exynos5_reserve(void)
103 struct s5p_mfc_dt_meminfo mfc_mem;
105 /* Reserve memory for MFC only if it's available */
106 mfc_mem.compatible = "samsung,mfc-v6";
107 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
108 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
112 DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
113 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
114 .init_irq = exynos5_init_irq,
115 .smp = smp_ops(exynos_smp_ops),
116 .map_io = exynos5250_dt_map_io,
117 .handle_irq = gic_handle_irq,
118 .init_machine = exynos5250_dt_machine_init,
119 .init_late = exynos_init_late,
120 .timer = &exynos4_timer,
121 .dt_compat = exynos5250_dt_compat,
122 .restart = exynos5_restart,
123 .reserve = exynos5_reserve,