From cd4a05f9df859e7cd2efa96e035444a3decb427a Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 2 Apr 2009 22:32:10 +0200 Subject: MXC: rename mxc_map_io to architecture specific versions This allows us to have more mapping functions for more than one i.MX architecture in the kernel. As this is the earliest board specific hook we have, also use it to set the cpu type. Signed-off-by: Sascha Hauer --- arch/arm/mach-mx1/generic.c | 4 +++- arch/arm/mach-mx1/mx1ads.c | 2 +- arch/arm/mach-mx1/scb9328.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-mx1') diff --git a/arch/arm/mach-mx1/generic.c b/arch/arm/mach-mx1/generic.c index 0dec6f300ff..9c3528dbbfe 100644 --- a/arch/arm/mach-mx1/generic.c +++ b/arch/arm/mach-mx1/generic.c @@ -37,7 +37,9 @@ static struct map_desc imx_io_desc[] __initdata = { } }; -void __init mxc_map_io(void) +void __init mx1_map_io(void) { + mxc_set_cpu_type(MXC_CPU_MX1); + iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc)); } diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c index e54057fb855..7a648c18393 100644 --- a/arch/arm/mach-mx1/mx1ads.c +++ b/arch/arm/mach-mx1/mx1ads.c @@ -198,7 +198,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS") .phys_io = IMX_IO_PHYS, .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, .boot_params = PHYS_OFFSET + 0x100, - .map_io = mxc_map_io, + .map_io = mx1_map_io, .init_irq = mxc_init_irq, .timer = &mx1ads_timer, .init_machine = mx1ads_init, diff --git a/arch/arm/mach-mx1/scb9328.c b/arch/arm/mach-mx1/scb9328.c index 0e71f3fa28b..20e0b5bcdff 100644 --- a/arch/arm/mach-mx1/scb9328.c +++ b/arch/arm/mach-mx1/scb9328.c @@ -153,7 +153,7 @@ MACHINE_START(SCB9328, "Synertronixx scb9328") .phys_io = 0x00200000, .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, .boot_params = 0x08000100, - .map_io = mxc_map_io, + .map_io = mx1_map_io, .init_irq = mxc_init_irq, .timer = &scb9328_timer, .init_machine = scb9328_init, -- cgit v1.2.2 From 5b68421f41b47dd9311b81d9e0d7e9781c2983f3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 29 Apr 2009 13:14:19 +0200 Subject: mx1ads: remove ifdefs, reorder include alphabetically header is part of the kernel now. Signed-off-by: Sascha Hauer --- arch/arm/mach-mx1/mx1ads.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'arch/arm/mach-mx1') diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c index 7a648c18393..1d28598bcc3 100644 --- a/arch/arm/mach-mx1/mx1ads.c +++ b/arch/arm/mach-mx1/mx1ads.c @@ -12,24 +12,24 @@ * warranty of any kind, whether express or implied. */ -#include +#include +#include #include +#include #include #include -#include -#include #include #include #include -#include -#include #include -#include -#include +#include #include +#include #include +#include + #include "devices.h" /* @@ -111,7 +111,6 @@ static struct platform_device flash_device = { /* * I2C */ - static int i2c_pins[] = { PA15_PF_I2C_SDA, PA16_PF_I2C_SCL, -- cgit v1.2.2 From 5ae07daa488e78994db731d0fd133967a5cf0ceb Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 29 Apr 2009 13:17:21 +0200 Subject: mx1ads: setup iomux pins at once Signed-off-by: Sascha Hauer --- arch/arm/mach-mx1/mx1ads.c | 73 ++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 55 deletions(-) (limited to 'arch/arm/mach-mx1') diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c index 1d28598bcc3..55d32897cb4 100644 --- a/arch/arm/mach-mx1/mx1ads.c +++ b/arch/arm/mach-mx1/mx1ads.c @@ -32,57 +32,36 @@ #include "devices.h" -/* - * UARTs platform data - */ -static int mxc_uart1_pins[] = { +static int mx1ads_pins[] = { + /* UART1 */ PC9_PF_UART1_CTS, PC10_PF_UART1_RTS, PC11_PF_UART1_TXD, PC12_PF_UART1_RXD, -}; - -static int uart1_mxc_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, - ARRAY_SIZE(mxc_uart1_pins), "UART1"); -} - -static int uart1_mxc_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart1_pins, - ARRAY_SIZE(mxc_uart1_pins)); - return 0; -} - -static int mxc_uart2_pins[] = { + /* UART2 */ PB28_PF_UART2_CTS, PB29_PF_UART2_RTS, PB30_PF_UART2_TXD, PB31_PF_UART2_RXD, + /* I2C */ + PA15_PF_I2C_SDA, + PA16_PF_I2C_SCL, + /* SPI */ + PC13_PF_SPI1_SPI_RDY, + PC14_PF_SPI1_SCLK, + PC15_PF_SPI1_SS, + PC16_PF_SPI1_MISO, + PC17_PF_SPI1_MOSI, }; -static int uart2_mxc_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, - ARRAY_SIZE(mxc_uart2_pins), "UART2"); -} - -static int uart2_mxc_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart2_pins, - ARRAY_SIZE(mxc_uart2_pins)); - return 0; -} +/* + * UARTs platform data + */ static struct imxuart_platform_data uart_pdata[] = { { - .init = uart1_mxc_init, - .exit = uart1_mxc_exit, .flags = IMXUART_HAVE_RTSCTS, }, { - .init = uart2_mxc_init, - .exit = uart2_mxc_exit, .flags = IMXUART_HAVE_RTSCTS, }, }; @@ -111,23 +90,6 @@ static struct platform_device flash_device = { /* * I2C */ -static int i2c_pins[] = { - PA15_PF_I2C_SDA, - PA16_PF_I2C_SCL, -}; - -static int i2c_init(struct device *dev) -{ - return mxc_gpio_setup_multiple_pins(i2c_pins, - ARRAY_SIZE(i2c_pins), "I2C"); -} - -static void i2c_exit(struct device *dev) -{ - mxc_gpio_release_multiple_pins(i2c_pins, - ARRAY_SIZE(i2c_pins)); -} - static struct pcf857x_platform_data pcf857x_data[] = { { .gpio_base = 4 * 32, @@ -138,8 +100,6 @@ static struct pcf857x_platform_data pcf857x_data[] = { static struct imxi2c_platform_data mx1ads_i2c_data = { .bitrate = 100000, - .init = i2c_init, - .exit = i2c_exit, }; static struct i2c_board_info mx1ads_i2c_devices[] = { @@ -159,6 +119,9 @@ static struct i2c_board_info mx1ads_i2c_devices[] = { */ static void __init mx1ads_init(void) { + mxc_gpio_setup_multiple_pins(mx1ads_pins, + ARRAY_SIZE(mx1ads_pins), "mx1ads"); + /* UART */ mxc_register_device(&imx_uart1_device, &uart_pdata[0]); mxc_register_device(&imx_uart2_device, &uart_pdata[1]); -- cgit v1.2.2 From 345569a2ed84478ce860a32555edd71bb321e48b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 29 Apr 2009 13:41:06 +0200 Subject: mx1: add missing include Signed-off-by: Sascha Hauer --- arch/arm/mach-mx1/generic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-mx1') diff --git a/arch/arm/mach-mx1/generic.c b/arch/arm/mach-mx1/generic.c index 9c3528dbbfe..7622c9b38c9 100644 --- a/arch/arm/mach-mx1/generic.c +++ b/arch/arm/mach-mx1/generic.c @@ -26,6 +26,7 @@ #include +#include #include static struct map_desc imx_io_desc[] __initdata = { -- cgit v1.2.2 From 74fe030e63bd9e4adc5a67128d4c8359b37df55d Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 29 Apr 2009 13:41:40 +0200 Subject: mx1ads: rename mxc_map_io to mx1_map_io Signed-off-by: Sascha Hauer --- arch/arm/mach-mx1/mx1ads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-mx1') diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c index 55d32897cb4..e5b0c0a83c3 100644 --- a/arch/arm/mach-mx1/mx1ads.c +++ b/arch/arm/mach-mx1/mx1ads.c @@ -150,7 +150,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS") .phys_io = IMX_IO_PHYS, .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, .boot_params = PHYS_OFFSET + 0x100, - .map_io = mxc_map_io, + .map_io = mx1_map_io, .init_irq = mxc_init_irq, .timer = &mx1ads_timer, .init_machine = mx1ads_init, -- cgit v1.2.2