aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm644x.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/dm644x.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/dm644x.c')
-rw-r--r--arch/arm/mach-davinci/dm644x.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index cfd918e41e2d..a5629864d029 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.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"
@@ -573,6 +575,44 @@ struct davinci_timer_info dm644x_timer_info = {
573 .clocksource_id = T0_TOP, 575 .clocksource_id = T0_TOP,
574}; 576};
575 577
578static struct plat_serial8250_port dm644x_serial_platform_data[] = {
579 {
580 .mapbase = DAVINCI_UART0_BASE,
581 .irq = IRQ_UARTINT0,
582 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
583 UPF_IOREMAP,
584 .iotype = UPIO_MEM,
585 .regshift = 2,
586 },
587 {
588 .mapbase = DAVINCI_UART1_BASE,
589 .irq = IRQ_UARTINT1,
590 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
591 UPF_IOREMAP,
592 .iotype = UPIO_MEM,
593 .regshift = 2,
594 },
595 {
596 .mapbase = DAVINCI_UART2_BASE,
597 .irq = IRQ_UARTINT2,
598 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
599 UPF_IOREMAP,
600 .iotype = UPIO_MEM,
601 .regshift = 2,
602 },
603 {
604 .flags = 0
605 },
606};
607
608static struct platform_device dm644x_serial_device = {
609 .name = "serial8250",
610 .id = PLAT8250_DEV_PLATFORM,
611 .dev = {
612 .platform_data = dm644x_serial_platform_data,
613 },
614};
615
576static struct davinci_soc_info davinci_soc_info_dm644x = { 616static struct davinci_soc_info davinci_soc_info_dm644x = {
577 .io_desc = dm644x_io_desc, 617 .io_desc = dm644x_io_desc,
578 .io_desc_num = ARRAY_SIZE(dm644x_io_desc), 618 .io_desc_num = ARRAY_SIZE(dm644x_io_desc),
@@ -594,6 +634,7 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
594 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 634 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
595 .gpio_num = 71, 635 .gpio_num = 71,
596 .gpio_irq = IRQ_GPIOBNK0, 636 .gpio_irq = IRQ_GPIOBNK0,
637 .serial_dev = &dm644x_serial_device,
597}; 638};
598 639
599void __init dm644x_init(void) 640void __init dm644x_init(void)