diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2009-09-09 06:46:19 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-09 00:30:45 -0500 |
commit | 6bd1fbea2e8bff9346a5afb44ca948b4e4ed74a5 (patch) | |
tree | 87019fd6c4fb46bc64d6f0ddaaac32179a6af7e6 /arch/blackfin/mach-bf537 | |
parent | 57d54889cd00db2752994b389ba714138652e60c (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-bf537')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537e.c | 22 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537u.c | 93 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/minotaur.c | 93 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 93 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 100 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/tcm_bf537.c | 93 |
6 files changed, 440 insertions, 54 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c index c85f4d770535..abb32ddc5122 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c | |||
@@ -329,8 +329,8 @@ static struct platform_device cm_flash_device = { | |||
329 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 329 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
330 | static struct resource bfin_uart0_resources[] = { | 330 | static struct resource bfin_uart0_resources[] = { |
331 | { | 331 | { |
332 | .start = 0xFFC00400, | 332 | .start = UART0_THR, |
333 | .end = 0xFFC004FF, | 333 | .end = UART0_GCTL+2, |
334 | .flags = IORESOURCE_MEM, | 334 | .flags = IORESOURCE_MEM, |
335 | }, | 335 | }, |
336 | { | 336 | { |
@@ -373,18 +373,25 @@ static struct resource bfin_uart0_resources[] = { | |||
373 | #endif | 373 | #endif |
374 | }; | 374 | }; |
375 | 375 | ||
376 | unsigned short bfin_uart0_peripherals[] = { | ||
377 | P_UART0_TX, P_UART0_RX, 0 | ||
378 | }; | ||
379 | |||
376 | static struct platform_device bfin_uart0_device = { | 380 | static struct platform_device bfin_uart0_device = { |
377 | .name = "bfin-uart", | 381 | .name = "bfin-uart", |
378 | .id = 0, | 382 | .id = 0, |
379 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | 383 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
380 | .resource = bfin_uart0_resources, | 384 | .resource = bfin_uart0_resources, |
385 | .dev = { | ||
386 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
387 | }, | ||
381 | }; | 388 | }; |
382 | #endif | 389 | #endif |
383 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 390 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
384 | static struct resource bfin_uart1_resources[] = { | 391 | static struct resource bfin_uart1_resources[] = { |
385 | { | 392 | { |
386 | .start = 0xFFC02000, | 393 | .start = UART1_THR, |
387 | .end = 0xFFC020FF, | 394 | .end = UART1_GCTL+2, |
388 | .flags = IORESOURCE_MEM, | 395 | .flags = IORESOURCE_MEM, |
389 | }, | 396 | }, |
390 | { | 397 | { |
@@ -427,11 +434,18 @@ static struct resource bfin_uart1_resources[] = { | |||
427 | #endif | 434 | #endif |
428 | }; | 435 | }; |
429 | 436 | ||
437 | unsigned short bfin_uart1_peripherals[] = { | ||
438 | P_UART1_TX, P_UART1_RX, 0 | ||
439 | }; | ||
440 | |||
430 | static struct platform_device bfin_uart1_device = { | 441 | static struct platform_device bfin_uart1_device = { |
431 | .name = "bfin-uart", | 442 | .name = "bfin-uart", |
432 | .id = 1, | 443 | .id = 1, |
433 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), | 444 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
434 | .resource = bfin_uart1_resources, | 445 | .resource = bfin_uart1_resources, |
446 | .dev = { | ||
447 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
448 | }, | ||
435 | }; | 449 | }; |
436 | #endif | 450 | #endif |
437 | #endif | 451 | #endif |
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c index ea11aa81340d..b3182face957 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c | |||
@@ -327,25 +327,93 @@ static struct platform_device cm_flash_device = { | |||
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 329 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
330 | static struct resource bfin_uart_resources[] = { | 330 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
331 | static struct resource bfin_uart0_resources[] = { | ||
331 | { | 332 | { |
332 | .start = 0xFFC00400, | 333 | .start = UART0_THR, |
333 | .end = 0xFFC004FF, | 334 | .end = UART0_GCTL+2, |
334 | .flags = IORESOURCE_MEM, | 335 | .flags = IORESOURCE_MEM, |
335 | }, { | 336 | }, |
336 | .start = 0xFFC02000, | 337 | { |
337 | .end = 0xFFC020FF, | 338 | .start = IRQ_UART0_RX, |
339 | .end = IRQ_UART0_RX+1, | ||
340 | .flags = IORESOURCE_IRQ, | ||
341 | }, | ||
342 | { | ||
343 | .start = IRQ_UART0_ERROR, | ||
344 | .end = IRQ_UART0_ERROR, | ||
345 | .flags = IORESOURCE_IRQ, | ||
346 | }, | ||
347 | { | ||
348 | .start = CH_UART0_TX, | ||
349 | .end = CH_UART0_TX, | ||
350 | .flags = IORESOURCE_DMA, | ||
351 | }, | ||
352 | { | ||
353 | .start = CH_UART0_RX, | ||
354 | .end = CH_UART0_RX, | ||
355 | .flags = IORESOURCE_DMA, | ||
356 | }, | ||
357 | }; | ||
358 | |||
359 | unsigned short bfin_uart0_peripherals[] = { | ||
360 | P_UART0_TX, P_UART0_RX, 0 | ||
361 | }; | ||
362 | |||
363 | static struct platform_device bfin_uart0_device = { | ||
364 | .name = "bfin-uart", | ||
365 | .id = 0, | ||
366 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
367 | .resource = bfin_uart0_resources, | ||
368 | .dev = { | ||
369 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
370 | }, | ||
371 | }; | ||
372 | #endif | ||
373 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
374 | static struct resource bfin_uart1_resources[] = { | ||
375 | { | ||
376 | .start = UART1_THR, | ||
377 | .end = UART1_GCTL+2, | ||
338 | .flags = IORESOURCE_MEM, | 378 | .flags = IORESOURCE_MEM, |
339 | }, | 379 | }, |
380 | { | ||
381 | .start = IRQ_UART1_RX, | ||
382 | .end = IRQ_UART1_RX+1, | ||
383 | .flags = IORESOURCE_IRQ, | ||
384 | }, | ||
385 | { | ||
386 | .start = IRQ_UART1_ERROR, | ||
387 | .end = IRQ_UART1_ERROR, | ||
388 | .flags = IORESOURCE_IRQ, | ||
389 | }, | ||
390 | { | ||
391 | .start = CH_UART1_TX, | ||
392 | .end = CH_UART1_TX, | ||
393 | .flags = IORESOURCE_DMA, | ||
394 | }, | ||
395 | { | ||
396 | .start = CH_UART1_RX, | ||
397 | .end = CH_UART1_RX, | ||
398 | .flags = IORESOURCE_DMA, | ||
399 | }, | ||
340 | }; | 400 | }; |
341 | 401 | ||
342 | static struct platform_device bfin_uart_device = { | 402 | unsigned short bfin_uart1_peripherals[] = { |
403 | P_UART1_TX, P_UART1_RX, 0 | ||
404 | }; | ||
405 | |||
406 | static struct platform_device bfin_uart1_device = { | ||
343 | .name = "bfin-uart", | 407 | .name = "bfin-uart", |
344 | .id = 1, | 408 | .id = 1, |
345 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 409 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
346 | .resource = bfin_uart_resources, | 410 | .resource = bfin_uart1_resources, |
411 | .dev = { | ||
412 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
413 | }, | ||
347 | }; | 414 | }; |
348 | #endif | 415 | #endif |
416 | #endif | ||
349 | 417 | ||
350 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 418 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
351 | #ifdef CONFIG_BFIN_SIR0 | 419 | #ifdef CONFIG_BFIN_SIR0 |
@@ -522,7 +590,12 @@ static struct platform_device *cm_bf537u_devices[] __initdata = { | |||
522 | #endif | 590 | #endif |
523 | 591 | ||
524 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 592 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
525 | &bfin_uart_device, | 593 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
594 | &bfin_uart0_device, | ||
595 | #endif | ||
596 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
597 | &bfin_uart1_device, | ||
598 | #endif | ||
526 | #endif | 599 | #endif |
527 | 600 | ||
528 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 601 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c index 0da927252701..58d6a20e7a0d 100644 --- a/arch/blackfin/mach-bf537/boards/minotaur.c +++ b/arch/blackfin/mach-bf537/boards/minotaur.c | |||
@@ -211,25 +211,93 @@ static struct platform_device bfin_spi0_device = { | |||
211 | #endif /* spi master and devices */ | 211 | #endif /* spi master and devices */ |
212 | 212 | ||
213 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 213 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
214 | static struct resource bfin_uart_resources[] = { | 214 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
215 | static struct resource bfin_uart0_resources[] = { | ||
215 | { | 216 | { |
216 | .start = 0xFFC00400, | 217 | .start = UART0_THR, |
217 | .end = 0xFFC004FF, | 218 | .end = UART0_GCTL+2, |
218 | .flags = IORESOURCE_MEM, | 219 | .flags = IORESOURCE_MEM, |
219 | }, { | 220 | }, |
220 | .start = 0xFFC02000, | 221 | { |
221 | .end = 0xFFC020FF, | 222 | .start = IRQ_UART0_RX, |
223 | .end = IRQ_UART0_RX+1, | ||
224 | .flags = IORESOURCE_IRQ, | ||
225 | }, | ||
226 | { | ||
227 | .start = IRQ_UART0_ERROR, | ||
228 | .end = IRQ_UART0_ERROR, | ||
229 | .flags = IORESOURCE_IRQ, | ||
230 | }, | ||
231 | { | ||
232 | .start = CH_UART0_TX, | ||
233 | .end = CH_UART0_TX, | ||
234 | .flags = IORESOURCE_DMA, | ||
235 | }, | ||
236 | { | ||
237 | .start = CH_UART0_RX, | ||
238 | .end = CH_UART0_RX, | ||
239 | .flags = IORESOURCE_DMA, | ||
240 | }, | ||
241 | }; | ||
242 | |||
243 | unsigned short bfin_uart0_peripherals[] = { | ||
244 | P_UART0_TX, P_UART0_RX, 0 | ||
245 | }; | ||
246 | |||
247 | static struct platform_device bfin_uart0_device = { | ||
248 | .name = "bfin-uart", | ||
249 | .id = 0, | ||
250 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
251 | .resource = bfin_uart0_resources, | ||
252 | .dev = { | ||
253 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
254 | }, | ||
255 | }; | ||
256 | #endif | ||
257 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
258 | static struct resource bfin_uart1_resources[] = { | ||
259 | { | ||
260 | .start = UART1_THR, | ||
261 | .end = UART1_GCTL+2, | ||
222 | .flags = IORESOURCE_MEM, | 262 | .flags = IORESOURCE_MEM, |
223 | }, | 263 | }, |
264 | { | ||
265 | .start = IRQ_UART1_RX, | ||
266 | .end = IRQ_UART1_RX+1, | ||
267 | .flags = IORESOURCE_IRQ, | ||
268 | }, | ||
269 | { | ||
270 | .start = IRQ_UART1_ERROR, | ||
271 | .end = IRQ_UART1_ERROR, | ||
272 | .flags = IORESOURCE_IRQ, | ||
273 | }, | ||
274 | { | ||
275 | .start = CH_UART1_TX, | ||
276 | .end = CH_UART1_TX, | ||
277 | .flags = IORESOURCE_DMA, | ||
278 | }, | ||
279 | { | ||
280 | .start = CH_UART1_RX, | ||
281 | .end = CH_UART1_RX, | ||
282 | .flags = IORESOURCE_DMA, | ||
283 | }, | ||
224 | }; | 284 | }; |
225 | 285 | ||
226 | static struct platform_device bfin_uart_device = { | 286 | unsigned short bfin_uart1_peripherals[] = { |
287 | P_UART1_TX, P_UART1_RX, 0 | ||
288 | }; | ||
289 | |||
290 | static struct platform_device bfin_uart1_device = { | ||
227 | .name = "bfin-uart", | 291 | .name = "bfin-uart", |
228 | .id = 1, | 292 | .id = 1, |
229 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 293 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
230 | .resource = bfin_uart_resources, | 294 | .resource = bfin_uart1_resources, |
295 | .dev = { | ||
296 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
297 | }, | ||
231 | }; | 298 | }; |
232 | #endif | 299 | #endif |
300 | #endif | ||
233 | 301 | ||
234 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 302 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
235 | #ifdef CONFIG_BFIN_SIR0 | 303 | #ifdef CONFIG_BFIN_SIR0 |
@@ -343,7 +411,12 @@ static struct platform_device *minotaur_devices[] __initdata = { | |||
343 | #endif | 411 | #endif |
344 | 412 | ||
345 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 413 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
346 | &bfin_uart_device, | 414 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
415 | &bfin_uart0_device, | ||
416 | #endif | ||
417 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
418 | &bfin_uart1_device, | ||
419 | #endif | ||
347 | #endif | 420 | #endif |
348 | 421 | ||
349 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 422 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 4e0afda472ab..3c36abdf3405 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -362,25 +362,93 @@ static struct platform_device bfin_fb_device = { | |||
362 | #endif | 362 | #endif |
363 | 363 | ||
364 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 364 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
365 | static struct resource bfin_uart_resources[] = { | 365 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
366 | static struct resource bfin_uart0_resources[] = { | ||
366 | { | 367 | { |
367 | .start = 0xFFC00400, | 368 | .start = UART0_THR, |
368 | .end = 0xFFC004FF, | 369 | .end = UART0_GCTL+2, |
369 | .flags = IORESOURCE_MEM, | 370 | .flags = IORESOURCE_MEM, |
370 | }, { | 371 | }, |
371 | .start = 0xFFC02000, | 372 | { |
372 | .end = 0xFFC020FF, | 373 | .start = IRQ_UART0_RX, |
374 | .end = IRQ_UART0_RX+1, | ||
375 | .flags = IORESOURCE_IRQ, | ||
376 | }, | ||
377 | { | ||
378 | .start = IRQ_UART0_ERROR, | ||
379 | .end = IRQ_UART0_ERROR, | ||
380 | .flags = IORESOURCE_IRQ, | ||
381 | }, | ||
382 | { | ||
383 | .start = CH_UART0_TX, | ||
384 | .end = CH_UART0_TX, | ||
385 | .flags = IORESOURCE_DMA, | ||
386 | }, | ||
387 | { | ||
388 | .start = CH_UART0_RX, | ||
389 | .end = CH_UART0_RX, | ||
390 | .flags = IORESOURCE_DMA, | ||
391 | }, | ||
392 | }; | ||
393 | |||
394 | unsigned short bfin_uart0_peripherals[] = { | ||
395 | P_UART0_TX, P_UART0_RX, 0 | ||
396 | }; | ||
397 | |||
398 | static struct platform_device bfin_uart0_device = { | ||
399 | .name = "bfin-uart", | ||
400 | .id = 0, | ||
401 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
402 | .resource = bfin_uart0_resources, | ||
403 | .dev = { | ||
404 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
405 | }, | ||
406 | }; | ||
407 | #endif | ||
408 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
409 | static struct resource bfin_uart1_resources[] = { | ||
410 | { | ||
411 | .start = UART1_THR, | ||
412 | .end = UART1_GCTL+2, | ||
373 | .flags = IORESOURCE_MEM, | 413 | .flags = IORESOURCE_MEM, |
374 | }, | 414 | }, |
415 | { | ||
416 | .start = IRQ_UART1_RX, | ||
417 | .end = IRQ_UART1_RX+1, | ||
418 | .flags = IORESOURCE_IRQ, | ||
419 | }, | ||
420 | { | ||
421 | .start = IRQ_UART1_ERROR, | ||
422 | .end = IRQ_UART1_ERROR, | ||
423 | .flags = IORESOURCE_IRQ, | ||
424 | }, | ||
425 | { | ||
426 | .start = CH_UART1_TX, | ||
427 | .end = CH_UART1_TX, | ||
428 | .flags = IORESOURCE_DMA, | ||
429 | }, | ||
430 | { | ||
431 | .start = CH_UART1_RX, | ||
432 | .end = CH_UART1_RX, | ||
433 | .flags = IORESOURCE_DMA, | ||
434 | }, | ||
375 | }; | 435 | }; |
376 | 436 | ||
377 | static struct platform_device bfin_uart_device = { | 437 | unsigned short bfin_uart1_peripherals[] = { |
438 | P_UART1_TX, P_UART1_RX, 0 | ||
439 | }; | ||
440 | |||
441 | static struct platform_device bfin_uart1_device = { | ||
378 | .name = "bfin-uart", | 442 | .name = "bfin-uart", |
379 | .id = 1, | 443 | .id = 1, |
380 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 444 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
381 | .resource = bfin_uart_resources, | 445 | .resource = bfin_uart1_resources, |
446 | .dev = { | ||
447 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
448 | }, | ||
382 | }; | 449 | }; |
383 | #endif | 450 | #endif |
451 | #endif | ||
384 | 452 | ||
385 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 453 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
386 | #ifdef CONFIG_BFIN_SIR0 | 454 | #ifdef CONFIG_BFIN_SIR0 |
@@ -472,7 +540,12 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
472 | #endif | 540 | #endif |
473 | 541 | ||
474 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 542 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
475 | &bfin_uart_device, | 543 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
544 | &bfin_uart0_device, | ||
545 | #endif | ||
546 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
547 | &bfin_uart1_device, | ||
548 | #endif | ||
476 | #endif | 549 | #endif |
477 | 550 | ||
478 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 551 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index ac9b52e0087c..9842288c4f1c 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -1157,30 +1157,105 @@ static struct platform_device bfin_lq035q1_device = { | |||
1157 | #endif | 1157 | #endif |
1158 | 1158 | ||
1159 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 1159 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
1160 | static struct resource bfin_uart_resources[] = { | ||
1161 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 1160 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
1161 | static struct resource bfin_uart0_resources[] = { | ||
1162 | { | 1162 | { |
1163 | .start = 0xFFC00400, | 1163 | .start = UART0_THR, |
1164 | .end = 0xFFC004FF, | 1164 | .end = UART0_GCTL+2, |
1165 | .flags = IORESOURCE_MEM, | 1165 | .flags = IORESOURCE_MEM, |
1166 | }, | 1166 | }, |
1167 | { | ||
1168 | .start = IRQ_UART0_RX, | ||
1169 | .end = IRQ_UART0_RX+1, | ||
1170 | .flags = IORESOURCE_IRQ, | ||
1171 | }, | ||
1172 | { | ||
1173 | .start = IRQ_UART0_ERROR, | ||
1174 | .end = IRQ_UART0_ERROR, | ||
1175 | .flags = IORESOURCE_IRQ, | ||
1176 | }, | ||
1177 | { | ||
1178 | .start = CH_UART0_TX, | ||
1179 | .end = CH_UART0_TX, | ||
1180 | .flags = IORESOURCE_DMA, | ||
1181 | }, | ||
1182 | { | ||
1183 | .start = CH_UART0_RX, | ||
1184 | .end = CH_UART0_RX, | ||
1185 | .flags = IORESOURCE_DMA, | ||
1186 | }, | ||
1187 | #ifdef CONFIG_BFIN_UART0_CTSRTS | ||
1188 | { /* CTS pin */ | ||
1189 | .start = GPIO_PG7, | ||
1190 | .end = GPIO_PG7, | ||
1191 | .flags = IORESOURCE_IO, | ||
1192 | }, | ||
1193 | { /* RTS pin */ | ||
1194 | .start = GPIO_PG6, | ||
1195 | .end = GPIO_PG6, | ||
1196 | .flags = IORESOURCE_IO, | ||
1197 | }, | ||
1198 | #endif | ||
1199 | }; | ||
1200 | |||
1201 | unsigned short bfin_uart0_peripherals[] = { | ||
1202 | P_UART0_TX, P_UART0_RX, 0 | ||
1203 | }; | ||
1204 | |||
1205 | static struct platform_device bfin_uart0_device = { | ||
1206 | .name = "bfin-uart", | ||
1207 | .id = 0, | ||
1208 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
1209 | .resource = bfin_uart0_resources, | ||
1210 | .dev = { | ||
1211 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
1212 | }, | ||
1213 | }; | ||
1167 | #endif | 1214 | #endif |
1168 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 1215 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
1216 | static struct resource bfin_uart1_resources[] = { | ||
1169 | { | 1217 | { |
1170 | .start = 0xFFC02000, | 1218 | .start = UART1_THR, |
1171 | .end = 0xFFC020FF, | 1219 | .end = UART1_GCTL+2, |
1172 | .flags = IORESOURCE_MEM, | 1220 | .flags = IORESOURCE_MEM, |
1173 | }, | 1221 | }, |
1174 | #endif | 1222 | { |
1223 | .start = IRQ_UART1_RX, | ||
1224 | .end = IRQ_UART1_RX+1, | ||
1225 | .flags = IORESOURCE_IRQ, | ||
1226 | }, | ||
1227 | { | ||
1228 | .start = IRQ_UART1_ERROR, | ||
1229 | .end = IRQ_UART1_ERROR, | ||
1230 | .flags = IORESOURCE_IRQ, | ||
1231 | }, | ||
1232 | { | ||
1233 | .start = CH_UART1_TX, | ||
1234 | .end = CH_UART1_TX, | ||
1235 | .flags = IORESOURCE_DMA, | ||
1236 | }, | ||
1237 | { | ||
1238 | .start = CH_UART1_RX, | ||
1239 | .end = CH_UART1_RX, | ||
1240 | .flags = IORESOURCE_DMA, | ||
1241 | }, | ||
1242 | }; | ||
1243 | |||
1244 | unsigned short bfin_uart1_peripherals[] = { | ||
1245 | P_UART1_TX, P_UART1_RX, 0 | ||
1175 | }; | 1246 | }; |
1176 | 1247 | ||
1177 | static struct platform_device bfin_uart_device = { | 1248 | static struct platform_device bfin_uart1_device = { |
1178 | .name = "bfin-uart", | 1249 | .name = "bfin-uart", |
1179 | .id = 1, | 1250 | .id = 1, |
1180 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 1251 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
1181 | .resource = bfin_uart_resources, | 1252 | .resource = bfin_uart1_resources, |
1253 | .dev = { | ||
1254 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
1255 | }, | ||
1182 | }; | 1256 | }; |
1183 | #endif | 1257 | #endif |
1258 | #endif | ||
1184 | 1259 | ||
1185 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 1260 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
1186 | #ifdef CONFIG_BFIN_SIR0 | 1261 | #ifdef CONFIG_BFIN_SIR0 |
@@ -1771,7 +1846,12 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
1771 | #endif | 1846 | #endif |
1772 | 1847 | ||
1773 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 1848 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
1774 | &bfin_uart_device, | 1849 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
1850 | &bfin_uart0_device, | ||
1851 | #endif | ||
1852 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
1853 | &bfin_uart1_device, | ||
1854 | #endif | ||
1775 | #endif | 1855 | #endif |
1776 | 1856 | ||
1777 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 1857 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c index 57163b65a4f5..d77ca5b75685 100644 --- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c | |||
@@ -327,25 +327,93 @@ static struct platform_device cm_flash_device = { | |||
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 329 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
330 | static struct resource bfin_uart_resources[] = { | 330 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
331 | static struct resource bfin_uart0_resources[] = { | ||
331 | { | 332 | { |
332 | .start = 0xFFC00400, | 333 | .start = UART0_THR, |
333 | .end = 0xFFC004FF, | 334 | .end = UART0_GCTL+2, |
334 | .flags = IORESOURCE_MEM, | 335 | .flags = IORESOURCE_MEM, |
335 | }, { | 336 | }, |
336 | .start = 0xFFC02000, | 337 | { |
337 | .end = 0xFFC020FF, | 338 | .start = IRQ_UART0_RX, |
339 | .end = IRQ_UART0_RX+1, | ||
340 | .flags = IORESOURCE_IRQ, | ||
341 | }, | ||
342 | { | ||
343 | .start = IRQ_UART0_ERROR, | ||
344 | .end = IRQ_UART0_ERROR, | ||
345 | .flags = IORESOURCE_IRQ, | ||
346 | }, | ||
347 | { | ||
348 | .start = CH_UART0_TX, | ||
349 | .end = CH_UART0_TX, | ||
350 | .flags = IORESOURCE_DMA, | ||
351 | }, | ||
352 | { | ||
353 | .start = CH_UART0_RX, | ||
354 | .end = CH_UART0_RX, | ||
355 | .flags = IORESOURCE_DMA, | ||
356 | }, | ||
357 | }; | ||
358 | |||
359 | unsigned short bfin_uart0_peripherals[] = { | ||
360 | P_UART0_TX, P_UART0_RX, 0 | ||
361 | }; | ||
362 | |||
363 | static struct platform_device bfin_uart0_device = { | ||
364 | .name = "bfin-uart", | ||
365 | .id = 0, | ||
366 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
367 | .resource = bfin_uart0_resources, | ||
368 | .dev = { | ||
369 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
370 | }, | ||
371 | }; | ||
372 | #endif | ||
373 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
374 | static struct resource bfin_uart1_resources[] = { | ||
375 | { | ||
376 | .start = UART1_THR, | ||
377 | .end = UART1_GCTL+2, | ||
338 | .flags = IORESOURCE_MEM, | 378 | .flags = IORESOURCE_MEM, |
339 | }, | 379 | }, |
380 | { | ||
381 | .start = IRQ_UART1_RX, | ||
382 | .end = IRQ_UART1_RX+1, | ||
383 | .flags = IORESOURCE_IRQ, | ||
384 | }, | ||
385 | { | ||
386 | .start = IRQ_UART1_ERROR, | ||
387 | .end = IRQ_UART1_ERROR, | ||
388 | .flags = IORESOURCE_IRQ, | ||
389 | }, | ||
390 | { | ||
391 | .start = CH_UART1_TX, | ||
392 | .end = CH_UART1_TX, | ||
393 | .flags = IORESOURCE_DMA, | ||
394 | }, | ||
395 | { | ||
396 | .start = CH_UART1_RX, | ||
397 | .end = CH_UART1_RX, | ||
398 | .flags = IORESOURCE_DMA, | ||
399 | }, | ||
340 | }; | 400 | }; |
341 | 401 | ||
342 | static struct platform_device bfin_uart_device = { | 402 | unsigned short bfin_uart1_peripherals[] = { |
403 | P_UART1_TX, P_UART1_RX, 0 | ||
404 | }; | ||
405 | |||
406 | static struct platform_device bfin_uart1_device = { | ||
343 | .name = "bfin-uart", | 407 | .name = "bfin-uart", |
344 | .id = 1, | 408 | .id = 1, |
345 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 409 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
346 | .resource = bfin_uart_resources, | 410 | .resource = bfin_uart1_resources, |
411 | .dev = { | ||
412 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
413 | }, | ||
347 | }; | 414 | }; |
348 | #endif | 415 | #endif |
416 | #endif | ||
349 | 417 | ||
350 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 418 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
351 | #ifdef CONFIG_BFIN_SIR0 | 419 | #ifdef CONFIG_BFIN_SIR0 |
@@ -524,7 +592,12 @@ static struct platform_device *cm_bf537_devices[] __initdata = { | |||
524 | #endif | 592 | #endif |
525 | 593 | ||
526 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 594 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
527 | &bfin_uart_device, | 595 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
596 | &bfin_uart0_device, | ||
597 | #endif | ||
598 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
599 | &bfin_uart1_device, | ||
600 | #endif | ||
528 | #endif | 601 | #endif |
529 | 602 | ||
530 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 603 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |