aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-01-10 17:23:41 -0500
committerTony Lindgren <tony@atomide.com>2011-01-10 17:23:41 -0500
commit274353674dd0337bdeeaee08a9f2047777b07ab0 (patch)
treeb788d77dd7c0e8f27bbcc89fc742c212c28872c0 /arch/arm/mach-omap2
parent1740d483ba4d79f9fa6984dccd7152b6b208f1bf (diff)
parentd7cd5c73cec2dfa9f259a2adcf802c9f8fcc125f (diff)
Merge branch 'ehci-omap-clock' into omap-fixes
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rw-r--r--arch/arm/mach-omap2/Makefile6
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c35
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c5
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c14
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c2
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c13
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c7
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c149
-rw-r--r--arch/arm/mach-omap2/usb-ehci.c144
-rw-r--r--arch/arm/mach-omap2/usb-musb.c104
-rw-r--r--arch/arm/mach-omap2/usb-tusb6010.c2
13 files changed, 451 insertions, 33 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3e8c9e859f98..1a2cf6226a55 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -48,6 +48,7 @@ config ARCH_OMAP4
48 select ARM_ERRATA_720789 48 select ARM_ERRATA_720789
49 select ARCH_HAS_OPP 49 select ARCH_HAS_OPP
50 select PM_OPP if PM 50 select PM_OPP if PM
51 select USB_ARCH_HAS_EHCI
51 52
52comment "OMAP Core Type" 53comment "OMAP Core Type"
53 depends on ARCH_OMAP2 54 depends on ARCH_OMAP2
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4ab82f6f15b1..cd7332f50b2d 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -209,9 +209,11 @@ obj-$(CONFIG_MACH_IGEP0030) += board-igep0030.o \
209obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ 209obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
210 hsmmc.o 210 hsmmc.o
211obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ 211obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \
212 hsmmc.o 212 hsmmc.o \
213 omap_phy_internal.o
213obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ 214obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
214 hsmmc.o 215 hsmmc.o \
216 omap_phy_internal.o
215 217
216obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o 218obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
217 219
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 1cb208b6e626..a70bdf28e2bc 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -44,6 +44,7 @@
44#define ETH_KS8851_IRQ 34 44#define ETH_KS8851_IRQ 34
45#define ETH_KS8851_POWER_ON 48 45#define ETH_KS8851_POWER_ON 48
46#define ETH_KS8851_QUART 138 46#define ETH_KS8851_QUART 138
47#define OMAP4SDP_MDM_PWR_EN_GPIO 157
47#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 48#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
48#define OMAP4_SFH7741_ENABLE_GPIO 188 49#define OMAP4_SFH7741_ENABLE_GPIO 188
49 50
@@ -250,12 +251,29 @@ static void __init omap_4430sdp_init_irq(void)
250 gic_init_irq(); 251 gic_init_irq();
251} 252}
252 253
254static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
255 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
256 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
257 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
258 .phy_reset = false,
259 .reset_gpio_port[0] = -EINVAL,
260 .reset_gpio_port[1] = -EINVAL,
261 .reset_gpio_port[2] = -EINVAL,
262};
263
253static struct omap_musb_board_data musb_board_data = { 264static struct omap_musb_board_data musb_board_data = {
254 .interface_type = MUSB_INTERFACE_UTMI, 265 .interface_type = MUSB_INTERFACE_UTMI,
255 .mode = MUSB_PERIPHERAL, 266 .mode = MUSB_OTG,
256 .power = 100, 267 .power = 100,
257}; 268};
258 269
270static struct twl4030_usb_data omap4_usbphy_data = {
271 .phy_init = omap4430_phy_init,
272 .phy_exit = omap4430_phy_exit,
273 .phy_power = omap4430_phy_power,
274 .phy_set_clock = omap4430_phy_set_clk,
275};
276
259static struct omap2_hsmmc_info mmc[] = { 277static struct omap2_hsmmc_info mmc[] = {
260 { 278 {
261 .mmc = 1, 279 .mmc = 1,
@@ -475,6 +493,7 @@ static struct twl4030_platform_data sdp4430_twldata = {
475 .vaux1 = &sdp4430_vaux1, 493 .vaux1 = &sdp4430_vaux1,
476 .vaux2 = &sdp4430_vaux2, 494 .vaux2 = &sdp4430_vaux2,
477 .vaux3 = &sdp4430_vaux3, 495 .vaux3 = &sdp4430_vaux3,
496 .usb = &omap4_usbphy_data
478}; 497};
479 498
480static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { 499static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
@@ -555,11 +574,15 @@ static void __init omap_4430sdp_init(void)
555 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); 574 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
556 omap_serial_init(); 575 omap_serial_init();
557 omap4_twl6030_hsmmc_init(mmc); 576 omap4_twl6030_hsmmc_init(mmc);
558 /* OMAP4 SDP uses internal transceiver so register nop transceiver */ 577
559 usb_nop_xceiv_register(); 578 /* Power on the ULPI PHY */
560 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ 579 if (gpio_is_valid(OMAP4SDP_MDM_PWR_EN_GPIO)) {
561 if (!cpu_is_omap44xx()) 580 /* FIXME: Assumes pad is already muxed for GPIO mode */
562 usb_musb_init(&musb_board_data); 581 gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3");
582 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);
583 }
584 usb_ehci_init(&ehci_pdata);
585 usb_musb_init(&musb_board_data);
563 586
564 status = omap_ethernet_init(); 587 status = omap_ethernet_init();
565 if (status) { 588 if (status) {
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 147d9005f320..f396756872b7 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -46,8 +46,7 @@ static struct device *mmc_device;
46#define TUSB6010_GPIO_ENABLE 0 46#define TUSB6010_GPIO_ENABLE 0
47#define TUSB6010_DMACHAN 0x3f 47#define TUSB6010_DMACHAN 0x3f
48 48
49#if defined(CONFIG_USB_TUSB6010) || \ 49#ifdef CONFIG_USB_MUSB_TUSB6010
50 defined(CONFIG_USB_TUSB6010_MODULE)
51/* 50/*
52 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and 51 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
53 * 1.5 V voltage regulators of PM companion chip. Companion chip will then 52 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
@@ -134,7 +133,7 @@ err:
134 133
135static void __init n8x0_usb_init(void) {} 134static void __init n8x0_usb_init(void) {}
136 135
137#endif /*CONFIG_USB_TUSB6010 */ 136#endif /*CONFIG_USB_MUSB_TUSB6010 */
138 137
139 138
140static struct omap2_mcspi_device_config p54spi_mcspi_config = { 139static struct omap2_mcspi_device_config p54spi_mcspi_config = {
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 613bdd89bcfa..e001a048dc0c 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -144,10 +144,17 @@ error1:
144 144
145static struct omap_musb_board_data musb_board_data = { 145static struct omap_musb_board_data musb_board_data = {
146 .interface_type = MUSB_INTERFACE_UTMI, 146 .interface_type = MUSB_INTERFACE_UTMI,
147 .mode = MUSB_PERIPHERAL, 147 .mode = MUSB_OTG,
148 .power = 100, 148 .power = 100,
149}; 149};
150 150
151static struct twl4030_usb_data omap4_usbphy_data = {
152 .phy_init = omap4430_phy_init,
153 .phy_exit = omap4430_phy_exit,
154 .phy_power = omap4430_phy_power,
155 .phy_set_clock = omap4430_phy_set_clk,
156};
157
151static struct omap2_hsmmc_info mmc[] = { 158static struct omap2_hsmmc_info mmc[] = {
152 { 159 {
153 .mmc = 1, 160 .mmc = 1,
@@ -357,6 +364,7 @@ static struct twl4030_platform_data omap4_panda_twldata = {
357 .vaux1 = &omap4_panda_vaux1, 364 .vaux1 = &omap4_panda_vaux1,
358 .vaux2 = &omap4_panda_vaux2, 365 .vaux2 = &omap4_panda_vaux2,
359 .vaux3 = &omap4_panda_vaux3, 366 .vaux3 = &omap4_panda_vaux3,
367 .usb = &omap4_usbphy_data,
360}; 368};
361 369
362static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = { 370static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
@@ -404,9 +412,7 @@ static void __init omap4_panda_init(void)
404 /* OMAP4 Panda uses internal transceiver so register nop transceiver */ 412 /* OMAP4 Panda uses internal transceiver so register nop transceiver */
405 usb_nop_xceiv_register(); 413 usb_nop_xceiv_register();
406 omap4_ehci_init(); 414 omap4_ehci_init();
407 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ 415 usb_musb_init(&musb_board_data);
408 if (!cpu_is_omap44xx())
409 usb_musb_init(&musb_board_data);
410} 416}
411 417
412static void __init omap4_panda_map_io(void) 418static void __init omap4_panda_map_io(void)
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index ed1295f5046e..0a992bc8d0d8 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1877,7 +1877,7 @@ static struct omap_clk omap2420_clks[] = {
1877 CLK("omap-aes", "ick", &aes_ick, CK_242X), 1877 CLK("omap-aes", "ick", &aes_ick, CK_242X),
1878 CLK(NULL, "pka_ick", &pka_ick, CK_242X), 1878 CLK(NULL, "pka_ick", &pka_ick, CK_242X),
1879 CLK(NULL, "usb_fck", &usb_fck, CK_242X), 1879 CLK(NULL, "usb_fck", &usb_fck, CK_242X),
1880 CLK("musb_hdrc", "fck", &osc_ck, CK_242X), 1880 CLK("musb-hdrc", "fck", &osc_ck, CK_242X),
1881}; 1881};
1882 1882
1883/* 1883/*
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index 38341a71c6f8..c047dcd007e5 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1983,7 +1983,7 @@ static struct omap_clk omap2430_clks[] = {
1983 CLK("omap-aes", "ick", &aes_ick, CK_243X), 1983 CLK("omap-aes", "ick", &aes_ick, CK_243X),
1984 CLK(NULL, "pka_ick", &pka_ick, CK_243X), 1984 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1985 CLK(NULL, "usb_fck", &usb_fck, CK_243X), 1985 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
1986 CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X), 1986 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
1987 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), 1987 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
1988 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), 1988 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),
1989 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), 1989 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 9ab817e6c300..403a4a1d3f9c 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3286,6 +3286,7 @@ static struct omap_clk omap3xxx_clks[] = {
3286 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3286 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3287 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3287 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3288 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3288 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3289 CLK("ehci-omap.0", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3290 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3291 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3292 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
@@ -3313,14 +3314,15 @@ static struct omap_clk omap3xxx_clks[] = {
3313 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), 3314 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
3314 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2PLUS | CK_36XX), 3315 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3315 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), 3316 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX),
3316 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), 3317 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1, CK_3430ES1),
3317 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX), 3318 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3318 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), 3319 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX),
3319 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), 3320 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX),
3320 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX), 3321 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX),
3321 CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX), 3322 CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX),
3322 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3323 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3323 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3324 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3325 CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3324 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3326 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3325 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), 3327 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
3326 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), 3328 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
@@ -3366,8 +3368,11 @@ static struct omap_clk omap3xxx_clks[] = {
3366 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX), 3368 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
3367 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX), 3369 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
3368 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3370 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3371 CLK("ehci-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3369 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3372 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3373 CLK("ehci-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3370 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3374 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3375 CLK("ehci-omap.0", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3371 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), 3376 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
3372 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3377 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
3373 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), 3378 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
@@ -3445,8 +3450,8 @@ static struct omap_clk omap3xxx_clks[] = {
3445 CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX), 3450 CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX),
3446 CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), 3451 CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX),
3447 CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), 3452 CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX),
3448 CLK("musb_hdrc", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), 3453 CLK("musb-am35x", "ick", &hsotgusb_ick_am35xx, CK_AM35XX),
3449 CLK("musb_hdrc", "fck", &hsotgusb_fck_am35xx, CK_AM35XX), 3454 CLK("musb-am35x", "fck", &hsotgusb_fck_am35xx, CK_AM35XX),
3450 CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX), 3455 CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX),
3451 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX), 3456 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX),
3452}; 3457};
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index c426adccad06..e8cb32fd7f13 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3198,6 +3198,7 @@ static struct omap_clk omap44xx_clks[] = {
3198 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), 3198 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
3199 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), 3199 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
3200 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), 3200 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
3201 CLK("ehci-omap.0", "fs_fck", &usb_host_fs_fck, CK_443X),
3201 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), 3202 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
3202 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), 3203 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
3203 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), 3204 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
@@ -3209,14 +3210,18 @@ static struct omap_clk omap44xx_clks[] = {
3209 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), 3210 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
3210 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), 3211 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
3211 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X), 3212 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
3213 CLK("ehci-omap.0", "hs_fck", &usb_host_hs_fck, CK_443X),
3214 CLK("ehci-omap.0", "usbhost_ick", &dummy_ck, CK_443X),
3212 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X), 3215 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
3213 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X), 3216 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
3214 CLK("musb_hdrc", "ick", &usb_otg_hs_ick, CK_443X), 3217 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
3215 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X), 3218 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X),
3216 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X), 3219 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
3217 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X), 3220 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
3218 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X), 3221 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
3219 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X), 3222 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
3223 CLK("ehci-omap.0", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
3224 CLK("ehci-omap.0", "usbtll_fck", &dummy_ck, CK_443X),
3220 CLK(NULL, "usim_ck", &usim_ck, CK_443X), 3225 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
3221 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 3226 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
3222 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 3227 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
new file mode 100644
index 000000000000..745252c60e32
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -0,0 +1,149 @@
1/*
2 * This file configures the internal USB PHY in OMAP4430. Used
3 * with TWL6030 transceiver and MUSB on OMAP4430.
4 *
5 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
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 * Author: Hema HK <hemahk@ti.com>
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24#include <linux/types.h>
25#include <linux/delay.h>
26#include <linux/clk.h>
27#include <linux/io.h>
28#include <linux/err.h>
29#include <linux/usb.h>
30
31#include <plat/usb.h>
32
33/* OMAP control module register for UTMI PHY */
34#define CONTROL_DEV_CONF 0x300
35#define PHY_PD 0x1
36
37#define USBOTGHS_CONTROL 0x33c
38#define AVALID BIT(0)
39#define BVALID BIT(1)
40#define VBUSVALID BIT(2)
41#define SESSEND BIT(3)
42#define IDDIG BIT(4)
43
44static struct clk *phyclk, *clk48m, *clk32k;
45static void __iomem *ctrl_base;
46
47int omap4430_phy_init(struct device *dev)
48{
49 ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K);
50 if (!ctrl_base) {
51 dev_err(dev, "control module ioremap failed\n");
52 return -ENOMEM;
53 }
54 /* Power down the phy */
55 __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
56 phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
57
58 if (IS_ERR(phyclk)) {
59 dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n");
60 iounmap(ctrl_base);
61 return PTR_ERR(phyclk);
62 }
63
64 clk48m = clk_get(dev, "ocp2scp_usb_phy_phy_48m");
65 if (IS_ERR(clk48m)) {
66 dev_err(dev, "cannot clk_get ocp2scp_usb_phy_phy_48m\n");
67 clk_put(phyclk);
68 iounmap(ctrl_base);
69 return PTR_ERR(clk48m);
70 }
71
72 clk32k = clk_get(dev, "usb_phy_cm_clk32k");
73 if (IS_ERR(clk32k)) {
74 dev_err(dev, "cannot clk_get usb_phy_cm_clk32k\n");
75 clk_put(phyclk);
76 clk_put(clk48m);
77 iounmap(ctrl_base);
78 return PTR_ERR(clk32k);
79 }
80 return 0;
81}
82
83int omap4430_phy_set_clk(struct device *dev, int on)
84{
85 static int state;
86
87 if (on && !state) {
88 /* Enable the phy clocks */
89 clk_enable(phyclk);
90 clk_enable(clk48m);
91 clk_enable(clk32k);
92 state = 1;
93 } else if (state) {
94 /* Disable the phy clocks */
95 clk_disable(phyclk);
96 clk_disable(clk48m);
97 clk_disable(clk32k);
98 state = 0;
99 }
100 return 0;
101}
102
103int omap4430_phy_power(struct device *dev, int ID, int on)
104{
105 if (on) {
106 /* enabled the clocks */
107 omap4430_phy_set_clk(dev, 1);
108 /* power on the phy */
109 if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) {
110 __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF);
111 mdelay(200);
112 }
113 if (ID)
114 /* enable VBUS valid, IDDIG groung */
115 __raw_writel(AVALID | VBUSVALID, ctrl_base +
116 USBOTGHS_CONTROL);
117 else
118 /*
119 * Enable VBUS Valid, AValid and IDDIG
120 * high impedence
121 */
122 __raw_writel(IDDIG | AVALID | VBUSVALID,
123 ctrl_base + USBOTGHS_CONTROL);
124 } else {
125 /* Enable session END and IDIG to high impedence. */
126 __raw_writel(SESSEND | IDDIG, ctrl_base +
127 USBOTGHS_CONTROL);
128 /* Disable the clocks */
129 omap4430_phy_set_clk(dev, 0);
130 /* Power down the phy */
131 __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
132 }
133
134 return 0;
135}
136
137int omap4430_phy_exit(struct device *dev)
138{
139 if (ctrl_base)
140 iounmap(ctrl_base);
141 if (phyclk)
142 clk_put(phyclk);
143 if (clk48m)
144 clk_put(clk48m);
145 if (clk32k)
146 clk_put(clk32k);
147
148 return 0;
149}
diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
index b11bf385d360..25eeadabc39b 100644
--- a/arch/arm/mach-omap2/usb-ehci.c
+++ b/arch/arm/mach-omap2/usb-ehci.c
@@ -34,22 +34,15 @@
34 34
35static struct resource ehci_resources[] = { 35static struct resource ehci_resources[] = {
36 { 36 {
37 .start = OMAP34XX_EHCI_BASE,
38 .end = OMAP34XX_EHCI_BASE + SZ_1K - 1,
39 .flags = IORESOURCE_MEM, 37 .flags = IORESOURCE_MEM,
40 }, 38 },
41 { 39 {
42 .start = OMAP34XX_UHH_CONFIG_BASE,
43 .end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1,
44 .flags = IORESOURCE_MEM, 40 .flags = IORESOURCE_MEM,
45 }, 41 },
46 { 42 {
47 .start = OMAP34XX_USBTLL_BASE,
48 .end = OMAP34XX_USBTLL_BASE + SZ_4K - 1,
49 .flags = IORESOURCE_MEM, 43 .flags = IORESOURCE_MEM,
50 }, 44 },
51 { /* general IRQ */ 45 { /* general IRQ */
52 .start = INT_34XX_EHCI_IRQ,
53 .flags = IORESOURCE_IRQ, 46 .flags = IORESOURCE_IRQ,
54 } 47 }
55}; 48};
@@ -214,13 +207,148 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
214 return; 207 return;
215} 208}
216 209
210static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
211{
212 switch (port_mode[0]) {
213 case EHCI_HCD_OMAP_MODE_PHY:
214 omap_mux_init_signal("usbb1_ulpiphy_stp",
215 OMAP_PIN_OUTPUT);
216 omap_mux_init_signal("usbb1_ulpiphy_clk",
217 OMAP_PIN_INPUT_PULLDOWN);
218 omap_mux_init_signal("usbb1_ulpiphy_dir",
219 OMAP_PIN_INPUT_PULLDOWN);
220 omap_mux_init_signal("usbb1_ulpiphy_nxt",
221 OMAP_PIN_INPUT_PULLDOWN);
222 omap_mux_init_signal("usbb1_ulpiphy_dat0",
223 OMAP_PIN_INPUT_PULLDOWN);
224 omap_mux_init_signal("usbb1_ulpiphy_dat1",
225 OMAP_PIN_INPUT_PULLDOWN);
226 omap_mux_init_signal("usbb1_ulpiphy_dat2",
227 OMAP_PIN_INPUT_PULLDOWN);
228 omap_mux_init_signal("usbb1_ulpiphy_dat3",
229 OMAP_PIN_INPUT_PULLDOWN);
230 omap_mux_init_signal("usbb1_ulpiphy_dat4",
231 OMAP_PIN_INPUT_PULLDOWN);
232 omap_mux_init_signal("usbb1_ulpiphy_dat5",
233 OMAP_PIN_INPUT_PULLDOWN);
234 omap_mux_init_signal("usbb1_ulpiphy_dat6",
235 OMAP_PIN_INPUT_PULLDOWN);
236 omap_mux_init_signal("usbb1_ulpiphy_dat7",
237 OMAP_PIN_INPUT_PULLDOWN);
238 break;
239 case EHCI_HCD_OMAP_MODE_TLL:
240 omap_mux_init_signal("usbb1_ulpitll_stp",
241 OMAP_PIN_INPUT_PULLUP);
242 omap_mux_init_signal("usbb1_ulpitll_clk",
243 OMAP_PIN_INPUT_PULLDOWN);
244 omap_mux_init_signal("usbb1_ulpitll_dir",
245 OMAP_PIN_INPUT_PULLDOWN);
246 omap_mux_init_signal("usbb1_ulpitll_nxt",
247 OMAP_PIN_INPUT_PULLDOWN);
248 omap_mux_init_signal("usbb1_ulpitll_dat0",
249 OMAP_PIN_INPUT_PULLDOWN);
250 omap_mux_init_signal("usbb1_ulpitll_dat1",
251 OMAP_PIN_INPUT_PULLDOWN);
252 omap_mux_init_signal("usbb1_ulpitll_dat2",
253 OMAP_PIN_INPUT_PULLDOWN);
254 omap_mux_init_signal("usbb1_ulpitll_dat3",
255 OMAP_PIN_INPUT_PULLDOWN);
256 omap_mux_init_signal("usbb1_ulpitll_dat4",
257 OMAP_PIN_INPUT_PULLDOWN);
258 omap_mux_init_signal("usbb1_ulpitll_dat5",
259 OMAP_PIN_INPUT_PULLDOWN);
260 omap_mux_init_signal("usbb1_ulpitll_dat6",
261 OMAP_PIN_INPUT_PULLDOWN);
262 omap_mux_init_signal("usbb1_ulpitll_dat7",
263 OMAP_PIN_INPUT_PULLDOWN);
264 break;
265 case EHCI_HCD_OMAP_MODE_UNKNOWN:
266 default:
267 break;
268 }
269 switch (port_mode[1]) {
270 case EHCI_HCD_OMAP_MODE_PHY:
271 omap_mux_init_signal("usbb2_ulpiphy_stp",
272 OMAP_PIN_OUTPUT);
273 omap_mux_init_signal("usbb2_ulpiphy_clk",
274 OMAP_PIN_INPUT_PULLDOWN);
275 omap_mux_init_signal("usbb2_ulpiphy_dir",
276 OMAP_PIN_INPUT_PULLDOWN);
277 omap_mux_init_signal("usbb2_ulpiphy_nxt",
278 OMAP_PIN_INPUT_PULLDOWN);
279 omap_mux_init_signal("usbb2_ulpiphy_dat0",
280 OMAP_PIN_INPUT_PULLDOWN);
281 omap_mux_init_signal("usbb2_ulpiphy_dat1",
282 OMAP_PIN_INPUT_PULLDOWN);
283 omap_mux_init_signal("usbb2_ulpiphy_dat2",
284 OMAP_PIN_INPUT_PULLDOWN);
285 omap_mux_init_signal("usbb2_ulpiphy_dat3",
286 OMAP_PIN_INPUT_PULLDOWN);
287 omap_mux_init_signal("usbb2_ulpiphy_dat4",
288 OMAP_PIN_INPUT_PULLDOWN);
289 omap_mux_init_signal("usbb2_ulpiphy_dat5",
290 OMAP_PIN_INPUT_PULLDOWN);
291 omap_mux_init_signal("usbb2_ulpiphy_dat6",
292 OMAP_PIN_INPUT_PULLDOWN);
293 omap_mux_init_signal("usbb2_ulpiphy_dat7",
294 OMAP_PIN_INPUT_PULLDOWN);
295 break;
296 case EHCI_HCD_OMAP_MODE_TLL:
297 omap_mux_init_signal("usbb2_ulpitll_stp",
298 OMAP_PIN_INPUT_PULLUP);
299 omap_mux_init_signal("usbb2_ulpitll_clk",
300 OMAP_PIN_INPUT_PULLDOWN);
301 omap_mux_init_signal("usbb2_ulpitll_dir",
302 OMAP_PIN_INPUT_PULLDOWN);
303 omap_mux_init_signal("usbb2_ulpitll_nxt",
304 OMAP_PIN_INPUT_PULLDOWN);
305 omap_mux_init_signal("usbb2_ulpitll_dat0",
306 OMAP_PIN_INPUT_PULLDOWN);
307 omap_mux_init_signal("usbb2_ulpitll_dat1",
308 OMAP_PIN_INPUT_PULLDOWN);
309 omap_mux_init_signal("usbb2_ulpitll_dat2",
310 OMAP_PIN_INPUT_PULLDOWN);
311 omap_mux_init_signal("usbb2_ulpitll_dat3",
312 OMAP_PIN_INPUT_PULLDOWN);
313 omap_mux_init_signal("usbb2_ulpitll_dat4",
314 OMAP_PIN_INPUT_PULLDOWN);
315 omap_mux_init_signal("usbb2_ulpitll_dat5",
316 OMAP_PIN_INPUT_PULLDOWN);
317 omap_mux_init_signal("usbb2_ulpitll_dat6",
318 OMAP_PIN_INPUT_PULLDOWN);
319 omap_mux_init_signal("usbb2_ulpitll_dat7",
320 OMAP_PIN_INPUT_PULLDOWN);
321 break;
322 case EHCI_HCD_OMAP_MODE_UNKNOWN:
323 default:
324 break;
325 }
326}
327
217void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata) 328void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)
218{ 329{
219 platform_device_add_data(&ehci_device, pdata, sizeof(*pdata)); 330 platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));
220 331
221 /* Setup Pin IO MUX for EHCI */ 332 /* Setup Pin IO MUX for EHCI */
222 if (cpu_is_omap34xx()) 333 if (cpu_is_omap34xx()) {
334 ehci_resources[0].start = OMAP34XX_EHCI_BASE;
335 ehci_resources[0].end = OMAP34XX_EHCI_BASE + SZ_1K - 1;
336 ehci_resources[1].start = OMAP34XX_UHH_CONFIG_BASE;
337 ehci_resources[1].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
338 ehci_resources[2].start = OMAP34XX_USBTLL_BASE;
339 ehci_resources[2].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
340 ehci_resources[3].start = INT_34XX_EHCI_IRQ;
223 setup_ehci_io_mux(pdata->port_mode); 341 setup_ehci_io_mux(pdata->port_mode);
342 } else if (cpu_is_omap44xx()) {
343 ehci_resources[0].start = OMAP44XX_HSUSB_EHCI_BASE;
344 ehci_resources[0].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
345 ehci_resources[1].start = OMAP44XX_UHH_CONFIG_BASE;
346 ehci_resources[1].end = OMAP44XX_UHH_CONFIG_BASE + SZ_2K - 1;
347 ehci_resources[2].start = OMAP44XX_USBTLL_BASE;
348 ehci_resources[2].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
349 ehci_resources[3].start = OMAP44XX_IRQ_EHCI;
350 setup_4430ehci_io_mux(pdata->port_mode);
351 }
224 352
225 if (platform_device_register(&ehci_device) < 0) { 353 if (platform_device_register(&ehci_device) < 0) {
226 printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n"); 354 printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 72605584bfff..5298949d4b11 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -30,8 +30,101 @@
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/am35xx.h> 31#include <mach/am35xx.h>
32#include <plat/usb.h> 32#include <plat/usb.h>
33#include "control.h"
33 34
34#ifdef CONFIG_USB_MUSB_SOC 35#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X)
36
37static void am35x_musb_reset(void)
38{
39 u32 regval;
40
41 /* Reset the musb interface */
42 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
43
44 regval |= AM35XX_USBOTGSS_SW_RST;
45 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
46
47 regval &= ~AM35XX_USBOTGSS_SW_RST;
48 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
49
50 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
51}
52
53static void am35x_musb_phy_power(u8 on)
54{
55 unsigned long timeout = jiffies + msecs_to_jiffies(100);
56 u32 devconf2;
57
58 if (on) {
59 /*
60 * Start the on-chip PHY and its PLL.
61 */
62 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
63
64 devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
65 devconf2 |= CONF2_PHY_PLLON;
66
67 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
68
69 pr_info(KERN_INFO "Waiting for PHY clock good...\n");
70 while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
71 & CONF2_PHYCLKGD)) {
72 cpu_relax();
73
74 if (time_after(jiffies, timeout)) {
75 pr_err(KERN_ERR "musb PHY clock good timed out\n");
76 break;
77 }
78 }
79 } else {
80 /*
81 * Power down the on-chip PHY.
82 */
83 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
84
85 devconf2 &= ~CONF2_PHY_PLLON;
86 devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
87 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
88 }
89}
90
91static void am35x_musb_clear_irq(void)
92{
93 u32 regval;
94
95 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
96 regval |= AM35XX_USBOTGSS_INT_CLR;
97 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
98 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
99}
100
101static void am35x_musb_set_mode(u8 musb_mode)
102{
103 u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
104
105 devconf2 &= ~CONF2_OTGMODE;
106 switch (musb_mode) {
107#ifdef CONFIG_USB_MUSB_HDRC_HCD
108 case MUSB_HOST: /* Force VBUS valid, ID = 0 */
109 devconf2 |= CONF2_FORCE_HOST;
110 break;
111#endif
112#ifdef CONFIG_USB_GADGET_MUSB_HDRC
113 case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
114 devconf2 |= CONF2_FORCE_DEVICE;
115 break;
116#endif
117#ifdef CONFIG_USB_MUSB_OTG
118 case MUSB_OTG: /* Don't override the VBUS/ID comparators */
119 devconf2 |= CONF2_NO_OVERRIDE;
120 break;
121#endif
122 default:
123 pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode);
124 }
125
126 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
127}
35 128
36static struct resource musb_resources[] = { 129static struct resource musb_resources[] = {
37 [0] = { /* start and end set dynamically */ 130 [0] = { /* start and end set dynamically */
@@ -40,10 +133,12 @@ static struct resource musb_resources[] = {
40 [1] = { /* general IRQ */ 133 [1] = { /* general IRQ */
41 .start = INT_243X_HS_USB_MC, 134 .start = INT_243X_HS_USB_MC,
42 .flags = IORESOURCE_IRQ, 135 .flags = IORESOURCE_IRQ,
136 .name = "mc",
43 }, 137 },
44 [2] = { /* DMA IRQ */ 138 [2] = { /* DMA IRQ */
45 .start = INT_243X_HS_USB_DMA, 139 .start = INT_243X_HS_USB_DMA,
46 .flags = IORESOURCE_IRQ, 140 .flags = IORESOURCE_IRQ,
141 .name = "dma",
47 }, 142 },
48}; 143};
49 144
@@ -75,7 +170,7 @@ static struct musb_hdrc_platform_data musb_plat = {
75static u64 musb_dmamask = DMA_BIT_MASK(32); 170static u64 musb_dmamask = DMA_BIT_MASK(32);
76 171
77static struct platform_device musb_device = { 172static struct platform_device musb_device = {
78 .name = "musb_hdrc", 173 .name = "musb-omap2430",
79 .id = -1, 174 .id = -1,
80 .dev = { 175 .dev = {
81 .dma_mask = &musb_dmamask, 176 .dma_mask = &musb_dmamask,
@@ -91,8 +186,13 @@ void __init usb_musb_init(struct omap_musb_board_data *board_data)
91 if (cpu_is_omap243x()) { 186 if (cpu_is_omap243x()) {
92 musb_resources[0].start = OMAP243X_HS_BASE; 187 musb_resources[0].start = OMAP243X_HS_BASE;
93 } else if (cpu_is_omap3517() || cpu_is_omap3505()) { 188 } else if (cpu_is_omap3517() || cpu_is_omap3505()) {
189 musb_device.name = "musb-am35x";
94 musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE; 190 musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE;
95 musb_resources[1].start = INT_35XX_USBOTG_IRQ; 191 musb_resources[1].start = INT_35XX_USBOTG_IRQ;
192 board_data->set_phy_power = am35x_musb_phy_power;
193 board_data->clear_irq = am35x_musb_clear_irq;
194 board_data->set_mode = am35x_musb_set_mode;
195 board_data->reset = am35x_musb_reset;
96 } else if (cpu_is_omap34xx()) { 196 } else if (cpu_is_omap34xx()) {
97 musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; 197 musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
98 } else if (cpu_is_omap44xx()) { 198 } else if (cpu_is_omap44xx()) {
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index 30f112bd3e4d..8a3c05f3c1d6 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -224,7 +224,7 @@ static struct resource tusb_resources[] = {
224static u64 tusb_dmamask = ~(u32)0; 224static u64 tusb_dmamask = ~(u32)0;
225 225
226static struct platform_device tusb_device = { 226static struct platform_device tusb_device = {
227 .name = "musb_hdrc", 227 .name = "musb-tusb",
228 .id = -1, 228 .id = -1,
229 .dev = { 229 .dev = {
230 .dma_mask = &tusb_dmamask, 230 .dma_mask = &tusb_dmamask,