diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2010-12-21 13:38:22 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-03 04:18:07 -0500 |
commit | 0d95b75e2dd736b23f7cc0971d2f2aacea7f3e49 (patch) | |
tree | 089e669ae879e8f858a4d0f17ec5a51b9c21946c /arch/arm/mach-mx3 | |
parent | 1c50e67263a6ab8abb9234e2357bd02134fb4b99 (diff) |
ARM: mx3/mx31_3ds: Add support for USB Host2 port
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31_3ds.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c index fd7b722dff63..4e516b49a901 100644 --- a/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/arch/arm/mach-mx3/mach-mx31_3ds.c | |||
@@ -85,6 +85,21 @@ static int mx31_3ds_pins[] = { | |||
85 | MX31_PIN_KEY_COL1_KEY_COL1, | 85 | MX31_PIN_KEY_COL1_KEY_COL1, |
86 | MX31_PIN_KEY_COL2_KEY_COL2, | 86 | MX31_PIN_KEY_COL2_KEY_COL2, |
87 | MX31_PIN_KEY_COL3_KEY_COL3, | 87 | MX31_PIN_KEY_COL3_KEY_COL3, |
88 | /* USB Host 2 */ | ||
89 | IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC), | ||
90 | IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC), | ||
91 | IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC), | ||
92 | IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC), | ||
93 | IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC), | ||
94 | IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC), | ||
95 | IOMUX_MODE(MX31_PIN_PC_VS2, IOMUX_CONFIG_ALT1), | ||
96 | IOMUX_MODE(MX31_PIN_PC_BVD1, IOMUX_CONFIG_ALT1), | ||
97 | IOMUX_MODE(MX31_PIN_PC_BVD2, IOMUX_CONFIG_ALT1), | ||
98 | IOMUX_MODE(MX31_PIN_PC_RST, IOMUX_CONFIG_ALT1), | ||
99 | IOMUX_MODE(MX31_PIN_IOIS16, IOMUX_CONFIG_ALT1), | ||
100 | IOMUX_MODE(MX31_PIN_PC_RW_B, IOMUX_CONFIG_ALT1), | ||
101 | /* USB Host2 reset */ | ||
102 | IOMUX_MODE(MX31_PIN_USB_BYP, IOMUX_CONFIG_GPIO), | ||
88 | }; | 103 | }; |
89 | 104 | ||
90 | /* | 105 | /* |
@@ -116,6 +131,13 @@ static struct regulator_init_data pwgtx_init = { | |||
116 | }, | 131 | }, |
117 | }; | 132 | }; |
118 | 133 | ||
134 | static struct regulator_init_data gpo_init = { | ||
135 | .constraints = { | ||
136 | .boot_on = 1, | ||
137 | .always_on = 1, | ||
138 | } | ||
139 | }; | ||
140 | |||
119 | static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { | 141 | static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { |
120 | { | 142 | { |
121 | .id = MC13783_REGU_PWGT1SPI, /* Power Gate for ARM core. */ | 143 | .id = MC13783_REGU_PWGT1SPI, /* Power Gate for ARM core. */ |
@@ -123,6 +145,13 @@ static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { | |||
123 | }, { | 145 | }, { |
124 | .id = MC13783_REGU_PWGT2SPI, /* Power Gate for L2 Cache. */ | 146 | .id = MC13783_REGU_PWGT2SPI, /* Power Gate for L2 Cache. */ |
125 | .init_data = &pwgtx_init, | 147 | .init_data = &pwgtx_init, |
148 | }, { | ||
149 | |||
150 | .id = MC13783_REGU_GPO1, /* Turn on 1.8V */ | ||
151 | .init_data = &gpo_init, | ||
152 | }, { | ||
153 | .id = MC13783_REGU_GPO3, /* Turn on 3.3V */ | ||
154 | .init_data = &gpo_init, | ||
126 | }, | 155 | }, |
127 | }; | 156 | }; |
128 | 157 | ||
@@ -176,6 +205,7 @@ mx31_3ds_nand_board_info __initconst = { | |||
176 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | 205 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
177 | 206 | ||
178 | #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) | 207 | #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) |
208 | #define USBH2_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_BYP) | ||
179 | 209 | ||
180 | static int mx31_3ds_usbotg_init(void) | 210 | static int mx31_3ds_usbotg_init(void) |
181 | { | 211 | { |
@@ -215,11 +245,55 @@ usbotg_free_reset: | |||
215 | return err; | 245 | return err; |
216 | } | 246 | } |
217 | 247 | ||
248 | static int mx31_3ds_host2_init(struct platform_device *pdev) | ||
249 | { | ||
250 | int err; | ||
251 | |||
252 | mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG); | ||
253 | mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG); | ||
254 | mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG); | ||
255 | mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG); | ||
256 | mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG); | ||
257 | mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG); | ||
258 | mxc_iomux_set_pad(MX31_PIN_PC_VS2, USB_PAD_CFG); | ||
259 | mxc_iomux_set_pad(MX31_PIN_PC_BVD1, USB_PAD_CFG); | ||
260 | mxc_iomux_set_pad(MX31_PIN_PC_BVD2, USB_PAD_CFG); | ||
261 | mxc_iomux_set_pad(MX31_PIN_PC_RST, USB_PAD_CFG); | ||
262 | mxc_iomux_set_pad(MX31_PIN_IOIS16, USB_PAD_CFG); | ||
263 | mxc_iomux_set_pad(MX31_PIN_PC_RW_B, USB_PAD_CFG); | ||
264 | |||
265 | err = gpio_request(USBH2_RST_B, "usbh2-reset"); | ||
266 | if (err) { | ||
267 | pr_err("Failed to request the USB Host 2 reset gpio\n"); | ||
268 | return err; | ||
269 | } | ||
270 | |||
271 | err = gpio_direction_output(USBH2_RST_B, 0); | ||
272 | if (err) { | ||
273 | pr_err("Failed to drive the USB Host 2 reset gpio\n"); | ||
274 | goto usbotg_free_reset; | ||
275 | } | ||
276 | |||
277 | mdelay(1); | ||
278 | gpio_set_value(USBH2_RST_B, 1); | ||
279 | return 0; | ||
280 | |||
281 | usbotg_free_reset: | ||
282 | gpio_free(USBH2_RST_B); | ||
283 | return err; | ||
284 | } | ||
285 | |||
218 | #if defined(CONFIG_USB_ULPI) | 286 | #if defined(CONFIG_USB_ULPI) |
219 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 287 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
220 | .portsc = MXC_EHCI_MODE_ULPI, | 288 | .portsc = MXC_EHCI_MODE_ULPI, |
221 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 289 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
222 | }; | 290 | }; |
291 | |||
292 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | ||
293 | .init = mx31_3ds_host2_init, | ||
294 | .portsc = MXC_EHCI_MODE_ULPI, | ||
295 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
296 | }; | ||
223 | #endif | 297 | #endif |
224 | 298 | ||
225 | static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { | 299 | static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { |
@@ -279,6 +353,9 @@ static void __init mxc_board_init(void) | |||
279 | 353 | ||
280 | imx31_add_mxc_ehci_otg(&otg_pdata); | 354 | imx31_add_mxc_ehci_otg(&otg_pdata); |
281 | } | 355 | } |
356 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
357 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
358 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
282 | #endif | 359 | #endif |
283 | if (!otg_mode_host) | 360 | if (!otg_mode_host) |
284 | imx31_add_fsl_usb2_udc(&usbotg_pdata); | 361 | imx31_add_fsl_usb2_udc(&usbotg_pdata); |