aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm355.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/dm355.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/dm355.c')
-rw-r--r--arch/arm/mach-davinci/dm355.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 757def752010..4c3257ef5ddc 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.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/dma-mapping.h> 16#include <linux/dma-mapping.h>
16#include <linux/gpio.h> 17#include <linux/gpio.h>
@@ -27,6 +28,7 @@
27#include <mach/mux.h> 28#include <mach/mux.h>
28#include <mach/irqs.h> 29#include <mach/irqs.h>
29#include <mach/time.h> 30#include <mach/time.h>
31#include <mach/serial.h>
30#include <mach/common.h> 32#include <mach/common.h>
31 33
32#include "clock.h" 34#include "clock.h"
@@ -630,6 +632,44 @@ struct davinci_timer_info dm355_timer_info = {
630 .clocksource_id = T0_TOP, 632 .clocksource_id = T0_TOP,
631}; 633};
632 634
635static struct plat_serial8250_port dm355_serial_platform_data[] = {
636 {
637 .mapbase = DAVINCI_UART0_BASE,
638 .irq = IRQ_UARTINT0,
639 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
640 UPF_IOREMAP,
641 .iotype = UPIO_MEM,
642 .regshift = 2,
643 },
644 {
645 .mapbase = DAVINCI_UART1_BASE,
646 .irq = IRQ_UARTINT1,
647 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
648 UPF_IOREMAP,
649 .iotype = UPIO_MEM,
650 .regshift = 2,
651 },
652 {
653 .mapbase = DM355_UART2_BASE,
654 .irq = IRQ_DM355_UARTINT2,
655 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
656 UPF_IOREMAP,
657 .iotype = UPIO_MEM,
658 .regshift = 2,
659 },
660 {
661 .flags = 0
662 },
663};
664
665static struct platform_device dm355_serial_device = {
666 .name = "serial8250",
667 .id = PLAT8250_DEV_PLATFORM,
668 .dev = {
669 .platform_data = dm355_serial_platform_data,
670 },
671};
672
633static struct davinci_soc_info davinci_soc_info_dm355 = { 673static struct davinci_soc_info davinci_soc_info_dm355 = {
634 .io_desc = dm355_io_desc, 674 .io_desc = dm355_io_desc,
635 .io_desc_num = ARRAY_SIZE(dm355_io_desc), 675 .io_desc_num = ARRAY_SIZE(dm355_io_desc),
@@ -651,6 +691,7 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
651 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 691 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
652 .gpio_num = 104, 692 .gpio_num = 104,
653 .gpio_irq = IRQ_DM355_GPIOBNK0, 693 .gpio_irq = IRQ_DM355_GPIOBNK0,
694 .serial_dev = &dm355_serial_device,
654}; 695};
655 696
656void __init dm355_init(void) 697void __init dm355_init(void)