Commit | Line | Data |
---|---|---|
bc4e814e | 1 | /* |
2 | * arch/arm/mach-spear3xx/spear300.c | |
3 | * | |
4 | * SPEAr300 machine source file | |
5 | * | |
c5fa4fdc | 6 | * Copyright (C) 2009-2012 ST Microelectronics |
10d8935f | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
bc4e814e | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | |
10 | * License version 2. This program is licensed "as is" without any | |
11 | * warranty of any kind, whether express or implied. | |
12 | */ | |
13 | ||
5fb00f96 VK |
14 | #define pr_fmt(fmt) "SPEAr300: " fmt |
15 | ||
0b7ee717 | 16 | #include <linux/amba/pl08x.h> |
c5fa4fdc | 17 | #include <linux/of_platform.h> |
c5fa4fdc | 18 | #include <asm/mach/arch.h> |
bc4e814e | 19 | #include <mach/generic.h> |
5019f0b1 AB |
20 | #include <mach/spear.h> |
21 | ||
0b7ee717 VK |
22 | /* DMAC platform data's slave info */ |
23 | struct pl08x_channel_data spear300_dma_info[] = { | |
24 | { | |
25 | .bus_id = "uart0_rx", | |
26 | .min_signal = 2, | |
27 | .max_signal = 2, | |
28 | .muxval = 0, | |
0b7ee717 VK |
29 | .periph_buses = PL08X_AHB1, |
30 | }, { | |
31 | .bus_id = "uart0_tx", | |
32 | .min_signal = 3, | |
33 | .max_signal = 3, | |
34 | .muxval = 0, | |
0b7ee717 VK |
35 | .periph_buses = PL08X_AHB1, |
36 | }, { | |
37 | .bus_id = "ssp0_rx", | |
38 | .min_signal = 8, | |
39 | .max_signal = 8, | |
40 | .muxval = 0, | |
0b7ee717 VK |
41 | .periph_buses = PL08X_AHB1, |
42 | }, { | |
43 | .bus_id = "ssp0_tx", | |
44 | .min_signal = 9, | |
45 | .max_signal = 9, | |
46 | .muxval = 0, | |
0b7ee717 VK |
47 | .periph_buses = PL08X_AHB1, |
48 | }, { | |
49 | .bus_id = "i2c_rx", | |
50 | .min_signal = 10, | |
51 | .max_signal = 10, | |
52 | .muxval = 0, | |
0b7ee717 VK |
53 | .periph_buses = PL08X_AHB1, |
54 | }, { | |
55 | .bus_id = "i2c_tx", | |
56 | .min_signal = 11, | |
57 | .max_signal = 11, | |
58 | .muxval = 0, | |
0b7ee717 VK |
59 | .periph_buses = PL08X_AHB1, |
60 | }, { | |
61 | .bus_id = "irda", | |
62 | .min_signal = 12, | |
63 | .max_signal = 12, | |
64 | .muxval = 0, | |
0b7ee717 VK |
65 | .periph_buses = PL08X_AHB1, |
66 | }, { | |
67 | .bus_id = "adc", | |
68 | .min_signal = 13, | |
69 | .max_signal = 13, | |
70 | .muxval = 0, | |
0b7ee717 VK |
71 | .periph_buses = PL08X_AHB1, |
72 | }, { | |
73 | .bus_id = "to_jpeg", | |
74 | .min_signal = 14, | |
75 | .max_signal = 14, | |
76 | .muxval = 0, | |
0b7ee717 VK |
77 | .periph_buses = PL08X_AHB1, |
78 | }, { | |
79 | .bus_id = "from_jpeg", | |
80 | .min_signal = 15, | |
81 | .max_signal = 15, | |
82 | .muxval = 0, | |
0b7ee717 VK |
83 | .periph_buses = PL08X_AHB1, |
84 | }, { | |
85 | .bus_id = "ras0_rx", | |
86 | .min_signal = 0, | |
87 | .max_signal = 0, | |
88 | .muxval = 1, | |
0b7ee717 VK |
89 | .periph_buses = PL08X_AHB1, |
90 | }, { | |
91 | .bus_id = "ras0_tx", | |
92 | .min_signal = 1, | |
93 | .max_signal = 1, | |
94 | .muxval = 1, | |
0b7ee717 VK |
95 | .periph_buses = PL08X_AHB1, |
96 | }, { | |
97 | .bus_id = "ras1_rx", | |
98 | .min_signal = 2, | |
99 | .max_signal = 2, | |
100 | .muxval = 1, | |
0b7ee717 VK |
101 | .periph_buses = PL08X_AHB1, |
102 | }, { | |
103 | .bus_id = "ras1_tx", | |
104 | .min_signal = 3, | |
105 | .max_signal = 3, | |
106 | .muxval = 1, | |
0b7ee717 VK |
107 | .periph_buses = PL08X_AHB1, |
108 | }, { | |
109 | .bus_id = "ras2_rx", | |
110 | .min_signal = 4, | |
111 | .max_signal = 4, | |
112 | .muxval = 1, | |
0b7ee717 VK |
113 | .periph_buses = PL08X_AHB1, |
114 | }, { | |
115 | .bus_id = "ras2_tx", | |
116 | .min_signal = 5, | |
117 | .max_signal = 5, | |
118 | .muxval = 1, | |
0b7ee717 VK |
119 | .periph_buses = PL08X_AHB1, |
120 | }, { | |
121 | .bus_id = "ras3_rx", | |
122 | .min_signal = 6, | |
123 | .max_signal = 6, | |
124 | .muxval = 1, | |
0b7ee717 VK |
125 | .periph_buses = PL08X_AHB1, |
126 | }, { | |
127 | .bus_id = "ras3_tx", | |
128 | .min_signal = 7, | |
129 | .max_signal = 7, | |
130 | .muxval = 1, | |
0b7ee717 VK |
131 | .periph_buses = PL08X_AHB1, |
132 | }, { | |
133 | .bus_id = "ras4_rx", | |
134 | .min_signal = 8, | |
135 | .max_signal = 8, | |
136 | .muxval = 1, | |
0b7ee717 VK |
137 | .periph_buses = PL08X_AHB1, |
138 | }, { | |
139 | .bus_id = "ras4_tx", | |
140 | .min_signal = 9, | |
141 | .max_signal = 9, | |
142 | .muxval = 1, | |
0b7ee717 VK |
143 | .periph_buses = PL08X_AHB1, |
144 | }, { | |
145 | .bus_id = "ras5_rx", | |
146 | .min_signal = 10, | |
147 | .max_signal = 10, | |
148 | .muxval = 1, | |
0b7ee717 VK |
149 | .periph_buses = PL08X_AHB1, |
150 | }, { | |
151 | .bus_id = "ras5_tx", | |
152 | .min_signal = 11, | |
153 | .max_signal = 11, | |
154 | .muxval = 1, | |
0b7ee717 VK |
155 | .periph_buses = PL08X_AHB1, |
156 | }, { | |
157 | .bus_id = "ras6_rx", | |
158 | .min_signal = 12, | |
159 | .max_signal = 12, | |
160 | .muxval = 1, | |
0b7ee717 VK |
161 | .periph_buses = PL08X_AHB1, |
162 | }, { | |
163 | .bus_id = "ras6_tx", | |
164 | .min_signal = 13, | |
165 | .max_signal = 13, | |
166 | .muxval = 1, | |
0b7ee717 VK |
167 | .periph_buses = PL08X_AHB1, |
168 | }, { | |
169 | .bus_id = "ras7_rx", | |
170 | .min_signal = 14, | |
171 | .max_signal = 14, | |
172 | .muxval = 1, | |
0b7ee717 VK |
173 | .periph_buses = PL08X_AHB1, |
174 | }, { | |
175 | .bus_id = "ras7_tx", | |
176 | .min_signal = 15, | |
177 | .max_signal = 15, | |
178 | .muxval = 1, | |
0b7ee717 VK |
179 | .periph_buses = PL08X_AHB1, |
180 | }, | |
181 | }; | |
182 | ||
c5fa4fdc VK |
183 | /* Add SPEAr300 auxdata to pass platform data */ |
184 | static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { | |
185 | OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, | |
186 | &pl022_plat_data), | |
0b7ee717 VK |
187 | OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL, |
188 | &pl080_plat_data), | |
c5fa4fdc VK |
189 | {} |
190 | }; | |
c2c07831 | 191 | |
c5fa4fdc | 192 | static void __init spear300_dt_init(void) |
bc4e814e | 193 | { |
0b7ee717 VK |
194 | pl080_plat_data.slave_channels = spear300_dma_info; |
195 | pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info); | |
196 | ||
c5fa4fdc VK |
197 | of_platform_populate(NULL, of_default_bus_match_table, |
198 | spear300_auxdata_lookup, NULL); | |
70f4c0bf | 199 | } |
c5fa4fdc VK |
200 | |
201 | static const char * const spear300_dt_board_compat[] = { | |
202 | "st,spear300", | |
203 | "st,spear300-evb", | |
204 | NULL, | |
205 | }; | |
206 | ||
207 | static void __init spear300_map_io(void) | |
208 | { | |
209 | spear3xx_map_io(); | |
c5fa4fdc VK |
210 | } |
211 | ||
212 | DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") | |
213 | .map_io = spear300_map_io, | |
214 | .init_irq = spear3xx_dt_init_irq, | |
c5fa4fdc VK |
215 | .timer = &spear3xx_timer, |
216 | .init_machine = spear300_dt_init, | |
217 | .restart = spear_restart, | |
218 | .dt_compat = spear300_dt_board_compat, | |
219 | MACHINE_END |