aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm646x.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-03-18 13:36:08 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-28 18:17:41 -0400
commit65e866a9741126c678e6dcd5d4fa8c9eca18e945 (patch)
tree069a15d3baed6c34b59e8504f1d5e3f73477f349 /arch/arm/mach-davinci/dm646x.c
parenta994955cc091a8a51b7d7412174d9cf6de04d26b (diff)
davinci: Move serial platform_device into SoC-specific files
Currently, there is one set of platform_device and platform_data structures for all DaVinci SoCs. The differences in the data between the various SoCs is handled by davinci_serial_init() by checking the SoC type. However, as new SoCs appear, this routine will become more & more cluttered. To clean up the routine and make it easier to add support for new SoCs, move the platform_device and platform_data structures into the SoC-specific code and use the SoC infrastructure to provide access to the data. In the process, fix a bug where the wrong irq is used for uart2 of the dm646x. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dm646x.c')
-rw-r--r--arch/arm/mach-davinci/dm646x.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index f980c2f95de4..544658e58854 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/serial_8250.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
15#include <linux/gpio.h> 16#include <linux/gpio.h>
16 17
@@ -24,6 +25,7 @@
24#include <mach/psc.h> 25#include <mach/psc.h>
25#include <mach/mux.h> 26#include <mach/mux.h>
26#include <mach/time.h> 27#include <mach/time.h>
28#include <mach/serial.h>
27#include <mach/common.h> 29#include <mach/common.h>
28 30
29#include "clock.h" 31#include "clock.h"
@@ -552,6 +554,44 @@ struct davinci_timer_info dm646x_timer_info = {
552 .clocksource_id = T0_TOP, 554 .clocksource_id = T0_TOP,
553}; 555};
554 556
557static struct plat_serial8250_port dm646x_serial_platform_data[] = {
558 {
559 .mapbase = DAVINCI_UART0_BASE,
560 .irq = IRQ_UARTINT0,
561 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
562 UPF_IOREMAP,
563 .iotype = UPIO_MEM32,
564 .regshift = 2,
565 },
566 {
567 .mapbase = DAVINCI_UART1_BASE,
568 .irq = IRQ_UARTINT1,
569 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
570 UPF_IOREMAP,
571 .iotype = UPIO_MEM32,
572 .regshift = 2,
573 },
574 {
575 .mapbase = DAVINCI_UART2_BASE,
576 .irq = IRQ_DM646X_UARTINT2,
577 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
578 UPF_IOREMAP,
579 .iotype = UPIO_MEM32,
580 .regshift = 2,
581 },
582 {
583 .flags = 0
584 },
585};
586
587static struct platform_device dm646x_serial_device = {
588 .name = "serial8250",
589 .id = PLAT8250_DEV_PLATFORM,
590 .dev = {
591 .platform_data = dm646x_serial_platform_data,
592 },
593};
594
555static struct davinci_soc_info davinci_soc_info_dm646x = { 595static struct davinci_soc_info davinci_soc_info_dm646x = {
556 .io_desc = dm646x_io_desc, 596 .io_desc = dm646x_io_desc,
557 .io_desc_num = ARRAY_SIZE(dm646x_io_desc), 597 .io_desc_num = ARRAY_SIZE(dm646x_io_desc),
@@ -573,6 +613,7 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
573 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 613 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
574 .gpio_num = 43, /* Only 33 usable */ 614 .gpio_num = 43, /* Only 33 usable */
575 .gpio_irq = IRQ_DM646X_GPIOBNK0, 615 .gpio_irq = IRQ_DM646X_GPIOBNK0,
616 .serial_dev = &dm646x_serial_device,
576}; 617};
577 618
578void __init dm646x_init(void) 619void __init dm646x_init(void)