diff options
Diffstat (limited to 'arch/arm/mach-exynos/mach-exynos4-dt.c')
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos4-dt.c | 122 |
1 files changed, 20 insertions, 102 deletions
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 3358088c822a..ac27f3cd121f 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c | |||
@@ -11,121 +11,26 @@ | |||
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/kernel.h> | ||
14 | #include <linux/of_platform.h> | 15 | #include <linux/of_platform.h> |
16 | #include <linux/of_fdt.h> | ||
15 | #include <linux/serial_core.h> | 17 | #include <linux/serial_core.h> |
18 | #include <linux/memblock.h> | ||
19 | #include <linux/clocksource.h> | ||
16 | 20 | ||
17 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
18 | #include <mach/map.h> | 22 | #include <plat/mfc.h> |
19 | |||
20 | #include <plat/cpu.h> | ||
21 | #include <plat/regs-serial.h> | ||
22 | 23 | ||
23 | #include "common.h" | 24 | #include "common.h" |
24 | 25 | ||
25 | /* | ||
26 | * The following lookup table is used to override device names when devices | ||
27 | * are registered from device tree. This is temporarily added to enable | ||
28 | * device tree support addition for the Exynos4 architecture. | ||
29 | * | ||
30 | * For drivers that require platform data to be provided from the machine | ||
31 | * file, a platform data pointer can also be supplied along with the | ||
32 | * devices names. Usually, the platform data elements that cannot be parsed | ||
33 | * from the device tree by the drivers (example: function pointers) are | ||
34 | * supplied. But it should be noted that this is a temporary mechanism and | ||
35 | * at some point, the drivers should be capable of parsing all the platform | ||
36 | * data from the device tree. | ||
37 | */ | ||
38 | static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { | ||
39 | OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART0, | ||
40 | "exynos4210-uart.0", NULL), | ||
41 | OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART1, | ||
42 | "exynos4210-uart.1", NULL), | ||
43 | OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART2, | ||
44 | "exynos4210-uart.2", NULL), | ||
45 | OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART3, | ||
46 | "exynos4210-uart.3", NULL), | ||
47 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0), | ||
48 | "exynos4-sdhci.0", NULL), | ||
49 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1), | ||
50 | "exynos4-sdhci.1", NULL), | ||
51 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2), | ||
52 | "exynos4-sdhci.2", NULL), | ||
53 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3), | ||
54 | "exynos4-sdhci.3", NULL), | ||
55 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0), | ||
56 | "s3c2440-i2c.0", NULL), | ||
57 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(1), | ||
58 | "s3c2440-i2c.1", NULL), | ||
59 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(2), | ||
60 | "s3c2440-i2c.2", NULL), | ||
61 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(3), | ||
62 | "s3c2440-i2c.3", NULL), | ||
63 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(4), | ||
64 | "s3c2440-i2c.4", NULL), | ||
65 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(5), | ||
66 | "s3c2440-i2c.5", NULL), | ||
67 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(6), | ||
68 | "s3c2440-i2c.6", NULL), | ||
69 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(7), | ||
70 | "s3c2440-i2c.7", NULL), | ||
71 | OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI0, | ||
72 | "exynos4210-spi.0", NULL), | ||
73 | OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI1, | ||
74 | "exynos4210-spi.1", NULL), | ||
75 | OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI2, | ||
76 | "exynos4210-spi.2", NULL), | ||
77 | OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL), | ||
78 | OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL), | ||
79 | OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_MDMA1, "dma-pl330.2", NULL), | ||
80 | OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU, | ||
81 | "exynos-tmu", NULL), | ||
82 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13620000, | ||
83 | "exynos-sysmmu.0", NULL), /* MFC_L */ | ||
84 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13630000, | ||
85 | "exynos-sysmmu.1", NULL), /* MFC_R */ | ||
86 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13E20000, | ||
87 | "exynos-sysmmu.2", NULL), /* TV */ | ||
88 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A60000, | ||
89 | "exynos-sysmmu.3", NULL), /* JPEG */ | ||
90 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12A30000, | ||
91 | "exynos-sysmmu.4", NULL), /* ROTATOR */ | ||
92 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A20000, | ||
93 | "exynos-sysmmu.5", NULL), /* FIMC0 */ | ||
94 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A30000, | ||
95 | "exynos-sysmmu.6", NULL), /* FIMC1 */ | ||
96 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A40000, | ||
97 | "exynos-sysmmu.7", NULL), /* FIMC2 */ | ||
98 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11A50000, | ||
99 | "exynos-sysmmu.8", NULL), /* FIMC3 */ | ||
100 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12A20000, | ||
101 | "exynos-sysmmu.9", NULL), /* G2D(4210) */ | ||
102 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x10A40000, | ||
103 | "exynos-sysmmu.9", NULL), /* G2D(4x12) */ | ||
104 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11E20000, | ||
105 | "exynos-sysmmu.10", NULL), /* FIMD0 */ | ||
106 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12220000, | ||
107 | "exynos-sysmmu.11", NULL), /* FIMD1(4210) */ | ||
108 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x12260000, | ||
109 | "exynos-sysmmu.12", NULL), /* IS0(4x12) */ | ||
110 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x122B0000, | ||
111 | "exynos-sysmmu.13", NULL), /* IS1(4x12) */ | ||
112 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x123B0000, | ||
113 | "exynos-sysmmu.14", NULL), /* FIMC-LITE0(4x12) */ | ||
114 | OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x123C0000, | ||
115 | "exynos-sysmmu.15", NULL), /* FIMC-LITE1(4x12) */ | ||
116 | {}, | ||
117 | }; | ||
118 | |||
119 | static void __init exynos4_dt_map_io(void) | 26 | static void __init exynos4_dt_map_io(void) |
120 | { | 27 | { |
121 | exynos_init_io(NULL, 0); | 28 | exynos_init_io(NULL, 0); |
122 | s3c24xx_init_clocks(24000000); | ||
123 | } | 29 | } |
124 | 30 | ||
125 | static void __init exynos4_dt_machine_init(void) | 31 | static void __init exynos4_dt_machine_init(void) |
126 | { | 32 | { |
127 | of_platform_populate(NULL, of_default_bus_match_table, | 33 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
128 | exynos4_auxdata_lookup, NULL); | ||
129 | } | 34 | } |
130 | 35 | ||
131 | static char const *exynos4_dt_compat[] __initdata = { | 36 | static char const *exynos4_dt_compat[] __initdata = { |
@@ -135,6 +40,18 @@ static char const *exynos4_dt_compat[] __initdata = { | |||
135 | NULL | 40 | NULL |
136 | }; | 41 | }; |
137 | 42 | ||
43 | static void __init exynos4_reserve(void) | ||
44 | { | ||
45 | #ifdef CONFIG_S5P_DEV_MFC | ||
46 | struct s5p_mfc_dt_meminfo mfc_mem; | ||
47 | |||
48 | /* Reserve memory for MFC only if it's available */ | ||
49 | mfc_mem.compatible = "samsung,mfc-v5"; | ||
50 | if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem)) | ||
51 | s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff, | ||
52 | mfc_mem.lsize); | ||
53 | #endif | ||
54 | } | ||
138 | DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") | 55 | DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") |
139 | /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ | 56 | /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ |
140 | .smp = smp_ops(exynos_smp_ops), | 57 | .smp = smp_ops(exynos_smp_ops), |
@@ -142,7 +59,8 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") | |||
142 | .map_io = exynos4_dt_map_io, | 59 | .map_io = exynos4_dt_map_io, |
143 | .init_machine = exynos4_dt_machine_init, | 60 | .init_machine = exynos4_dt_machine_init, |
144 | .init_late = exynos_init_late, | 61 | .init_late = exynos_init_late, |
145 | .init_time = exynos4_timer_init, | 62 | .init_time = exynos_init_time, |
146 | .dt_compat = exynos4_dt_compat, | 63 | .dt_compat = exynos4_dt_compat, |
147 | .restart = exynos4_restart, | 64 | .restart = exynos4_restart, |
65 | .reserve = exynos4_reserve, | ||
148 | MACHINE_END | 66 | MACHINE_END |