aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mx1ads.c
diff options
context:
space:
mode:
authorSascha Hauer <sascha@saschahauer.de>2006-05-04 09:07:42 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-05-04 09:07:42 -0400
commit5b802344357338a4d645beac8ca97470bcbe3542 (patch)
treef3f8df6cb9bec5ddb6dc947ea99eb9454232066b /arch/arm/mach-imx/mx1ads.c
parentb2556da55f78a9dbe92830b1d1c0b612edfea9fd (diff)
[ARM] 3490/1: i.MX: move uart resources to board files
Patch from Sascha Hauer This patch moves the i.MX uart resources and the gpio pin setup to the board files. This allows the boards to decide how many internal uarts are connected to the outside world and whether they use rts/cts or not. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-imx/mx1ads.c')
-rw-r--r--arch/arm/mach-imx/mx1ads.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
index e34d0df90aed..e1f6c0bbe1e7 100644
--- a/arch/arm/mach-imx/mx1ads.c
+++ b/arch/arm/mach-imx/mx1ads.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/arch/mmc.h> 28#include <asm/arch/mmc.h>
29#include <asm/arch/imx-uart.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
30#include "generic.h" 31#include "generic.h"
31 32
@@ -48,8 +49,70 @@ static struct platform_device cs89x0_device = {
48 .resource = cs89x0_resources, 49 .resource = cs89x0_resources,
49}; 50};
50 51
52static struct imxuart_platform_data uart_pdata = {
53 .flags = IMXUART_HAVE_RTSCTS,
54};
55
56static struct resource imx_uart1_resources[] = {
57 [0] = {
58 .start = 0x00206000,
59 .end = 0x002060FF,
60 .flags = IORESOURCE_MEM,
61 },
62 [1] = {
63 .start = (UART1_MINT_RX),
64 .end = (UART1_MINT_RX),
65 .flags = IORESOURCE_IRQ,
66 },
67 [2] = {
68 .start = (UART1_MINT_TX),
69 .end = (UART1_MINT_TX),
70 .flags = IORESOURCE_IRQ,
71 },
72};
73
74static struct platform_device imx_uart1_device = {
75 .name = "imx-uart",
76 .id = 0,
77 .num_resources = ARRAY_SIZE(imx_uart1_resources),
78 .resource = imx_uart1_resources,
79 .dev = {
80 .platform_data = &uart_pdata,
81 }
82};
83
84static struct resource imx_uart2_resources[] = {
85 [0] = {
86 .start = 0x00207000,
87 .end = 0x002070FF,
88 .flags = IORESOURCE_MEM,
89 },
90 [1] = {
91 .start = (UART2_MINT_RX),
92 .end = (UART2_MINT_RX),
93 .flags = IORESOURCE_IRQ,
94 },
95 [2] = {
96 .start = (UART2_MINT_TX),
97 .end = (UART2_MINT_TX),
98 .flags = IORESOURCE_IRQ,
99 },
100};
101
102static struct platform_device imx_uart2_device = {
103 .name = "imx-uart",
104 .id = 1,
105 .num_resources = ARRAY_SIZE(imx_uart2_resources),
106 .resource = imx_uart2_resources,
107 .dev = {
108 .platform_data = &uart_pdata,
109 }
110};
111
51static struct platform_device *devices[] __initdata = { 112static struct platform_device *devices[] __initdata = {
52 &cs89x0_device, 113 &cs89x0_device,
114 &imx_uart1_device,
115 &imx_uart2_device,
53}; 116};
54 117
55#ifdef CONFIG_MMC_IMX 118#ifdef CONFIG_MMC_IMX
@@ -75,6 +138,17 @@ mx1ads_init(void)
75 imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20); 138 imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
76 imx_set_mmc_info(&mx1ads_mmc_info); 139 imx_set_mmc_info(&mx1ads_mmc_info);
77#endif 140#endif
141
142 imx_gpio_mode(PC9_PF_UART1_CTS);
143 imx_gpio_mode(PC10_PF_UART1_RTS);
144 imx_gpio_mode(PC11_PF_UART1_TXD);
145 imx_gpio_mode(PC12_PF_UART1_RXD);
146
147 imx_gpio_mode(PB28_PF_UART2_CTS);
148 imx_gpio_mode(PB29_PF_UART2_RTS);
149 imx_gpio_mode(PB30_PF_UART2_TXD);
150 imx_gpio_mode(PB31_PF_UART2_RXD);
151
78 platform_add_devices(devices, ARRAY_SIZE(devices)); 152 platform_add_devices(devices, ARRAY_SIZE(devices));
79} 153}
80 154