aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/Kconfig12
-rw-r--r--arch/arm/mach-imx/Makefile5
-rw-r--r--arch/arm/mach-imx/clock-imx1.c1
-rw-r--r--arch/arm/mach-imx/clock-imx25.c3
-rw-r--r--arch/arm/mach-imx/devices-imx1.h11
-rw-r--r--arch/arm/mach-imx/devices-imx25.h6
-rw-r--r--arch/arm/mach-imx/dma-v1.c2
-rw-r--r--arch/arm/mach-imx/ehci-imx25.c80
-rw-r--r--arch/arm/mach-imx/ehci-imx27.c82
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c7
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c49
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c27
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c32
-rw-r--r--arch/arm/mach-imx/mach-imx27ipcam.c78
-rw-r--r--arch/arm/mach-imx/mach-imx27lite.c11
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c22
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c11
-rw-r--r--arch/arm/mach-imx/mach-mx25_3ds.c32
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c43
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c11
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c12
-rw-r--r--arch/arm/mach-imx/mach-pca100.c49
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c27
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c13
-rw-r--r--arch/arm/mach-imx/mm-imx1.c21
-rw-r--r--arch/arm/mach-imx/mm-imx21.c23
-rw-r--r--arch/arm/mach-imx/mm-imx25.c18
-rw-r--r--arch/arm/mach-imx/mm-imx27.c23
28 files changed, 553 insertions, 158 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 56684b517070..5eec099e0c72 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -100,6 +100,7 @@ config MACH_MX25_3DS
100 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 100 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
101 select IMX_HAVE_PLATFORM_IMX2_WDT 101 select IMX_HAVE_PLATFORM_IMX2_WDT
102 select IMX_HAVE_PLATFORM_IMXDI_RTC 102 select IMX_HAVE_PLATFORM_IMXDI_RTC
103 select IMX_HAVE_PLATFORM_IMX_I2C
103 select IMX_HAVE_PLATFORM_IMX_FB 104 select IMX_HAVE_PLATFORM_IMX_FB
104 select IMX_HAVE_PLATFORM_IMX_KEYPAD 105 select IMX_HAVE_PLATFORM_IMX_KEYPAD
105 select IMX_HAVE_PLATFORM_IMX_UART 106 select IMX_HAVE_PLATFORM_IMX_UART
@@ -238,6 +239,7 @@ config MACH_MX27_3DS
238 select SOC_IMX27 239 select SOC_IMX27
239 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 240 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
240 select IMX_HAVE_PLATFORM_IMX2_WDT 241 select IMX_HAVE_PLATFORM_IMX2_WDT
242 select IMX_HAVE_PLATFORM_IMX_I2C
241 select IMX_HAVE_PLATFORM_IMX_KEYPAD 243 select IMX_HAVE_PLATFORM_IMX_KEYPAD
242 select IMX_HAVE_PLATFORM_IMX_UART 244 select IMX_HAVE_PLATFORM_IMX_UART
243 select IMX_HAVE_PLATFORM_MXC_EHCI 245 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -265,6 +267,7 @@ config MACH_IMX27LITE
265 bool "LogicPD MX27 LITEKIT platform" 267 bool "LogicPD MX27 LITEKIT platform"
266 select SOC_IMX27 268 select SOC_IMX27
267 select IMX_HAVE_PLATFORM_IMX_UART 269 select IMX_HAVE_PLATFORM_IMX_UART
270 select IMX_HAVE_PLATFORM_IMX_SSI
268 help 271 help
269 Include support for MX27 LITEKIT platform. This includes specific 272 Include support for MX27 LITEKIT platform. This includes specific
270 configurations for the board and its peripherals. 273 configurations for the board and its peripherals.
@@ -300,4 +303,13 @@ config MACH_MXT_TD60
300 Include support for i-MXT (aka td60) platform. This 303 Include support for i-MXT (aka td60) platform. This
301 includes specific configurations for the module and its peripherals. 304 includes specific configurations for the module and its peripherals.
302 305
306config MACH_IMX27IPCAM
307 bool "IMX27 IPCAM platform"
308 select SOC_IMX27
309 select IMX_HAVE_PLATFORM_IMX2_WDT
310 select IMX_HAVE_PLATFORM_IMX_UART
311 help
312 Include support for IMX27 IPCAM platform. This includes specific
313 configurations for the board and its peripherals.
314
303endif 315endif
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 77100bf26153..b85794d27991 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -9,10 +9,10 @@ obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o
9obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o 9obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o
10obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o 10obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o
11 11
12obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o 12obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o ehci-imx25.o
13 13
14obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o 14obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o
15obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o 15obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o ehci-imx27.o
16 16
17# Support for CMOS sensor interface 17# Support for CMOS sensor interface
18obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o 18obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
@@ -36,3 +36,4 @@ obj-$(CONFIG_MACH_CPUIMX27) += mach-cpuimx27.o
36obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o 36obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
37obj-$(CONFIG_MACH_PCA100) += mach-pca100.o 37obj-$(CONFIG_MACH_PCA100) += mach-pca100.o
38obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o 38obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o
39obj-$(CONFIG_MACH_IMX27IPCAM) += mach-imx27ipcam.o
diff --git a/arch/arm/mach-imx/clock-imx1.c b/arch/arm/mach-imx/clock-imx1.c
index 3938a563b280..dcc41728fe72 100644
--- a/arch/arm/mach-imx/clock-imx1.c
+++ b/arch/arm/mach-imx/clock-imx1.c
@@ -592,6 +592,7 @@ static struct clk_lookup lookups[] __initdata = {
592 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk) 592 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk)
593 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) 593 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
594 _REGISTER_CLOCK("imx1-cspi.0", NULL, spi_clk) 594 _REGISTER_CLOCK("imx1-cspi.0", NULL, spi_clk)
595 _REGISTER_CLOCK("imx1-cspi.1", NULL, spi_clk)
595 _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk) 596 _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk)
596 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) 597 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
597 _REGISTER_CLOCK(NULL, "mshc", mshc_clk) 598 _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index daa0165b6772..a65838fc061c 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -228,6 +228,7 @@ DEFINE_CLOCK(esdhc1_per_clk, 0, CCM_CGCR0, 3, get_rate_esdhc1, NULL,
228DEFINE_CLOCK(esdhc2_ahb_clk, 0, CCM_CGCR0, 22, get_rate_esdhc2, NULL, NULL); 228DEFINE_CLOCK(esdhc2_ahb_clk, 0, CCM_CGCR0, 22, get_rate_esdhc2, NULL, NULL);
229DEFINE_CLOCK(esdhc2_per_clk, 0, CCM_CGCR0, 4, get_rate_esdhc2, NULL, 229DEFINE_CLOCK(esdhc2_per_clk, 0, CCM_CGCR0, 4, get_rate_esdhc2, NULL,
230 &esdhc2_ahb_clk); 230 &esdhc2_ahb_clk);
231DEFINE_CLOCK(sdma_ahb_clk, 0, CCM_CGCR0, 26, NULL, NULL, NULL);
231DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); 232DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL);
232DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL); 233DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL);
233DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk); 234DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk);
@@ -253,6 +254,7 @@ DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk);
253DEFINE_CLOCK(wdt_clk, 0, CCM_CGCR2, 19, get_rate_ipg, NULL, NULL); 254DEFINE_CLOCK(wdt_clk, 0, CCM_CGCR2, 19, get_rate_ipg, NULL, NULL);
254DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk); 255DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk);
255DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk); 256DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk);
257DEFINE_CLOCK(sdma_clk, 0, CCM_CGCR2, 6, get_rate_ipg, NULL, &sdma_ahb_clk);
256DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGCR1, 13, get_rate_esdhc1, NULL, 258DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGCR1, 13, get_rate_esdhc1, NULL,
257 &esdhc1_per_clk); 259 &esdhc1_per_clk);
258DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGCR1, 14, get_rate_esdhc2, NULL, 260DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGCR1, 14, get_rate_esdhc2, NULL,
@@ -304,6 +306,7 @@ static struct clk_lookup lookups[] = {
304 _REGISTER_CLOCK(NULL, "audmux", audmux_clk) 306 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
305 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) 307 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
306 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) 308 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
309 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
307}; 310};
308 311
309int __init mx25_clocks_init(void) 312int __init mx25_clocks_init(void)
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index 81979486218e..da593657ff3f 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -9,6 +9,10 @@
9#include <mach/mx1.h> 9#include <mach/mx1.h>
10#include <mach/devices-common.h> 10#include <mach/devices-common.h>
11 11
12extern const struct imx_imx_fb_data imx1_imx_fb_data __initconst;
13#define imx1_add_imx_fb(pdata) \
14 imx_add_imx_fb(&imx1_imx_fb_data, pdata)
15
12extern const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst; 16extern const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst;
13#define imx1_add_imx_i2c(pdata) \ 17#define imx1_add_imx_i2c(pdata) \
14 imx_add_imx_i2c(&imx1_imx_i2c_data, pdata) 18 imx_add_imx_i2c(&imx1_imx_i2c_data, pdata)
@@ -18,3 +22,10 @@ extern const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst;
18 imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata) 22 imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata)
19#define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata) 23#define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata)
20#define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata) 24#define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata)
25
26extern const struct imx_spi_imx_data imx1_cspi_data[] __initconst;
27#define imx1_add_cspi(id, pdata) \
28 imx_add_spi_imx(&imx1_cspi_data[id], pdata)
29
30#define imx1_add_spi_imx0(pdata) imx1_add_cspi(0, pdata)
31#define imx1_add_spi_imx1(pdata) imx1_add_cspi(1, pdata)
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index bde33caf1b90..b591d72f6037 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -81,7 +81,11 @@ imx25_sdhci_esdhc_imx_data[] __initconst;
81 81
82extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst; 82extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst;
83#define imx25_add_spi_imx(id, pdata) \ 83#define imx25_add_spi_imx(id, pdata) \
84 imx_add_spi_imx(&imx25_spi_imx_data[id], pdata) 84 imx_add_spi_imx(&imx25_cspi_data[id], pdata)
85#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) 85#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata)
86#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) 86#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata)
87#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) 87#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata)
88
89extern struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst;
90#define imx25_add_mxc_pwm(id) \
91 imx_add_mxc_pwm(&imx25_mxc_pwm_data[id])
diff --git a/arch/arm/mach-imx/dma-v1.c b/arch/arm/mach-imx/dma-v1.c
index e9f1769b49f5..236f1495efad 100644
--- a/arch/arm/mach-imx/dma-v1.c
+++ b/arch/arm/mach-imx/dma-v1.c
@@ -699,7 +699,7 @@ int imx_dma_request(int channel, const char *name)
699 local_irq_restore(flags); 699 local_irq_restore(flags);
700 return -EBUSY; 700 return -EBUSY;
701 } 701 }
702 memset(imxdma, 0, sizeof(imxdma)); 702 memset(imxdma, 0, sizeof(*imxdma));
703 imxdma->name = name; 703 imxdma->name = name;
704 local_irq_restore(flags); /* request_irq() can block */ 704 local_irq_restore(flags); /* request_irq() can block */
705 705
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c
new file mode 100644
index 000000000000..865daf0b09e9
--- /dev/null
+++ b/arch/arm/mach-imx/ehci-imx25.c
@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX25_OTG_SIC_SHIFT 29
25#define MX25_OTG_SIC_MASK (0x3 << MX25_OTG_SIC_SHIFT)
26#define MX25_OTG_PM_BIT (1 << 24)
27
28#define MX25_H1_SIC_SHIFT 21
29#define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT)
30#define MX25_H1_PM_BIT (1 << 8)
31#define MX25_H1_IPPUE_UP_BIT (1 << 7)
32#define MX25_H1_IPPUE_DOWN_BIT (1 << 6)
33#define MX25_H1_TLL_BIT (1 << 5)
34#define MX25_H1_USBTE_BIT (1 << 4)
35
36int mx25_initialize_usb_hw(int port, unsigned int flags)
37{
38 unsigned int v;
39
40 v = readl(MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
41
42 switch (port) {
43 case 0: /* OTG port */
44 v &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PM_BIT);
45 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT;
46
47 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
48 v |= MX25_OTG_PM_BIT;
49
50 break;
51 case 1: /* H1 port */
52 v &= ~(MX25_H1_SIC_MASK | MX25_H1_PM_BIT | MX25_H1_TLL_BIT |
53 MX25_H1_USBTE_BIT | MX25_H1_IPPUE_DOWN_BIT | MX25_H1_IPPUE_UP_BIT);
54 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX25_H1_SIC_SHIFT;
55
56 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
57 v |= MX25_H1_PM_BIT;
58
59 if (!(flags & MXC_EHCI_TTL_ENABLED))
60 v |= MX25_H1_TLL_BIT;
61
62 if (flags & MXC_EHCI_INTERNAL_PHY)
63 v |= MX25_H1_USBTE_BIT;
64
65 if (flags & MXC_EHCI_IPPUE_DOWN)
66 v |= MX25_H1_IPPUE_DOWN_BIT;
67
68 if (flags & MXC_EHCI_IPPUE_UP)
69 v |= MX25_H1_IPPUE_UP_BIT;
70
71 break;
72 default:
73 return -EINVAL;
74 }
75
76 writel(v, MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
77
78 return 0;
79}
80
diff --git a/arch/arm/mach-imx/ehci-imx27.c b/arch/arm/mach-imx/ehci-imx27.c
new file mode 100644
index 000000000000..fa69419eabdd
--- /dev/null
+++ b/arch/arm/mach-imx/ehci-imx27.c
@@ -0,0 +1,82 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX27_OTG_SIC_SHIFT 29
25#define MX27_OTG_SIC_MASK (0x3 << MX27_OTG_SIC_SHIFT)
26#define MX27_OTG_PM_BIT (1 << 24)
27
28#define MX27_H2_SIC_SHIFT 21
29#define MX27_H2_SIC_MASK (0x3 << MX27_H2_SIC_SHIFT)
30#define MX27_H2_PM_BIT (1 << 16)
31#define MX27_H2_DT_BIT (1 << 5)
32
33#define MX27_H1_SIC_SHIFT 13
34#define MX27_H1_SIC_MASK (0x3 << MX27_H1_SIC_SHIFT)
35#define MX27_H1_PM_BIT (1 << 8)
36#define MX27_H1_DT_BIT (1 << 4)
37
38int mx27_initialize_usb_hw(int port, unsigned int flags)
39{
40 unsigned int v;
41
42 v = readl(MX27_IO_ADDRESS(MX27_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
43
44 switch (port) {
45 case 0: /* OTG port */
46 v &= ~(MX27_OTG_SIC_MASK | MX27_OTG_PM_BIT);
47 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX27_OTG_SIC_SHIFT;
48
49 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
50 v |= MX27_OTG_PM_BIT;
51 break;
52 case 1: /* H1 port */
53 v &= ~(MX27_H1_SIC_MASK | MX27_H1_PM_BIT | MX27_H1_DT_BIT);
54 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX27_H1_SIC_SHIFT;
55
56 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
57 v |= MX27_H1_PM_BIT;
58
59 if (!(flags & MXC_EHCI_TTL_ENABLED))
60 v |= MX27_H1_DT_BIT;
61
62 break;
63 case 2: /* H2 port */
64 v &= ~(MX27_H2_SIC_MASK | MX27_H2_PM_BIT | MX27_H2_DT_BIT);
65 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX27_H2_SIC_SHIFT;
66
67 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
68 v |= MX27_H2_PM_BIT;
69
70 if (!(flags & MXC_EHCI_TTL_ENABLED))
71 v |= MX27_H2_DT_BIT;
72
73 break;
74 default:
75 return -EINVAL;
76 }
77
78 writel(v, MX27_IO_ADDRESS(MX27_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
79
80 return 0;
81}
82
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index 275c8589d797..fa5288018ba7 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -249,7 +249,7 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
249 249
250#define ADS7846_PENDOWN (GPIO_PORTD | 25) 250#define ADS7846_PENDOWN (GPIO_PORTD | 25)
251 251
252static void ads7846_dev_init(void) 252static void __maybe_unused ads7846_dev_init(void)
253{ 253{
254 if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) { 254 if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) {
255 printk(KERN_ERR "can't get ads746 pen down GPIO\n"); 255 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
@@ -268,7 +268,8 @@ static struct ads7846_platform_data ads7846_config __initdata = {
268 .keep_vref_on = 1, 268 .keep_vref_on = 1,
269}; 269};
270 270
271static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = { 271static struct spi_board_info __maybe_unused
272 eukrea_mbimx27_spi_board_info[] __initdata = {
272 [0] = { 273 [0] = {
273 .modalias = "ads7846", 274 .modalias = "ads7846",
274 .bus_num = 0, 275 .bus_num = 0,
@@ -357,13 +358,11 @@ void __init eukrea_mbimx27_baseboard_init(void)
357 ads7846_dev_init(); 358 ads7846_dev_init();
358#endif 359#endif
359 360
360#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
361 /* SPI_CS0 init */ 361 /* SPI_CS0 init */
362 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); 362 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
363 imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data); 363 imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data);
364 spi_register_board_info(eukrea_mbimx27_spi_board_info, 364 spi_register_board_info(eukrea_mbimx27_spi_board_info,
365 ARRAY_SIZE(eukrea_mbimx27_spi_board_info)); 365 ARRAY_SIZE(eukrea_mbimx27_spi_board_info));
366#endif
367 366
368 /* Leds configuration */ 367 /* Leds configuration */
369 mxc_gpio_mode(GPIO_PORTF | 16 | GPIO_GPIO | GPIO_OUT); 368 mxc_gpio_mode(GPIO_PORTF | 16 | GPIO_GPIO | GPIO_OUT);
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 6cf04da2456a..759299bb035b 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -209,17 +209,25 @@ static struct platform_device serial_device = {
209}; 209};
210#endif 210#endif
211 211
212#if defined(CONFIG_USB_ULPI) 212static int eukrea_cpuimx27_otg_init(struct platform_device *pdev)
213{
214 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
215}
216
213static struct mxc_usbh_platform_data otg_pdata __initdata = { 217static struct mxc_usbh_platform_data otg_pdata __initdata = {
218 .init = eukrea_cpuimx27_otg_init,
214 .portsc = MXC_EHCI_MODE_ULPI, 219 .portsc = MXC_EHCI_MODE_ULPI,
215 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
216}; 220};
217 221
222static int eukrea_cpuimx27_usbh2_init(struct platform_device *pdev)
223{
224 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
225}
226
218static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 227static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
228 .init = eukrea_cpuimx27_usbh2_init,
219 .portsc = MXC_EHCI_MODE_ULPI, 229 .portsc = MXC_EHCI_MODE_ULPI,
220 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
221}; 230};
222#endif
223 231
224static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 232static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
225 .operating_mode = FSL_USB2_DR_DEVICE, 233 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -273,21 +281,19 @@ static void __init eukrea_cpuimx27_init(void)
273 platform_device_register(&serial_device); 281 platform_device_register(&serial_device);
274#endif 282#endif
275 283
276#if defined(CONFIG_USB_ULPI)
277 if (otg_mode_host) { 284 if (otg_mode_host) {
278 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 285 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
279 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 286 ULPI_OTG_DRVVBUS_EXT);
280 287 if (otg_pdata.otg)
281 imx27_add_mxc_ehci_otg(&otg_pdata); 288 imx27_add_mxc_ehci_otg(&otg_pdata);
289 } else {
290 imx27_add_fsl_usb2_udc(&otg_device_pdata);
282 } 291 }
283 292
284 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 293 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
285 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 294 ULPI_OTG_DRVVBUS_EXT);
286 295 if (usbh2_pdata.otg)
287 imx27_add_mxc_ehci_hs(2, &usbh2_pdata); 296 imx27_add_mxc_ehci_hs(2, &usbh2_pdata);
288#endif
289 if (!otg_mode_host)
290 imx27_add_fsl_usb2_udc(&otg_device_pdata);
291 297
292#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD 298#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD
293 eukrea_mbimx27_baseboard_init(); 299 eukrea_mbimx27_baseboard_init();
@@ -304,9 +310,10 @@ static struct sys_timer eukrea_cpuimx27_timer = {
304}; 310};
305 311
306MACHINE_START(CPUIMX27, "EUKREA CPUIMX27") 312MACHINE_START(CPUIMX27, "EUKREA CPUIMX27")
307 .boot_params = MX27_PHYS_OFFSET + 0x100, 313 .boot_params = MX27_PHYS_OFFSET + 0x100,
308 .map_io = mx27_map_io, 314 .map_io = mx27_map_io,
309 .init_irq = mx27_init_irq, 315 .init_early = imx27_init_early,
310 .init_machine = eukrea_cpuimx27_init, 316 .init_irq = mx27_init_irq,
311 .timer = &eukrea_cpuimx27_timer, 317 .timer = &eukrea_cpuimx27_timer,
318 .init_machine = eukrea_cpuimx27_init,
312MACHINE_END 319MACHINE_END
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index eb395aba9237..9da8d18eeb00 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -84,15 +84,25 @@ static struct i2c_board_info eukrea_cpuimx25_i2c_devices[] = {
84 }, 84 },
85}; 85};
86 86
87static int eukrea_cpuimx25_otg_init(struct platform_device *pdev)
88{
89 return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
90}
91
87static const struct mxc_usbh_platform_data otg_pdata __initconst = { 92static const struct mxc_usbh_platform_data otg_pdata __initconst = {
93 .init = eukrea_cpuimx25_otg_init,
88 .portsc = MXC_EHCI_MODE_UTMI, 94 .portsc = MXC_EHCI_MODE_UTMI,
89 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
90}; 95};
91 96
97static int eukrea_cpuimx25_usbh2_init(struct platform_device *pdev)
98{
99 return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
100 MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN);
101}
102
92static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { 103static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
104 .init = eukrea_cpuimx25_usbh2_init,
93 .portsc = MXC_EHCI_MODE_SERIAL, 105 .portsc = MXC_EHCI_MODE_SERIAL,
94 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY |
95 MXC_EHCI_IPPUE_DOWN,
96}; 106};
97 107
98static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 108static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
@@ -153,9 +163,10 @@ static struct sys_timer eukrea_cpuimx25_timer = {
153 163
154MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25") 164MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25")
155 /* Maintainer: Eukrea Electromatique */ 165 /* Maintainer: Eukrea Electromatique */
156 .boot_params = MX25_PHYS_OFFSET + 0x100, 166 .boot_params = MX25_PHYS_OFFSET + 0x100,
157 .map_io = mx25_map_io, 167 .map_io = mx25_map_io,
158 .init_irq = mx25_init_irq, 168 .init_early = imx25_init_early,
159 .init_machine = eukrea_cpuimx25_init, 169 .init_irq = mx25_init_irq,
160 .timer = &eukrea_cpuimx25_timer, 170 .timer = &eukrea_cpuimx25_timer,
171 .init_machine = eukrea_cpuimx25_init,
161MACHINE_END 172MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 40a3666ea632..d7e0d219726a 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -30,6 +30,7 @@
30#include <linux/gpio_keys.h> 30#include <linux/gpio_keys.h>
31#include <linux/input.h> 31#include <linux/input.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/delay.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
35#include <asm/mach/time.h> 36#include <asm/mach/time.h>
@@ -66,6 +67,11 @@ static const int visstrim_m10_pins[] __initconst = {
66 PD15_AOUT_FEC_COL, 67 PD15_AOUT_FEC_COL,
67 PD16_AIN_FEC_TX_ER, 68 PD16_AIN_FEC_TX_ER,
68 PF23_AIN_FEC_TX_EN, 69 PF23_AIN_FEC_TX_EN,
70 /* SSI1 */
71 PC20_PF_SSI1_FS,
72 PC21_PF_SSI1_RXD,
73 PC22_PF_SSI1_TXD,
74 PC23_PF_SSI1_CLK,
69 /* SDHC1 */ 75 /* SDHC1 */
70 PE18_PF_SD1_D0, 76 PE18_PF_SD1_D0,
71 PE19_PF_SD1_D1, 77 PE19_PF_SD1_D1,
@@ -204,20 +210,30 @@ static struct i2c_board_info visstrim_m10_i2c_devices[] = {
204 I2C_BOARD_INFO("pca9555", 0x20), 210 I2C_BOARD_INFO("pca9555", 0x20),
205 .platform_data = &visstrim_m10_pca9555_pdata, 211 .platform_data = &visstrim_m10_pca9555_pdata,
206 }, 212 },
213 {
214 I2C_BOARD_INFO("tlv320aic32x4", 0x18),
215 }
207}; 216};
208 217
209/* USB OTG */ 218/* USB OTG */
210static int otg_phy_init(struct platform_device *pdev) 219static int otg_phy_init(struct platform_device *pdev)
211{ 220{
212 gpio_set_value(OTG_PHY_CS_GPIO, 0); 221 gpio_set_value(OTG_PHY_CS_GPIO, 0);
213 return 0; 222
223 mdelay(10);
224
225 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
214} 226}
215 227
216static const struct mxc_usbh_platform_data 228static const struct mxc_usbh_platform_data
217visstrim_m10_usbotg_pdata __initconst = { 229visstrim_m10_usbotg_pdata __initconst = {
218 .init = otg_phy_init, 230 .init = otg_phy_init,
219 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 231 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
220 .flags = MXC_EHCI_POWER_PINS_ENABLED, 232};
233
234/* SSI */
235static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
236 .flags = IMX_SSI_DMA | IMX_SSI_SYN,
221}; 237};
222 238
223static void __init visstrim_m10_board_init(void) 239static void __init visstrim_m10_board_init(void)
@@ -229,6 +245,7 @@ static void __init visstrim_m10_board_init(void)
229 if (ret) 245 if (ret)
230 pr_err("Failed to setup pins (%d)\n", ret); 246 pr_err("Failed to setup pins (%d)\n", ret);
231 247
248 imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata);
232 imx27_add_imx_uart0(&uart_pdata); 249 imx27_add_imx_uart0(&uart_pdata);
233 250
234 i2c_register_board_info(0, visstrim_m10_i2c_devices, 251 i2c_register_board_info(0, visstrim_m10_i2c_devices,
@@ -251,9 +268,10 @@ static struct sys_timer visstrim_m10_timer = {
251}; 268};
252 269
253MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") 270MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
254 .boot_params = MX27_PHYS_OFFSET + 0x100, 271 .boot_params = MX27_PHYS_OFFSET + 0x100,
255 .map_io = mx27_map_io, 272 .map_io = mx27_map_io,
256 .init_irq = mx27_init_irq, 273 .init_early = imx27_init_early,
257 .init_machine = visstrim_m10_board_init, 274 .init_irq = mx27_init_irq,
258 .timer = &visstrim_m10_timer, 275 .timer = &visstrim_m10_timer,
276 .init_machine = visstrim_m10_board_init,
259MACHINE_END 277MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
new file mode 100644
index 000000000000..9be6cd6fbf8c
--- /dev/null
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * Author: Fabio Estevam <fabio.estevam@freescale.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <asm/mach/time.h>
20#include <mach/hardware.h>
21#include <mach/common.h>
22#include <mach/iomux-mx27.h>
23
24#include "devices-imx27.h"
25
26static const int mx27ipcam_pins[] __initconst = {
27 /* UART1 */
28 PE12_PF_UART1_TXD,
29 PE13_PF_UART1_RXD,
30 /* FEC */
31 PD0_AIN_FEC_TXD0,
32 PD1_AIN_FEC_TXD1,
33 PD2_AIN_FEC_TXD2,
34 PD3_AIN_FEC_TXD3,
35 PD4_AOUT_FEC_RX_ER,
36 PD5_AOUT_FEC_RXD1,
37 PD6_AOUT_FEC_RXD2,
38 PD7_AOUT_FEC_RXD3,
39 PD8_AF_FEC_MDIO,
40 PD9_AIN_FEC_MDC,
41 PD10_AOUT_FEC_CRS,
42 PD11_AOUT_FEC_TX_CLK,
43 PD12_AOUT_FEC_RXD0,
44 PD13_AOUT_FEC_RX_DV,
45 PD14_AOUT_FEC_RX_CLK,
46 PD15_AOUT_FEC_COL,
47 PD16_AIN_FEC_TX_ER,
48 PF23_AIN_FEC_TX_EN,
49};
50
51static void __init mx27ipcam_init(void)
52{
53 mxc_gpio_setup_multiple_pins(mx27ipcam_pins, ARRAY_SIZE(mx27ipcam_pins),
54 "mx27ipcam");
55
56 imx27_add_imx_uart0(NULL);
57 imx27_add_fec(NULL);
58 imx27_add_imx2_wdt(NULL);
59}
60
61static void __init mx27ipcam_timer_init(void)
62{
63 mx27_clocks_init(25000000);
64}
65
66static struct sys_timer mx27ipcam_timer = {
67 .init = mx27ipcam_timer_init,
68};
69
70MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
71 /* maintainer: Freescale Semiconductor, Inc. */
72 .boot_params = MX27_PHYS_OFFSET + 0x100,
73 .map_io = mx27_map_io,
74 .init_early = imx27_init_early,
75 .init_irq = mx27_init_irq,
76 .timer = &mx27ipcam_timer,
77 .init_machine = mx27ipcam_init,
78MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index 3a1202e47212..841140516ede 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -75,9 +75,10 @@ static struct sys_timer mx27lite_timer = {
75}; 75};
76 76
77MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") 77MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
78 .boot_params = MX27_PHYS_OFFSET + 0x100, 78 .boot_params = MX27_PHYS_OFFSET + 0x100,
79 .map_io = mx27_map_io, 79 .map_io = mx27_map_io,
80 .init_irq = mx27_init_irq, 80 .init_early = imx27_init_early,
81 .init_machine = mx27lite_init, 81 .init_irq = mx27_init_irq,
82 .timer = &mx27lite_timer, 82 .timer = &mx27lite_timer,
83 .init_machine = mx27lite_init,
83MACHINE_END 84MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 1f446e5eb636..47cf56ac6d5b 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -144,17 +144,19 @@ struct sys_timer mx1ads_timer = {
144 144
145MACHINE_START(MX1ADS, "Freescale MX1ADS") 145MACHINE_START(MX1ADS, "Freescale MX1ADS")
146 /* Maintainer: Sascha Hauer, Pengutronix */ 146 /* Maintainer: Sascha Hauer, Pengutronix */
147 .boot_params = MX1_PHYS_OFFSET + 0x100, 147 .boot_params = MX1_PHYS_OFFSET + 0x100,
148 .map_io = mx1_map_io, 148 .map_io = mx1_map_io,
149 .init_irq = mx1_init_irq, 149 .init_early = imx1_init_early,
150 .timer = &mx1ads_timer, 150 .init_irq = mx1_init_irq,
151 .init_machine = mx1ads_init, 151 .timer = &mx1ads_timer,
152 .init_machine = mx1ads_init,
152MACHINE_END 153MACHINE_END
153 154
154MACHINE_START(MXLADS, "Freescale MXLADS") 155MACHINE_START(MXLADS, "Freescale MXLADS")
155 .boot_params = MX1_PHYS_OFFSET + 0x100, 156 .boot_params = MX1_PHYS_OFFSET + 0x100,
156 .map_io = mx1_map_io, 157 .map_io = mx1_map_io,
157 .init_irq = mx1_init_irq, 158 .init_early = imx1_init_early,
158 .timer = &mx1ads_timer, 159 .init_irq = mx1_init_irq,
159 .init_machine = mx1ads_init, 160 .timer = &mx1ads_timer,
161 .init_machine = mx1ads_init,
160MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 0a372577c2ac..fa52a1086eae 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -304,9 +304,10 @@ static struct sys_timer mx21ads_timer = {
304 304
305MACHINE_START(MX21ADS, "Freescale i.MX21ADS") 305MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
306 /* maintainer: Freescale Semiconductor, Inc. */ 306 /* maintainer: Freescale Semiconductor, Inc. */
307 .boot_params = MX21_PHYS_OFFSET + 0x100, 307 .boot_params = MX21_PHYS_OFFSET + 0x100,
308 .map_io = mx21ads_map_io, 308 .map_io = mx21ads_map_io,
309 .init_irq = mx21_init_irq, 309 .init_early = imx21_init_early,
310 .init_machine = mx21ads_board_init, 310 .init_irq = mx21_init_irq,
311 .timer = &mx21ads_timer, 311 .timer = &mx21ads_timer,
312 .init_machine = mx21ads_board_init,
312MACHINE_END 313MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index 8382e7902078..06da438282aa 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -103,14 +103,18 @@ static iomux_v3_cfg_t mx25pdk_pads[] = {
103 MX25_PAD_SD1_DATA1__SD1_DATA1, 103 MX25_PAD_SD1_DATA1__SD1_DATA1,
104 MX25_PAD_SD1_DATA2__SD1_DATA2, 104 MX25_PAD_SD1_DATA2__SD1_DATA2,
105 MX25_PAD_SD1_DATA3__SD1_DATA3, 105 MX25_PAD_SD1_DATA3__SD1_DATA3,
106
107 /* I2C1 */
108 MX25_PAD_I2C1_CLK__I2C1_CLK,
109 MX25_PAD_I2C1_DAT__I2C1_DAT,
106}; 110};
107 111
108static const struct fec_platform_data mx25_fec_pdata __initconst = { 112static const struct fec_platform_data mx25_fec_pdata __initconst = {
109 .phy = PHY_INTERFACE_MODE_RMII, 113 .phy = PHY_INTERFACE_MODE_RMII,
110}; 114};
111 115
112#define FEC_ENABLE_GPIO 35 116#define FEC_ENABLE_GPIO IMX_GPIO_NR(2, 3)
113#define FEC_RESET_B_GPIO 104 117#define FEC_RESET_B_GPIO IMX_GPIO_NR(4, 8)
114 118
115static void __init mx25pdk_fec_reset(void) 119static void __init mx25pdk_fec_reset(void)
116{ 120{
@@ -185,9 +189,14 @@ static const struct matrix_keymap_data mx25pdk_keymap_data __initconst = {
185 .keymap_size = ARRAY_SIZE(mx25pdk_keymap), 189 .keymap_size = ARRAY_SIZE(mx25pdk_keymap),
186}; 190};
187 191
192static int mx25pdk_usbh2_init(struct platform_device *pdev)
193{
194 return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
195}
196
188static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { 197static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
198 .init = mx25pdk_usbh2_init,
189 .portsc = MXC_EHCI_MODE_SERIAL, 199 .portsc = MXC_EHCI_MODE_SERIAL,
190 .flags = MXC_EHCI_INTERNAL_PHY,
191}; 200};
192 201
193static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 202static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
@@ -195,6 +204,10 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
195 .phy_mode = FSL_USB2_PHY_UTMI, 204 .phy_mode = FSL_USB2_PHY_UTMI,
196}; 205};
197 206
207static const struct imxi2c_platform_data mx25_3ds_i2c0_data __initconst = {
208 .bitrate = 100000,
209};
210
198static void __init mx25pdk_init(void) 211static void __init mx25pdk_init(void)
199{ 212{
200 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, 213 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
@@ -213,6 +226,7 @@ static void __init mx25pdk_init(void)
213 imx25_add_imx_keypad(&mx25pdk_keymap_data); 226 imx25_add_imx_keypad(&mx25pdk_keymap_data);
214 227
215 imx25_add_sdhci_esdhc_imx(0, NULL); 228 imx25_add_sdhci_esdhc_imx(0, NULL);
229 imx25_add_imx_i2c0(&mx25_3ds_i2c0_data);
216} 230}
217 231
218static void __init mx25pdk_timer_init(void) 232static void __init mx25pdk_timer_init(void)
@@ -226,10 +240,10 @@ static struct sys_timer mx25pdk_timer = {
226 240
227MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") 241MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
228 /* Maintainer: Freescale Semiconductor, Inc. */ 242 /* Maintainer: Freescale Semiconductor, Inc. */
229 .boot_params = MX25_PHYS_OFFSET + 0x100, 243 .boot_params = MX25_PHYS_OFFSET + 0x100,
230 .map_io = mx25_map_io, 244 .map_io = mx25_map_io,
231 .init_irq = mx25_init_irq, 245 .init_early = imx25_init_early,
232 .init_machine = mx25pdk_init, 246 .init_irq = mx25_init_irq,
233 .timer = &mx25pdk_timer, 247 .timer = &mx25pdk_timer,
248 .init_machine = mx25pdk_init,
234MACHINE_END 249MACHINE_END
235
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 164331518bdd..614b3c00c4a0 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -98,6 +98,9 @@ static const int mx27pdk_pins[] __initconst = {
98 PD22_PF_CSPI2_SCLK, 98 PD22_PF_CSPI2_SCLK,
99 PD23_PF_CSPI2_MISO, 99 PD23_PF_CSPI2_MISO,
100 PD24_PF_CSPI2_MOSI, 100 PD24_PF_CSPI2_MOSI,
101 /* I2C1 */
102 PD17_PF_I2C_DATA,
103 PD18_PF_I2C_CLK,
101}; 104};
102 105
103static const struct imxuart_platform_data uart_pdata __initconst = { 106static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -159,13 +162,15 @@ static int otg_phy_init(void)
159 return 0; 162 return 0;
160} 163}
161 164
162#if defined(CONFIG_USB_ULPI) 165static int mx27_3ds_otg_init(struct platform_device *pdev)
166{
167 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
168}
163 169
164static struct mxc_usbh_platform_data otg_pdata __initdata = { 170static struct mxc_usbh_platform_data otg_pdata __initdata = {
171 .init = mx27_3ds_otg_init,
165 .portsc = MXC_EHCI_MODE_ULPI, 172 .portsc = MXC_EHCI_MODE_ULPI,
166 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
167}; 173};
168#endif
169 174
170static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 175static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
171 .operating_mode = FSL_USB2_DR_DEVICE, 176 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -216,7 +221,7 @@ static struct regulator_init_data vgen_init = {
216 .consumer_supplies = vgen_consumers, 221 .consumer_supplies = vgen_consumers,
217}; 222};
218 223
219static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { 224static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
220 { 225 {
221 .id = MC13783_REG_VMMC1, 226 .id = MC13783_REG_VMMC1,
222 .init_data = &vmmc1_init, 227 .init_data = &vmmc1_init,
@@ -227,10 +232,10 @@ static struct mc13783_regulator_init_data mx27_3ds_regulators[] = {
227}; 232};
228 233
229/* MC13783 */ 234/* MC13783 */
230static struct mc13783_platform_data mc13783_pdata __initdata = { 235static struct mc13xxx_platform_data mc13783_pdata __initdata = {
231 .regulators = mx27_3ds_regulators, 236 .regulators = mx27_3ds_regulators,
232 .num_regulators = ARRAY_SIZE(mx27_3ds_regulators), 237 .num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
233 .flags = MC13783_USE_REGULATOR, 238 .flags = MC13XXX_USE_REGULATOR,
234}; 239};
235 240
236/* SPI */ 241/* SPI */
@@ -253,6 +258,9 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
253 }, 258 },
254}; 259};
255 260
261static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
262 .bitrate = 100000,
263};
256 264
257static void __init mx27pdk_init(void) 265static void __init mx27pdk_init(void)
258{ 266{
@@ -265,14 +273,15 @@ static void __init mx27pdk_init(void)
265 imx27_add_mxc_mmc(0, &sdhc1_pdata); 273 imx27_add_mxc_mmc(0, &sdhc1_pdata);
266 imx27_add_imx2_wdt(NULL); 274 imx27_add_imx2_wdt(NULL);
267 otg_phy_init(); 275 otg_phy_init();
268#if defined(CONFIG_USB_ULPI) 276
269 if (otg_mode_host) { 277 if (otg_mode_host) {
270 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 278 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
271 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 279 ULPI_OTG_DRVVBUS_EXT);
272 280
273 imx27_add_mxc_ehci_otg(&otg_pdata); 281 if (otg_pdata.otg)
282 imx27_add_mxc_ehci_otg(&otg_pdata);
274 } 283 }
275#endif 284
276 if (!otg_mode_host) 285 if (!otg_mode_host)
277 imx27_add_fsl_usb2_udc(&otg_device_pdata); 286 imx27_add_fsl_usb2_udc(&otg_device_pdata);
278 287
@@ -282,6 +291,7 @@ static void __init mx27pdk_init(void)
282 291
283 if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 292 if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT))
284 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); 293 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
294 imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
285} 295}
286 296
287static void __init mx27pdk_timer_init(void) 297static void __init mx27pdk_timer_init(void)
@@ -295,9 +305,10 @@ static struct sys_timer mx27pdk_timer = {
295 305
296MACHINE_START(MX27_3DS, "Freescale MX27PDK") 306MACHINE_START(MX27_3DS, "Freescale MX27PDK")
297 /* maintainer: Freescale Semiconductor, Inc. */ 307 /* maintainer: Freescale Semiconductor, Inc. */
298 .boot_params = MX27_PHYS_OFFSET + 0x100, 308 .boot_params = MX27_PHYS_OFFSET + 0x100,
299 .map_io = mx27_map_io, 309 .map_io = mx27_map_io,
300 .init_irq = mx27_init_irq, 310 .init_early = imx27_init_early,
301 .init_machine = mx27pdk_init, 311 .init_irq = mx27_init_irq,
302 .timer = &mx27pdk_timer, 312 .timer = &mx27pdk_timer,
313 .init_machine = mx27pdk_init,
303MACHINE_END 314MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index b832f960fec4..367d1e4384c7 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -344,9 +344,10 @@ static void __init mx27ads_map_io(void)
344 344
345MACHINE_START(MX27ADS, "Freescale i.MX27ADS") 345MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
346 /* maintainer: Freescale Semiconductor, Inc. */ 346 /* maintainer: Freescale Semiconductor, Inc. */
347 .boot_params = MX27_PHYS_OFFSET + 0x100, 347 .boot_params = MX27_PHYS_OFFSET + 0x100,
348 .map_io = mx27ads_map_io, 348 .map_io = mx27ads_map_io,
349 .init_irq = mx27_init_irq, 349 .init_early = imx27_init_early,
350 .init_machine = mx27ads_board_init, 350 .init_irq = mx27_init_irq,
351 .timer = &mx27ads_timer, 351 .timer = &mx27ads_timer,
352 .init_machine = mx27ads_board_init,
352MACHINE_END 353MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 4ce71b0401db..69787c30c320 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -266,10 +266,10 @@ static struct sys_timer mxt_td60_timer = {
266 266
267MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") 267MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
268 /* maintainer: Maxtrack Industrial */ 268 /* maintainer: Maxtrack Industrial */
269 .boot_params = MX27_PHYS_OFFSET + 0x100, 269 .boot_params = MX27_PHYS_OFFSET + 0x100,
270 .map_io = mx27_map_io, 270 .map_io = mx27_map_io,
271 .init_irq = mx27_init_irq, 271 .init_early = imx27_init_early,
272 .init_machine = mxt_td60_board_init, 272 .init_irq = mx27_init_irq,
273 .timer = &mxt_td60_timer, 273 .timer = &mxt_td60_timer,
274 .init_machine = mxt_td60_board_init,
274MACHINE_END 275MACHINE_END
275
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index cccc0a0a9c72..63e182556778 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -187,7 +187,6 @@ static struct i2c_board_info pca100_i2c_devices[] = {
187 } 187 }
188}; 188};
189 189
190#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
191static struct spi_eeprom at25320 = { 190static struct spi_eeprom at25320 = {
192 .name = "at25320an", 191 .name = "at25320an",
193 .byte_len = 4096, 192 .byte_len = 4096,
@@ -211,7 +210,6 @@ static const struct spi_imx_master pca100_spi0_data __initconst = {
211 .chipselect = pca100_spi_cs, 210 .chipselect = pca100_spi_cs,
212 .num_chipselect = ARRAY_SIZE(pca100_spi_cs), 211 .num_chipselect = ARRAY_SIZE(pca100_spi_cs),
213}; 212};
214#endif
215 213
216static void pca100_ac97_warm_reset(struct snd_ac97 *ac97) 214static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
217{ 215{
@@ -269,31 +267,33 @@ static const struct imxmmc_platform_data sdhc_pdata __initconst = {
269 .exit = pca100_sdhc2_exit, 267 .exit = pca100_sdhc2_exit,
270}; 268};
271 269
272#if defined(CONFIG_USB_ULPI)
273static int otg_phy_init(struct platform_device *pdev) 270static int otg_phy_init(struct platform_device *pdev)
274{ 271{
275 gpio_set_value(OTG_PHY_CS_GPIO, 0); 272 gpio_set_value(OTG_PHY_CS_GPIO, 0);
276 return 0; 273
274 mdelay(10);
275
276 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
277} 277}
278 278
279static struct mxc_usbh_platform_data otg_pdata __initdata = { 279static struct mxc_usbh_platform_data otg_pdata __initdata = {
280 .init = otg_phy_init, 280 .init = otg_phy_init,
281 .portsc = MXC_EHCI_MODE_ULPI, 281 .portsc = MXC_EHCI_MODE_ULPI,
282 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
283}; 282};
284 283
285static int usbh2_phy_init(struct platform_device *pdev) 284static int usbh2_phy_init(struct platform_device *pdev)
286{ 285{
287 gpio_set_value(USBH2_PHY_CS_GPIO, 0); 286 gpio_set_value(USBH2_PHY_CS_GPIO, 0);
288 return 0; 287
288 mdelay(10);
289
290 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
289} 291}
290 292
291static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 293static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
292 .init = usbh2_phy_init, 294 .init = usbh2_phy_init,
293 .portsc = MXC_EHCI_MODE_ULPI, 295 .portsc = MXC_EHCI_MODE_ULPI,
294 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
295}; 296};
296#endif
297 297
298static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 298static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
299 .operating_mode = FSL_USB2_DR_DEVICE, 299 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -389,36 +389,33 @@ static void __init pca100_init(void)
389 389
390 imx27_add_imx_i2c(1, &pca100_i2c1_data); 390 imx27_add_imx_i2c(1, &pca100_i2c1_data);
391 391
392#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
393 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN); 392 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN);
394 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN); 393 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN);
395 spi_register_board_info(pca100_spi_board_info, 394 spi_register_board_info(pca100_spi_board_info,
396 ARRAY_SIZE(pca100_spi_board_info)); 395 ARRAY_SIZE(pca100_spi_board_info));
397 imx27_add_spi_imx0(&pca100_spi0_data); 396 imx27_add_spi_imx0(&pca100_spi0_data);
398#endif
399 397
400 gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs"); 398 gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs");
401 gpio_direction_output(OTG_PHY_CS_GPIO, 1); 399 gpio_direction_output(OTG_PHY_CS_GPIO, 1);
402 gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs"); 400 gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs");
403 gpio_direction_output(USBH2_PHY_CS_GPIO, 1); 401 gpio_direction_output(USBH2_PHY_CS_GPIO, 1);
404 402
405#if defined(CONFIG_USB_ULPI)
406 if (otg_mode_host) { 403 if (otg_mode_host) {
407 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 404 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
408 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 405 ULPI_OTG_DRVVBUS_EXT);
409 406
410 imx27_add_mxc_ehci_otg(&otg_pdata); 407 if (otg_pdata.otg)
408 imx27_add_mxc_ehci_otg(&otg_pdata);
409 } else {
410 gpio_set_value(OTG_PHY_CS_GPIO, 0);
411 imx27_add_fsl_usb2_udc(&otg_device_pdata);
411 } 412 }
412 413
413 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 414 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
414 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 415 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
415 416
416 imx27_add_mxc_ehci_hs(2, &usbh2_pdata); 417 if (usbh2_pdata.otg)
417#endif 418 imx27_add_mxc_ehci_hs(2, &usbh2_pdata);
418 if (!otg_mode_host) {
419 gpio_set_value(OTG_PHY_CS_GPIO, 0);
420 imx27_add_fsl_usb2_udc(&otg_device_pdata);
421 }
422 419
423 imx27_add_imx_fb(&pca100_fb_data); 420 imx27_add_imx_fb(&pca100_fb_data);
424 421
@@ -437,10 +434,10 @@ static struct sys_timer pca100_timer = {
437}; 434};
438 435
439MACHINE_START(PCA100, "phyCARD-i.MX27") 436MACHINE_START(PCA100, "phyCARD-i.MX27")
440 .boot_params = MX27_PHYS_OFFSET + 0x100, 437 .boot_params = MX27_PHYS_OFFSET + 0x100,
441 .map_io = mx27_map_io, 438 .map_io = mx27_map_io,
442 .init_irq = mx27_init_irq, 439 .init_early = imx27_init_early,
443 .init_machine = pca100_init, 440 .init_irq = mx27_init_irq,
444 .timer = &pca100_timer, 441 .init_machine = pca100_init,
442 .timer = &pca100_timer,
445MACHINE_END 443MACHINE_END
446
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 505614803bc6..38c77084b615 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -252,7 +252,7 @@ static struct regulator_init_data cam_data = {
252 .consumer_supplies = cam_consumers, 252 .consumer_supplies = cam_consumers,
253}; 253};
254 254
255static struct mc13783_regulator_init_data pcm038_regulators[] = { 255static struct mc13xxx_regulator_init_data pcm038_regulators[] = {
256 { 256 {
257 .id = MC13783_REG_VCAM, 257 .id = MC13783_REG_VCAM,
258 .init_data = &cam_data, 258 .init_data = &cam_data,
@@ -262,11 +262,11 @@ static struct mc13783_regulator_init_data pcm038_regulators[] = {
262 }, 262 },
263}; 263};
264 264
265static struct mc13783_platform_data pcm038_pmic = { 265static struct mc13xxx_platform_data pcm038_pmic = {
266 .regulators = pcm038_regulators, 266 .regulators = pcm038_regulators,
267 .num_regulators = ARRAY_SIZE(pcm038_regulators), 267 .num_regulators = ARRAY_SIZE(pcm038_regulators),
268 .flags = MC13783_USE_ADC | MC13783_USE_REGULATOR | 268 .flags = MC13XXX_USE_ADC | MC13XXX_USE_REGULATOR |
269 MC13783_USE_TOUCHSCREEN, 269 MC13XXX_USE_TOUCHSCREEN,
270}; 270};
271 271
272static struct spi_board_info pcm038_spi_board_info[] __initdata = { 272static struct spi_board_info pcm038_spi_board_info[] __initdata = {
@@ -281,9 +281,15 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = {
281 } 281 }
282}; 282};
283 283
284static int pcm038_usbh2_init(struct platform_device *pdev)
285{
286 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
287 MXC_EHCI_INTERFACE_DIFF_UNI);
288}
289
284static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { 290static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
291 .init = pcm038_usbh2_init,
285 .portsc = MXC_EHCI_MODE_ULPI, 292 .portsc = MXC_EHCI_MODE_ULPI,
286 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI,
287}; 293};
288 294
289static void __init pcm038_init(void) 295static void __init pcm038_init(void)
@@ -340,9 +346,10 @@ static struct sys_timer pcm038_timer = {
340}; 346};
341 347
342MACHINE_START(PCM038, "phyCORE-i.MX27") 348MACHINE_START(PCM038, "phyCORE-i.MX27")
343 .boot_params = MX27_PHYS_OFFSET + 0x100, 349 .boot_params = MX27_PHYS_OFFSET + 0x100,
344 .map_io = mx27_map_io, 350 .map_io = mx27_map_io,
345 .init_irq = mx27_init_irq, 351 .init_early = imx27_init_early,
346 .init_machine = pcm038_init, 352 .init_irq = mx27_init_irq,
347 .timer = &pcm038_timer, 353 .timer = &pcm038_timer,
354 .init_machine = pcm038_init,
348MACHINE_END 355MACHINE_END
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index eae878f306c6..dcaee043628e 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -145,10 +145,11 @@ static struct sys_timer scb9328_timer = {
145}; 145};
146 146
147MACHINE_START(SCB9328, "Synertronixx scb9328") 147MACHINE_START(SCB9328, "Synertronixx scb9328")
148 /* Sascha Hauer */ 148 /* Sascha Hauer */
149 .boot_params = 0x08000100, 149 .boot_params = 0x08000100,
150 .map_io = mx1_map_io, 150 .map_io = mx1_map_io,
151 .init_irq = mx1_init_irq, 151 .init_early = imx1_init_early,
152 .timer = &scb9328_timer, 152 .init_irq = mx1_init_irq,
153 .init_machine = scb9328_init, 153 .timer = &scb9328_timer,
154 .init_machine = scb9328_init,
154MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 729ae0915af8..2e482ba5a0e7 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -23,6 +23,9 @@
23 23
24#include <mach/common.h> 24#include <mach/common.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/gpio.h>
27#include <mach/irqs.h>
28#include <mach/iomux-v1.h>
26 29
27static struct map_desc imx_io_desc[] __initdata = { 30static struct map_desc imx_io_desc[] __initdata = {
28 imx_map_entry(MX1, IO, MT_DEVICE), 31 imx_map_entry(MX1, IO, MT_DEVICE),
@@ -30,16 +33,26 @@ static struct map_desc imx_io_desc[] __initdata = {
30 33
31void __init mx1_map_io(void) 34void __init mx1_map_io(void)
32{ 35{
36 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
37}
38
39void __init imx1_init_early(void)
40{
33 mxc_set_cpu_type(MXC_CPU_MX1); 41 mxc_set_cpu_type(MXC_CPU_MX1);
34 mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); 42 mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
35 43 imx_iomuxv1_init(MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR),
36 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc)); 44 MX1_NUM_GPIO_PORT);
37} 45}
38 46
39int imx1_register_gpios(void); 47static struct mxc_gpio_port imx1_gpio_ports[] = {
48 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 0, 1, MX1_GPIO_INT_PORTA),
49 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 1, 2, MX1_GPIO_INT_PORTB),
50 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 2, 3, MX1_GPIO_INT_PORTC),
51 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 3, 4, MX1_GPIO_INT_PORTD),
52};
40 53
41void __init mx1_init_irq(void) 54void __init mx1_init_irq(void)
42{ 55{
43 mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR)); 56 mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR));
44 imx1_register_gpios(); 57 mxc_gpio_init(imx1_gpio_ports, ARRAY_SIZE(imx1_gpio_ports));
45} 58}
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index e728af81d1b1..7a0c500ac2c8 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -24,6 +24,9 @@
24#include <mach/common.h> 24#include <mach/common.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/gpio.h>
28#include <mach/irqs.h>
29#include <mach/iomux-v1.h>
27 30
28/* MX21 memory map definition */ 31/* MX21 memory map definition */
29static struct map_desc imx21_io_desc[] __initdata = { 32static struct map_desc imx21_io_desc[] __initdata = {
@@ -56,16 +59,28 @@ static struct map_desc imx21_io_desc[] __initdata = {
56 */ 59 */
57void __init mx21_map_io(void) 60void __init mx21_map_io(void)
58{ 61{
62 iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc));
63}
64
65void __init imx21_init_early(void)
66{
59 mxc_set_cpu_type(MXC_CPU_MX21); 67 mxc_set_cpu_type(MXC_CPU_MX21);
60 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR)); 68 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR));
61 69 imx_iomuxv1_init(MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR),
62 iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc)); 70 MX21_NUM_GPIO_PORT);
63} 71}
64 72
65int imx21_register_gpios(void); 73static struct mxc_gpio_port imx21_gpio_ports[] = {
74 DEFINE_IMX_GPIO_PORT_IRQ(MX21, 0, 1, MX21_INT_GPIO),
75 DEFINE_IMX_GPIO_PORT(MX21, 1, 2),
76 DEFINE_IMX_GPIO_PORT(MX21, 2, 3),
77 DEFINE_IMX_GPIO_PORT(MX21, 3, 4),
78 DEFINE_IMX_GPIO_PORT(MX21, 4, 5),
79 DEFINE_IMX_GPIO_PORT(MX21, 5, 6),
80};
66 81
67void __init mx21_init_irq(void) 82void __init mx21_init_irq(void)
68{ 83{
69 mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR)); 84 mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR));
70 imx21_register_gpios(); 85 mxc_gpio_init(imx21_gpio_ports, ARRAY_SIZE(imx21_gpio_ports));
71} 86}
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index 2edec6ce8fe7..02f7b5c7fa8e 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -27,6 +27,8 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/mx25.h> 28#include <mach/mx25.h>
29#include <mach/iomux-v3.h> 29#include <mach/iomux-v3.h>
30#include <mach/gpio.h>
31#include <mach/irqs.h>
30 32
31/* 33/*
32 * This table defines static virtual address mappings for I/O regions. 34 * This table defines static virtual address mappings for I/O regions.
@@ -45,18 +47,26 @@ static struct map_desc mx25_io_desc[] __initdata = {
45 */ 47 */
46void __init mx25_map_io(void) 48void __init mx25_map_io(void)
47{ 49{
50 iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
51}
52
53void __init imx25_init_early(void)
54{
48 mxc_set_cpu_type(MXC_CPU_MX25); 55 mxc_set_cpu_type(MXC_CPU_MX25);
49 mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR)); 56 mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR));
50 mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR)); 57 mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR));
51
52 iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
53} 58}
54 59
55int imx25_register_gpios(void); 60static struct mxc_gpio_port imx25_gpio_ports[] = {
61 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 0, 1, MX25_INT_GPIO1),
62 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 1, 2, MX25_INT_GPIO2),
63 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 2, 3, MX25_INT_GPIO3),
64 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 3, 4, MX25_INT_GPIO4),
65};
56 66
57void __init mx25_init_irq(void) 67void __init mx25_init_irq(void)
58{ 68{
59 mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR)); 69 mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR));
60 imx25_register_gpios(); 70 mxc_gpio_init(imx25_gpio_ports, ARRAY_SIZE(imx25_gpio_ports));
61} 71}
62 72
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 374e48b7a412..a6761a39f08c 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -24,6 +24,9 @@
24#include <mach/common.h> 24#include <mach/common.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/gpio.h>
28#include <mach/irqs.h>
29#include <mach/iomux-v1.h>
27 30
28/* MX27 memory map definition */ 31/* MX27 memory map definition */
29static struct map_desc imx27_io_desc[] __initdata = { 32static struct map_desc imx27_io_desc[] __initdata = {
@@ -56,16 +59,28 @@ static struct map_desc imx27_io_desc[] __initdata = {
56 */ 59 */
57void __init mx27_map_io(void) 60void __init mx27_map_io(void)
58{ 61{
62 iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc));
63}
64
65void __init imx27_init_early(void)
66{
59 mxc_set_cpu_type(MXC_CPU_MX27); 67 mxc_set_cpu_type(MXC_CPU_MX27);
60 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR)); 68 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR));
61 69 imx_iomuxv1_init(MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR),
62 iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc)); 70 MX27_NUM_GPIO_PORT);
63} 71}
64 72
65int imx27_register_gpios(void); 73static struct mxc_gpio_port imx27_gpio_ports[] = {
74 DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, 1, MX27_INT_GPIO),
75 DEFINE_IMX_GPIO_PORT(MX27, 1, 2),
76 DEFINE_IMX_GPIO_PORT(MX27, 2, 3),
77 DEFINE_IMX_GPIO_PORT(MX27, 3, 4),
78 DEFINE_IMX_GPIO_PORT(MX27, 4, 5),
79 DEFINE_IMX_GPIO_PORT(MX27, 5, 6),
80};
66 81
67void __init mx27_init_irq(void) 82void __init mx27_init_irq(void)
68{ 83{
69 mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR)); 84 mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR));
70 imx27_register_gpios(); 85 mxc_gpio_init(imx27_gpio_ports, ARRAY_SIZE(imx27_gpio_ports));
71} 86}