[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>
Cette révision appartient à :

révisé par
Russell King

Parent
b2556da55f
révision
5b80234435
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/imx-uart.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include "generic.h"
|
||||
|
||||
@@ -48,8 +49,70 @@ static struct platform_device cs89x0_device = {
|
||||
.resource = cs89x0_resources,
|
||||
};
|
||||
|
||||
static struct imxuart_platform_data uart_pdata = {
|
||||
.flags = IMXUART_HAVE_RTSCTS,
|
||||
};
|
||||
|
||||
static struct resource imx_uart1_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x00206000,
|
||||
.end = 0x002060FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = (UART1_MINT_RX),
|
||||
.end = (UART1_MINT_RX),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
[2] = {
|
||||
.start = (UART1_MINT_TX),
|
||||
.end = (UART1_MINT_TX),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device imx_uart1_device = {
|
||||
.name = "imx-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(imx_uart1_resources),
|
||||
.resource = imx_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &uart_pdata,
|
||||
}
|
||||
};
|
||||
|
||||
static struct resource imx_uart2_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x00207000,
|
||||
.end = 0x002070FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = (UART2_MINT_RX),
|
||||
.end = (UART2_MINT_RX),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
[2] = {
|
||||
.start = (UART2_MINT_TX),
|
||||
.end = (UART2_MINT_TX),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device imx_uart2_device = {
|
||||
.name = "imx-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(imx_uart2_resources),
|
||||
.resource = imx_uart2_resources,
|
||||
.dev = {
|
||||
.platform_data = &uart_pdata,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
&cs89x0_device,
|
||||
&imx_uart1_device,
|
||||
&imx_uart2_device,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MMC_IMX
|
||||
@@ -75,6 +138,17 @@ mx1ads_init(void)
|
||||
imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
|
||||
imx_set_mmc_info(&mx1ads_mmc_info);
|
||||
#endif
|
||||
|
||||
imx_gpio_mode(PC9_PF_UART1_CTS);
|
||||
imx_gpio_mode(PC10_PF_UART1_RTS);
|
||||
imx_gpio_mode(PC11_PF_UART1_TXD);
|
||||
imx_gpio_mode(PC12_PF_UART1_RXD);
|
||||
|
||||
imx_gpio_mode(PB28_PF_UART2_CTS);
|
||||
imx_gpio_mode(PB29_PF_UART2_RTS);
|
||||
imx_gpio_mode(PB30_PF_UART2_TXD);
|
||||
imx_gpio_mode(PB31_PF_UART2_RXD);
|
||||
|
||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
}
|
||||
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur