Commit 7880dcb2 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Shawn Guo

ARM: imx legacy: mx31lilly: move peripheral initialization to .init_late

The change moves some of peripheral registrations and initializations
(all peripherals dependent on GPIOs) from .init_machine to .init_late
level, this allows to safely shift the shared GPIO controller driver
initialization level after init level of i.MX IOMUXC driver.
Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 894b7cbe
...@@ -56,6 +56,26 @@ ...@@ -56,6 +56,26 @@
* appropriate baseboard support code. * appropriate baseboard support code.
*/ */
static unsigned int mx31lilly_pins[] __initdata = {
MX31_PIN_CTS1__CTS1,
MX31_PIN_RTS1__RTS1,
MX31_PIN_TXD1__TXD1,
MX31_PIN_RXD1__RXD1,
MX31_PIN_CTS2__CTS2,
MX31_PIN_RTS2__RTS2,
MX31_PIN_TXD2__TXD2,
MX31_PIN_RXD2__RXD2,
MX31_PIN_CSPI3_MOSI__RXD3,
MX31_PIN_CSPI3_MISO__TXD3,
MX31_PIN_CSPI3_SCLK__RTS3,
MX31_PIN_CSPI3_SPI_RDY__CTS3,
};
/* UART */
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
};
/* SMSC ethernet support */ /* SMSC ethernet support */
static struct resource smsc91x_resources[] = { static struct resource smsc91x_resources[] = {
...@@ -252,16 +272,12 @@ static void __init mx31lilly_board_init(void) ...@@ -252,16 +272,12 @@ static void __init mx31lilly_board_init(void)
{ {
imx31_soc_init(); imx31_soc_init();
switch (mx31lilly_baseboard) { mxc_iomux_setup_multiple_pins(mx31lilly_pins,
case MX31LILLY_NOBOARD: ARRAY_SIZE(mx31lilly_pins), "mx31lily");
break;
case MX31LILLY_DB: imx31_add_imx_uart0(&uart_pdata);
mx31lilly_db_init(); imx31_add_imx_uart1(&uart_pdata);
break; imx31_add_imx_uart2(&uart_pdata);
default:
printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n",
mx31lilly_baseboard);
}
mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
...@@ -284,10 +300,17 @@ static void __init mx31lilly_board_init(void) ...@@ -284,10 +300,17 @@ static void __init mx31lilly_board_init(void)
imx31_add_spi_imx0(&spi0_pdata); imx31_add_spi_imx0(&spi0_pdata);
imx31_add_spi_imx1(&spi1_pdata); imx31_add_spi_imx1(&spi1_pdata);
mc13783_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
spi_register_board_info(&mc13783_dev, 1);
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
}
static void __init mx31lilly_late_init(void)
{
if (mx31lilly_baseboard == MX31LILLY_DB)
mx31lilly_db_init();
mc13783_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
spi_register_board_info(&mc13783_dev, 1);
smsc91x_resources[1].start = smsc91x_resources[1].start =
gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)); gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0));
...@@ -310,6 +333,7 @@ MACHINE_START(LILLY1131, "INCO startec LILLY-1131") ...@@ -310,6 +333,7 @@ MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
.init_early = imx31_init_early, .init_early = imx31_init_early,
.init_irq = mx31_init_irq, .init_irq = mx31_init_irq,
.init_time = mx31lilly_timer_init, .init_time = mx31lilly_timer_init,
.init_machine = mx31lilly_board_init, .init_machine = mx31lilly_board_init,
.init_late = mx31lilly_late_init,
.restart = mxc_restart, .restart = mxc_restart,
MACHINE_END MACHINE_END
...@@ -43,18 +43,6 @@ ...@@ -43,18 +43,6 @@
*/ */
static unsigned int lilly_db_board_pins[] __initdata = { static unsigned int lilly_db_board_pins[] __initdata = {
MX31_PIN_CTS1__CTS1,
MX31_PIN_RTS1__RTS1,
MX31_PIN_TXD1__TXD1,
MX31_PIN_RXD1__RXD1,
MX31_PIN_CTS2__CTS2,
MX31_PIN_RTS2__RTS2,
MX31_PIN_TXD2__TXD2,
MX31_PIN_RXD2__RXD2,
MX31_PIN_CSPI3_MOSI__RXD3,
MX31_PIN_CSPI3_MISO__TXD3,
MX31_PIN_CSPI3_SCLK__RTS3,
MX31_PIN_CSPI3_SPI_RDY__CTS3,
MX31_PIN_SD1_DATA3__SD1_DATA3, MX31_PIN_SD1_DATA3__SD1_DATA3,
MX31_PIN_SD1_DATA2__SD1_DATA2, MX31_PIN_SD1_DATA2__SD1_DATA2,
MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA1__SD1_DATA1,
...@@ -86,11 +74,6 @@ static unsigned int lilly_db_board_pins[] __initdata = { ...@@ -86,11 +74,6 @@ static unsigned int lilly_db_board_pins[] __initdata = {
MX31_PIN_CONTRAST__CONTRAST, MX31_PIN_CONTRAST__CONTRAST,
}; };
/* UART */
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
};
/* MMC support */ /* MMC support */
static int mxc_mmc1_get_ro(struct device *dev) static int mxc_mmc1_get_ro(struct device *dev)
...@@ -203,9 +186,6 @@ void __init mx31lilly_db_init(void) ...@@ -203,9 +186,6 @@ void __init mx31lilly_db_init(void)
mxc_iomux_setup_multiple_pins(lilly_db_board_pins, mxc_iomux_setup_multiple_pins(lilly_db_board_pins,
ARRAY_SIZE(lilly_db_board_pins), ARRAY_SIZE(lilly_db_board_pins),
"development board pins"); "development board pins");
imx31_add_imx_uart0(&uart_pdata);
imx31_add_imx_uart1(&uart_pdata);
imx31_add_imx_uart2(&uart_pdata);
imx31_add_mxc_mmc(0, &mmc_pdata); imx31_add_mxc_mmc(0, &mmc_pdata);
mx31lilly_init_fb(); mx31lilly_init_fb();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment