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/boards/pnav10.c | |
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/boards/pnav10.c')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 93 |
1 files changed, 83 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 4e0afda472a..3c36abdf340 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) |