diff options
Diffstat (limited to 'arch/arm/mach-mx3/mach-mx31lilly.c')
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31lilly.c | 95 |
1 files changed, 21 insertions, 74 deletions
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c index 2c595483f356..ed95745163b8 100644 --- a/arch/arm/mach-mx3/mach-mx31lilly.c +++ b/arch/arm/mach-mx3/mach-mx31lilly.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/delay.h> | ||
27 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
29 | #include <linux/smsc911x.h> | 30 | #include <linux/smsc911x.h> |
@@ -110,55 +111,9 @@ static struct platform_device physmap_flash_device = { | |||
110 | 111 | ||
111 | /* USB */ | 112 | /* USB */ |
112 | 113 | ||
113 | #if defined(CONFIG_USB_ULPI) | ||
114 | |||
115 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ | 114 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ |
116 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | 115 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
117 | 116 | ||
118 | static int usbotg_init(struct platform_device *pdev) | ||
119 | { | ||
120 | unsigned int pins[] = { | ||
121 | MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, | ||
122 | MX31_PIN_USBOTG_DATA1__USBOTG_DATA1, | ||
123 | MX31_PIN_USBOTG_DATA2__USBOTG_DATA2, | ||
124 | MX31_PIN_USBOTG_DATA3__USBOTG_DATA3, | ||
125 | MX31_PIN_USBOTG_DATA4__USBOTG_DATA4, | ||
126 | MX31_PIN_USBOTG_DATA5__USBOTG_DATA5, | ||
127 | MX31_PIN_USBOTG_DATA6__USBOTG_DATA6, | ||
128 | MX31_PIN_USBOTG_DATA7__USBOTG_DATA7, | ||
129 | MX31_PIN_USBOTG_CLK__USBOTG_CLK, | ||
130 | MX31_PIN_USBOTG_DIR__USBOTG_DIR, | ||
131 | MX31_PIN_USBOTG_NXT__USBOTG_NXT, | ||
132 | MX31_PIN_USBOTG_STP__USBOTG_STP, | ||
133 | }; | ||
134 | |||
135 | mxc_iomux_setup_multiple_pins(pins, ARRAY_SIZE(pins), "USB OTG"); | ||
136 | |||
137 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); | ||
138 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); | ||
139 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); | ||
140 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG); | ||
141 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG); | ||
142 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG); | ||
143 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG); | ||
144 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG); | ||
145 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG); | ||
146 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG); | ||
147 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); | ||
148 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); | ||
149 | |||
150 | mxc_iomux_set_gpr(MUX_PGP_USB_4WIRE, true); | ||
151 | mxc_iomux_set_gpr(MUX_PGP_USB_COMMON, true); | ||
152 | |||
153 | /* chip select */ | ||
154 | mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE2, IOMUX_CONFIG_GPIO), | ||
155 | "USBOTG_CS"); | ||
156 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), "USBH1 CS"); | ||
157 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), 0); | ||
158 | |||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static int usbh1_init(struct platform_device *pdev) | 117 | static int usbh1_init(struct platform_device *pdev) |
163 | { | 118 | { |
164 | int pins[] = { | 119 | int pins[] = { |
@@ -183,7 +138,10 @@ static int usbh1_init(struct platform_device *pdev) | |||
183 | 138 | ||
184 | mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true); | 139 | mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true); |
185 | 140 | ||
186 | return 0; | 141 | mdelay(10); |
142 | |||
143 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | | ||
144 | MXC_EHCI_INTERFACE_SINGLE_UNI); | ||
187 | } | 145 | } |
188 | 146 | ||
189 | static int usbh2_init(struct platform_device *pdev) | 147 | static int usbh2_init(struct platform_device *pdev) |
@@ -220,41 +178,30 @@ static int usbh2_init(struct platform_device *pdev) | |||
220 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); | 178 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); |
221 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); | 179 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); |
222 | 180 | ||
223 | return 0; | 181 | mdelay(10); |
224 | } | ||
225 | 182 | ||
226 | static struct mxc_usbh_platform_data usbotg_pdata = { | 183 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); |
227 | .init = usbotg_init, | 184 | } |
228 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | ||
229 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
230 | }; | ||
231 | 185 | ||
232 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { | 186 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
233 | .init = usbh1_init, | 187 | .init = usbh1_init, |
234 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 188 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
235 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | ||
236 | }; | 189 | }; |
237 | 190 | ||
238 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 191 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
239 | .init = usbh2_init, | 192 | .init = usbh2_init, |
240 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 193 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
241 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
242 | }; | 194 | }; |
243 | 195 | ||
244 | static void lilly1131_usb_init(void) | 196 | static void lilly1131_usb_init(void) |
245 | { | 197 | { |
246 | usbotg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
247 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
248 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
249 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
250 | |||
251 | imx31_add_mxc_ehci_hs(1, &usbh1_pdata); | 198 | imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
252 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
253 | } | ||
254 | 199 | ||
255 | #else | 200 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
256 | static inline void lilly1131_usb_init(void) {} | 201 | ULPI_OTG_DRVVBUS_EXT); |
257 | #endif /* CONFIG_USB_ULPI */ | 202 | if (usbh2_pdata.otg) |
203 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
204 | } | ||
258 | 205 | ||
259 | /* SPI */ | 206 | /* SPI */ |
260 | 207 | ||
@@ -274,8 +221,8 @@ static const struct spi_imx_master spi1_pdata __initconst = { | |||
274 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | 221 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), |
275 | }; | 222 | }; |
276 | 223 | ||
277 | static struct mc13783_platform_data mc13783_pdata __initdata = { | 224 | static struct mc13xxx_platform_data mc13783_pdata __initdata = { |
278 | .flags = MC13783_USE_RTC | MC13783_USE_TOUCHSCREEN, | 225 | .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN, |
279 | }; | 226 | }; |
280 | 227 | ||
281 | static struct spi_board_info mc13783_dev __initdata = { | 228 | static struct spi_board_info mc13783_dev __initdata = { |
@@ -347,10 +294,10 @@ static struct sys_timer mx31lilly_timer = { | |||
347 | }; | 294 | }; |
348 | 295 | ||
349 | MACHINE_START(LILLY1131, "INCO startec LILLY-1131") | 296 | MACHINE_START(LILLY1131, "INCO startec LILLY-1131") |
350 | .boot_params = MX3x_PHYS_OFFSET + 0x100, | 297 | .boot_params = MX3x_PHYS_OFFSET + 0x100, |
351 | .map_io = mx31_map_io, | 298 | .map_io = mx31_map_io, |
352 | .init_irq = mx31_init_irq, | 299 | .init_early = imx31_init_early, |
353 | .init_machine = mx31lilly_board_init, | 300 | .init_irq = mx31_init_irq, |
354 | .timer = &mx31lilly_timer, | 301 | .timer = &mx31lilly_timer, |
302 | .init_machine = mx31lilly_board_init, | ||
355 | MACHINE_END | 303 | MACHINE_END |
356 | |||