aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf548/boards
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2009-09-09 06:46:19 -0400
committerMike Frysinger <vapier@gentoo.org>2010-03-09 00:30:45 -0500
commit6bd1fbea2e8bff9346a5afb44ca948b4e4ed74a5 (patch)
tree87019fd6c4fb46bc64d6f0ddaaac32179a6af7e6 /arch/blackfin/mach-bf548/boards
parent57d54889cd00db2752994b389ba714138652e60c (diff)
Blackfin: move on-chip UART resources to boards files
Rather than keeping the pins in the actual driver and worrying about a mess of Kconfig options, declare all the desired pin resources in the boards file. This lets people easily select the specific pins/ports for the normal UART as well as GPIOs for CTS/RTS. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf548/boards')
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c206
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c206
2 files changed, 384 insertions, 28 deletions
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index ccdcd6da2e9f..635f92723e12 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -127,44 +127,211 @@ static struct platform_device rtc_device = {
127#endif 127#endif
128 128
129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
130static struct resource bfin_uart_resources[] = {
131#ifdef CONFIG_SERIAL_BFIN_UART0 130#ifdef CONFIG_SERIAL_BFIN_UART0
131static struct resource bfin_uart0_resources[] = {
132 { 132 {
133 .start = 0xFFC00400, 133 .start = UART0_DLL,
134 .end = 0xFFC004FF, 134 .end = UART0_RBR+2,
135 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
136 }, 136 },
137 {
138 .start = IRQ_UART0_RX,
139 .end = IRQ_UART0_RX+1,
140 .flags = IORESOURCE_IRQ,
141 },
142 {
143 .start = IRQ_UART0_ERROR,
144 .end = IRQ_UART0_ERROR,
145 .flags = IORESOURCE_IRQ,
146 },
147 {
148 .start = CH_UART0_TX,
149 .end = CH_UART0_TX,
150 .flags = IORESOURCE_DMA,
151 },
152 {
153 .start = CH_UART0_RX,
154 .end = CH_UART0_RX,
155 .flags = IORESOURCE_DMA,
156 },
157};
158
159unsigned short bfin_uart0_peripherals[] = {
160 P_UART0_TX, P_UART0_RX, 0
161};
162
163static struct platform_device bfin_uart0_device = {
164 .name = "bfin-uart",
165 .id = 0,
166 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
167 .resource = bfin_uart0_resources,
168 .dev = {
169 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
170 },
171};
137#endif 172#endif
138#ifdef CONFIG_SERIAL_BFIN_UART1 173#ifdef CONFIG_SERIAL_BFIN_UART1
174static struct resource bfin_uart1_resources[] = {
139 { 175 {
140 .start = 0xFFC02000, 176 .start = UART1_DLL,
141 .end = 0xFFC020FF, 177 .end = UART1_RBR+2,
142 .flags = IORESOURCE_MEM, 178 .flags = IORESOURCE_MEM,
143 }, 179 },
180 {
181 .start = IRQ_UART1_RX,
182 .end = IRQ_UART1_RX+1,
183 .flags = IORESOURCE_IRQ,
184 },
185 {
186 .start = IRQ_UART1_ERROR,
187 .end = IRQ_UART1_ERROR,
188 .flags = IORESOURCE_IRQ,
189 },
190 {
191 .start = CH_UART1_TX,
192 .end = CH_UART1_TX,
193 .flags = IORESOURCE_DMA,
194 },
195 {
196 .start = CH_UART1_RX,
197 .end = CH_UART1_RX,
198 .flags = IORESOURCE_DMA,
199 },
200#ifdef CONFIG_BFIN_UART1_CTSRTS
201 { /* CTS pin -- 0 means not supported */
202 .start = GPIO_PE10,
203 .end = GPIO_PE10,
204 .flags = IORESOURCE_IO,
205 },
206 { /* RTS pin -- 0 means not supported */
207 .start = GPIO_PE9,
208 .end = GPIO_PE9,
209 .flags = IORESOURCE_IO,
210 },
211#endif
212};
213
214unsigned short bfin_uart1_peripherals[] = {
215 P_UART1_TX, P_UART1_RX,
216#ifdef CONFIG_BFIN_UART1_CTSRTS
217 P_UART1_RTS, P_UART1_CTS,
218#endif
219 0
220};
221
222static struct platform_device bfin_uart1_device = {
223 .name = "bfin-uart",
224 .id = 1,
225 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
226 .resource = bfin_uart1_resources,
227 .dev = {
228 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
229 },
230};
144#endif 231#endif
145#ifdef CONFIG_SERIAL_BFIN_UART2 232#ifdef CONFIG_SERIAL_BFIN_UART2
233static struct resource bfin_uart2_resources[] = {
146 { 234 {
147 .start = 0xFFC02100, 235 .start = UART2_DLL,
148 .end = 0xFFC021FF, 236 .end = UART2_RBR+2,
149 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
150 }, 238 },
239 {
240 .start = IRQ_UART2_RX,
241 .end = IRQ_UART2_RX+1,
242 .flags = IORESOURCE_IRQ,
243 },
244 {
245 .start = IRQ_UART2_ERROR,
246 .end = IRQ_UART2_ERROR,
247 .flags = IORESOURCE_IRQ,
248 },
249 {
250 .start = CH_UART2_TX,
251 .end = CH_UART2_TX,
252 .flags = IORESOURCE_DMA,
253 },
254 {
255 .start = CH_UART2_RX,
256 .end = CH_UART2_RX,
257 .flags = IORESOURCE_DMA,
258 },
259};
260
261unsigned short bfin_uart2_peripherals[] = {
262 P_UART2_TX, P_UART2_RX, 0
263};
264
265static struct platform_device bfin_uart2_device = {
266 .name = "bfin-uart",
267 .id = 2,
268 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
269 .resource = bfin_uart2_resources,
270 .dev = {
271 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
272 },
273};
151#endif 274#endif
152#ifdef CONFIG_SERIAL_BFIN_UART3 275#ifdef CONFIG_SERIAL_BFIN_UART3
276static struct resource bfin_uart3_resources[] = {
153 { 277 {
154 .start = 0xFFC03100, 278 .start = UART3_DLL,
155 .end = 0xFFC031FF, 279 .end = UART3_RBR+2,
156 .flags = IORESOURCE_MEM, 280 .flags = IORESOURCE_MEM,
157 }, 281 },
282 {
283 .start = IRQ_UART3_RX,
284 .end = IRQ_UART3_RX+1,
285 .flags = IORESOURCE_IRQ,
286 },
287 {
288 .start = IRQ_UART3_ERROR,
289 .end = IRQ_UART3_ERROR,
290 .flags = IORESOURCE_IRQ,
291 },
292 {
293 .start = CH_UART3_TX,
294 .end = CH_UART3_TX,
295 .flags = IORESOURCE_DMA,
296 },
297 {
298 .start = CH_UART3_RX,
299 .end = CH_UART3_RX,
300 .flags = IORESOURCE_DMA,
301 },
302#ifdef CONFIG_BFIN_UART3_CTSRTS
303 { /* CTS pin -- 0 means not supported */
304 .start = GPIO_PB3,
305 .end = GPIO_PB3,
306 .flags = IORESOURCE_IO,
307 },
308 { /* RTS pin -- 0 means not supported */
309 .start = GPIO_PB2,
310 .end = GPIO_PB2,
311 .flags = IORESOURCE_IO,
312 },
158#endif 313#endif
159}; 314};
160 315
161static struct platform_device bfin_uart_device = { 316unsigned short bfin_uart3_peripherals[] = {
317 P_UART3_TX, P_UART3_RX,
318#ifdef CONFIG_BFIN_UART3_CTSRTS
319 P_UART3_RTS, P_UART3_CTS,
320#endif
321 0
322};
323
324static struct platform_device bfin_uart3_device = {
162 .name = "bfin-uart", 325 .name = "bfin-uart",
163 .id = 1, 326 .id = 3,
164 .num_resources = ARRAY_SIZE(bfin_uart_resources), 327 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
165 .resource = bfin_uart_resources, 328 .resource = bfin_uart3_resources,
329 .dev = {
330 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
331 },
166}; 332};
167#endif 333#endif
334#endif
168 335
169#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 336#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
170#ifdef CONFIG_BFIN_SIR0 337#ifdef CONFIG_BFIN_SIR0
@@ -752,7 +919,18 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
752#endif 919#endif
753 920
754#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 921#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
755 &bfin_uart_device, 922#ifdef CONFIG_SERIAL_BFIN_UART0
923 &bfin_uart0_device,
924#endif
925#ifdef CONFIG_SERIAL_BFIN_UART1
926 &bfin_uart1_device,
927#endif
928#ifdef CONFIG_SERIAL_BFIN_UART2
929 &bfin_uart2_device,
930#endif
931#ifdef CONFIG_SERIAL_BFIN_UART3
932 &bfin_uart3_device,
933#endif
756#endif 934#endif
757 935
758#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 936#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 60193f72777c..1ed026157737 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -232,44 +232,211 @@ static struct platform_device rtc_device = {
232#endif 232#endif
233 233
234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
235static struct resource bfin_uart_resources[] = {
236#ifdef CONFIG_SERIAL_BFIN_UART0 235#ifdef CONFIG_SERIAL_BFIN_UART0
236static struct resource bfin_uart0_resources[] = {
237 { 237 {
238 .start = 0xFFC00400, 238 .start = UART0_DLL,
239 .end = 0xFFC004FF, 239 .end = UART0_RBR+2,
240 .flags = IORESOURCE_MEM, 240 .flags = IORESOURCE_MEM,
241 }, 241 },
242 {
243 .start = IRQ_UART0_RX,
244 .end = IRQ_UART0_RX+1,
245 .flags = IORESOURCE_IRQ,
246 },
247 {
248 .start = IRQ_UART0_ERROR,
249 .end = IRQ_UART0_ERROR,
250 .flags = IORESOURCE_IRQ,
251 },
252 {
253 .start = CH_UART0_TX,
254 .end = CH_UART0_TX,
255 .flags = IORESOURCE_DMA,
256 },
257 {
258 .start = CH_UART0_RX,
259 .end = CH_UART0_RX,
260 .flags = IORESOURCE_DMA,
261 },
262};
263
264unsigned short bfin_uart0_peripherals[] = {
265 P_UART0_TX, P_UART0_RX, 0
266};
267
268static struct platform_device bfin_uart0_device = {
269 .name = "bfin-uart",
270 .id = 0,
271 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
272 .resource = bfin_uart0_resources,
273 .dev = {
274 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
275 },
276};
242#endif 277#endif
243#ifdef CONFIG_SERIAL_BFIN_UART1 278#ifdef CONFIG_SERIAL_BFIN_UART1
279static struct resource bfin_uart1_resources[] = {
244 { 280 {
245 .start = 0xFFC02000, 281 .start = UART1_DLL,
246 .end = 0xFFC020FF, 282 .end = UART1_RBR+2,
247 .flags = IORESOURCE_MEM, 283 .flags = IORESOURCE_MEM,
248 }, 284 },
285 {
286 .start = IRQ_UART1_RX,
287 .end = IRQ_UART1_RX+1,
288 .flags = IORESOURCE_IRQ,
289 },
290 {
291 .start = IRQ_UART1_ERROR,
292 .end = IRQ_UART1_ERROR,
293 .flags = IORESOURCE_IRQ,
294 },
295 {
296 .start = CH_UART1_TX,
297 .end = CH_UART1_TX,
298 .flags = IORESOURCE_DMA,
299 },
300 {
301 .start = CH_UART1_RX,
302 .end = CH_UART1_RX,
303 .flags = IORESOURCE_DMA,
304 },
305#ifdef CONFIG_BFIN_UART1_CTSRTS
306 { /* CTS pin -- 0 means not supported */
307 .start = GPIO_PE10,
308 .end = GPIO_PE10,
309 .flags = IORESOURCE_IO,
310 },
311 { /* RTS pin -- 0 means not supported */
312 .start = GPIO_PE9,
313 .end = GPIO_PE9,
314 .flags = IORESOURCE_IO,
315 },
316#endif
317};
318
319unsigned short bfin_uart1_peripherals[] = {
320 P_UART1_TX, P_UART1_RX,
321#ifdef CONFIG_BFIN_UART1_CTSRTS
322 P_UART1_RTS, P_UART1_CTS,
323#endif
324 0
325};
326
327static struct platform_device bfin_uart1_device = {
328 .name = "bfin-uart",
329 .id = 1,
330 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
331 .resource = bfin_uart1_resources,
332 .dev = {
333 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
334 },
335};
249#endif 336#endif
250#ifdef CONFIG_SERIAL_BFIN_UART2 337#ifdef CONFIG_SERIAL_BFIN_UART2
338static struct resource bfin_uart2_resources[] = {
251 { 339 {
252 .start = 0xFFC02100, 340 .start = UART2_DLL,
253 .end = 0xFFC021FF, 341 .end = UART2_RBR+2,
254 .flags = IORESOURCE_MEM, 342 .flags = IORESOURCE_MEM,
255 }, 343 },
344 {
345 .start = IRQ_UART2_RX,
346 .end = IRQ_UART2_RX+1,
347 .flags = IORESOURCE_IRQ,
348 },
349 {
350 .start = IRQ_UART2_ERROR,
351 .end = IRQ_UART2_ERROR,
352 .flags = IORESOURCE_IRQ,
353 },
354 {
355 .start = CH_UART2_TX,
356 .end = CH_UART2_TX,
357 .flags = IORESOURCE_DMA,
358 },
359 {
360 .start = CH_UART2_RX,
361 .end = CH_UART2_RX,
362 .flags = IORESOURCE_DMA,
363 },
364};
365
366unsigned short bfin_uart2_peripherals[] = {
367 P_UART2_TX, P_UART2_RX, 0
368};
369
370static struct platform_device bfin_uart2_device = {
371 .name = "bfin-uart",
372 .id = 2,
373 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
374 .resource = bfin_uart2_resources,
375 .dev = {
376 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
377 },
378};
256#endif 379#endif
257#ifdef CONFIG_SERIAL_BFIN_UART3 380#ifdef CONFIG_SERIAL_BFIN_UART3
381static struct resource bfin_uart3_resources[] = {
258 { 382 {
259 .start = 0xFFC03100, 383 .start = UART3_DLL,
260 .end = 0xFFC031FF, 384 .end = UART3_RBR+2,
261 .flags = IORESOURCE_MEM, 385 .flags = IORESOURCE_MEM,
262 }, 386 },
387 {
388 .start = IRQ_UART3_RX,
389 .end = IRQ_UART3_RX+1,
390 .flags = IORESOURCE_IRQ,
391 },
392 {
393 .start = IRQ_UART3_ERROR,
394 .end = IRQ_UART3_ERROR,
395 .flags = IORESOURCE_IRQ,
396 },
397 {
398 .start = CH_UART3_TX,
399 .end = CH_UART3_TX,
400 .flags = IORESOURCE_DMA,
401 },
402 {
403 .start = CH_UART3_RX,
404 .end = CH_UART3_RX,
405 .flags = IORESOURCE_DMA,
406 },
407#ifdef CONFIG_BFIN_UART3_CTSRTS
408 { /* CTS pin -- 0 means not supported */
409 .start = GPIO_PB3,
410 .end = GPIO_PB3,
411 .flags = IORESOURCE_IO,
412 },
413 { /* RTS pin -- 0 means not supported */
414 .start = GPIO_PB2,
415 .end = GPIO_PB2,
416 .flags = IORESOURCE_IO,
417 },
263#endif 418#endif
264}; 419};
265 420
266static struct platform_device bfin_uart_device = { 421unsigned short bfin_uart3_peripherals[] = {
422 P_UART3_TX, P_UART3_RX,
423#ifdef CONFIG_BFIN_UART3_CTSRTS
424 P_UART3_RTS, P_UART3_CTS,
425#endif
426 0
427};
428
429static struct platform_device bfin_uart3_device = {
267 .name = "bfin-uart", 430 .name = "bfin-uart",
268 .id = 1, 431 .id = 3,
269 .num_resources = ARRAY_SIZE(bfin_uart_resources), 432 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
270 .resource = bfin_uart_resources, 433 .resource = bfin_uart3_resources,
434 .dev = {
435 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
436 },
271}; 437};
272#endif 438#endif
439#endif
273 440
274#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 441#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
275#ifdef CONFIG_BFIN_SIR0 442#ifdef CONFIG_BFIN_SIR0
@@ -960,7 +1127,18 @@ static struct platform_device *ezkit_devices[] __initdata = {
960#endif 1127#endif
961 1128
962#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
963 &bfin_uart_device, 1130#ifdef CONFIG_SERIAL_BFIN_UART0
1131 &bfin_uart0_device,
1132#endif
1133#ifdef CONFIG_SERIAL_BFIN_UART1
1134 &bfin_uart1_device,
1135#endif
1136#ifdef CONFIG_SERIAL_BFIN_UART2
1137 &bfin_uart2_device,
1138#endif
1139#ifdef CONFIG_SERIAL_BFIN_UART3
1140 &bfin_uart3_device,
1141#endif
964#endif 1142#endif
965 1143
966#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1144#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)