aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-davinci/usb.c6
-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
-rw-r--r--arch/arm/plat-omap/include/plat/omap44xx.h5
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h10
16 files changed, 471 insertions, 34 deletions
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 31f0cbea0caa..23d2b6d9fa63 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -64,17 +64,19 @@ static struct resource usb_resources[] = {
64 { 64 {
65 .start = IRQ_USBINT, 65 .start = IRQ_USBINT,
66 .flags = IORESOURCE_IRQ, 66 .flags = IORESOURCE_IRQ,
67 .name = "mc"
67 }, 68 },
68 { 69 {
69 /* placeholder for the dedicated CPPI IRQ */ 70 /* placeholder for the dedicated CPPI IRQ */
70 .flags = IORESOURCE_IRQ, 71 .flags = IORESOURCE_IRQ,
72 .name = "dma"
71 }, 73 },
72}; 74};
73 75
74static u64 usb_dmamask = DMA_BIT_MASK(32); 76static u64 usb_dmamask = DMA_BIT_MASK(32);
75 77
76static struct platform_device usb_dev = { 78static struct platform_device usb_dev = {
77 .name = "musb_hdrc", 79 .name = "musb-davinci",
78 .id = -1, 80 .id = -1,
79 .dev = { 81 .dev = {
80 .platform_data = &usb_data, 82 .platform_data = &usb_data,
@@ -110,6 +112,7 @@ static struct resource da8xx_usb20_resources[] = {
110 { 112 {
111 .start = IRQ_DA8XX_USB_INT, 113 .start = IRQ_DA8XX_USB_INT,
112 .flags = IORESOURCE_IRQ, 114 .flags = IORESOURCE_IRQ,
115 .name = "mc",
113 }, 116 },
114}; 117};
115 118
@@ -121,6 +124,7 @@ int __init da8xx_register_usb20(unsigned mA, unsigned potpgt)
121 124
122 usb_dev.resource = da8xx_usb20_resources; 125 usb_dev.resource = da8xx_usb20_resources;
123 usb_dev.num_resources = ARRAY_SIZE(da8xx_usb20_resources); 126 usb_dev.num_resources = ARRAY_SIZE(da8xx_usb20_resources);
127 usb_dev.name = "musb-da8xx";
124 128
125 return platform_device_register(&usb_dev); 129 return platform_device_register(&usb_dev);
126} 130}
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ab784bfde908..766727c4031d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -44,6 +44,7 @@ config ARCH_OMAP4
44 select ARM_GIC 44 select ARM_GIC
45 select PL310_ERRATA_588369 45 select PL310_ERRATA_588369
46 select ARM_ERRATA_720789 46 select ARM_ERRATA_720789
47 select USB_ARCH_HAS_EHCI
47 48
48comment "OMAP Core Type" 49comment "OMAP Core Type"
49 depends on ARCH_OMAP2 50 depends on ARCH_OMAP2
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 60e51bcf53bd..194863680fe0 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -168,9 +168,11 @@ obj-$(CONFIG_MACH_IGEP0030) += board-igep0030.o \
168obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ 168obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
169 hsmmc.o 169 hsmmc.o
170obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ 170obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \
171 hsmmc.o 171 hsmmc.o \
172 omap_phy_internal.o
172obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ 173obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
173 hsmmc.o 174 hsmmc.o \
175 omap_phy_internal.o
174 176
175obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o 177obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
176 178
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index df5a425a49d1..5aef69521e36 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -42,6 +42,7 @@
42#define ETH_KS8851_IRQ 34 42#define ETH_KS8851_IRQ 34
43#define ETH_KS8851_POWER_ON 48 43#define ETH_KS8851_POWER_ON 48
44#define ETH_KS8851_QUART 138 44#define ETH_KS8851_QUART 138
45#define OMAP4SDP_MDM_PWR_EN_GPIO 157
45#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 46#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
46#define OMAP4_SFH7741_ENABLE_GPIO 188 47#define OMAP4_SFH7741_ENABLE_GPIO 188
47 48
@@ -225,12 +226,29 @@ static void __init omap_4430sdp_init_irq(void)
225 omap_gpio_init(); 226 omap_gpio_init();
226} 227}
227 228
229static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
230 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
231 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
232 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
233 .phy_reset = false,
234 .reset_gpio_port[0] = -EINVAL,
235 .reset_gpio_port[1] = -EINVAL,
236 .reset_gpio_port[2] = -EINVAL,
237};
238
228static struct omap_musb_board_data musb_board_data = { 239static struct omap_musb_board_data musb_board_data = {
229 .interface_type = MUSB_INTERFACE_UTMI, 240 .interface_type = MUSB_INTERFACE_UTMI,
230 .mode = MUSB_PERIPHERAL, 241 .mode = MUSB_OTG,
231 .power = 100, 242 .power = 100,
232}; 243};
233 244
245static struct twl4030_usb_data omap4_usbphy_data = {
246 .phy_init = omap4430_phy_init,
247 .phy_exit = omap4430_phy_exit,
248 .phy_power = omap4430_phy_power,
249 .phy_set_clock = omap4430_phy_set_clk,
250};
251
234static struct omap2_hsmmc_info mmc[] = { 252static struct omap2_hsmmc_info mmc[] = {
235 { 253 {
236 .mmc = 1, 254 .mmc = 1,
@@ -450,6 +468,7 @@ static struct twl4030_platform_data sdp4430_twldata = {
450 .vaux1 = &sdp4430_vaux1, 468 .vaux1 = &sdp4430_vaux1,
451 .vaux2 = &sdp4430_vaux2, 469 .vaux2 = &sdp4430_vaux2,
452 .vaux3 = &sdp4430_vaux3, 470 .vaux3 = &sdp4430_vaux3,
471 .usb = &omap4_usbphy_data
453}; 472};
454 473
455static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { 474static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = {
@@ -514,11 +533,15 @@ static void __init omap_4430sdp_init(void)
514 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); 533 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
515 omap_serial_init(); 534 omap_serial_init();
516 omap4_twl6030_hsmmc_init(mmc); 535 omap4_twl6030_hsmmc_init(mmc);
517 /* OMAP4 SDP uses internal transceiver so register nop transceiver */ 536
518 usb_nop_xceiv_register(); 537 /* Power on the ULPI PHY */
519 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ 538 if (gpio_is_valid(OMAP4SDP_MDM_PWR_EN_GPIO)) {
520 if (!cpu_is_omap44xx()) 539 /* FIXME: Assumes pad is already muxed for GPIO mode */
521 usb_musb_init(&musb_board_data); 540 gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3");
541 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);
542 }
543 usb_ehci_init(&ehci_pdata);
544 usb_musb_init(&musb_board_data);
522 545
523 status = omap_ethernet_init(); 546 status = omap_ethernet_init();
524 if (status) { 547 if (status) {
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e823c7042ab3..62e3ea007c76 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 1ecd0a6cefb7..9207c5849c0e 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -133,10 +133,17 @@ error1:
133 133
134static struct omap_musb_board_data musb_board_data = { 134static struct omap_musb_board_data musb_board_data = {
135 .interface_type = MUSB_INTERFACE_UTMI, 135 .interface_type = MUSB_INTERFACE_UTMI,
136 .mode = MUSB_PERIPHERAL, 136 .mode = MUSB_OTG,
137 .power = 100, 137 .power = 100,
138}; 138};
139 139
140static struct twl4030_usb_data omap4_usbphy_data = {
141 .phy_init = omap4430_phy_init,
142 .phy_exit = omap4430_phy_exit,
143 .phy_power = omap4430_phy_power,
144 .phy_set_clock = omap4430_phy_set_clk,
145};
146
140static struct omap2_hsmmc_info mmc[] = { 147static struct omap2_hsmmc_info mmc[] = {
141 { 148 {
142 .mmc = 1, 149 .mmc = 1,
@@ -345,6 +352,7 @@ static struct twl4030_platform_data omap4_panda_twldata = {
345 .vaux1 = &omap4_panda_vaux1, 352 .vaux1 = &omap4_panda_vaux1,
346 .vaux2 = &omap4_panda_vaux2, 353 .vaux2 = &omap4_panda_vaux2,
347 .vaux3 = &omap4_panda_vaux3, 354 .vaux3 = &omap4_panda_vaux3,
355 .usb = &omap4_usbphy_data,
348}; 356};
349 357
350static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = { 358static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
@@ -377,9 +385,7 @@ static void __init omap4_panda_init(void)
377 /* OMAP4 Panda uses internal transceiver so register nop transceiver */ 385 /* OMAP4 Panda uses internal transceiver so register nop transceiver */
378 usb_nop_xceiv_register(); 386 usb_nop_xceiv_register();
379 omap4_ehci_init(); 387 omap4_ehci_init();
380 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ 388 usb_musb_init(&musb_board_data);
381 if (!cpu_is_omap44xx())
382 usb_musb_init(&musb_board_data);
383} 389}
384 390
385static void __init omap4_panda_map_io(void) 391static 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 21f856252ad8..831e25c89d2d 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 e32afcbdfb88..a9c60b7843e2 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 d85ecd5aebfd..0579604d4f25 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3278,6 +3278,7 @@ static struct omap_clk omap3xxx_clks[] = {
3278 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2 | CK_AM35XX), 3278 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2 | CK_AM35XX),
3279 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2 | CK_AM35XX), 3279 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2 | CK_AM35XX),
3280 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2 | CK_AM35XX), 3280 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2 | CK_AM35XX),
3281 CLK("ehci-omap.0", "usbtll_fck", &usbtll_fck, CK_3430ES2 | CK_AM35XX),
3281 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3282 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3282 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3283 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3283 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3284 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
@@ -3305,14 +3306,15 @@ static struct omap_clk omap3xxx_clks[] = {
3305 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), 3306 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
3306 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2), 3307 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2),
3307 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), 3308 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX),
3308 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), 3309 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1, CK_3430ES1),
3309 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2), 3310 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2, CK_3430ES2),
3310 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), 3311 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX),
3311 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), 3312 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX),
3312 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X), 3313 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X),
3313 CLK(NULL, "pka_ick", &pka_ick, CK_343X), 3314 CLK(NULL, "pka_ick", &pka_ick, CK_343X),
3314 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3315 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3315 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX), 3316 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX),
3317 CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX),
3316 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), 3318 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX),
3317 CLK(NULL, "icr_ick", &icr_ick, CK_343X), 3319 CLK(NULL, "icr_ick", &icr_ick, CK_343X),
3318 CLK("omap-aes", "ick", &aes2_ick, CK_343X), 3320 CLK("omap-aes", "ick", &aes2_ick, CK_343X),
@@ -3358,8 +3360,11 @@ static struct omap_clk omap3xxx_clks[] = {
3358 CLK(NULL, "cam_ick", &cam_ick, CK_343X), 3360 CLK(NULL, "cam_ick", &cam_ick, CK_343X),
3359 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X), 3361 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X),
3360 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2 | CK_AM35XX), 3362 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2 | CK_AM35XX),
3363 CLK("ehci-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2 | CK_AM35XX),
3361 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2 | CK_AM35XX), 3364 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2 | CK_AM35XX),
3365 CLK("ehci-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2 | CK_AM35XX),
3362 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2 | CK_AM35XX), 3366 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2 | CK_AM35XX),
3367 CLK("ehci-omap.0", "usbhost_ick", &usbhost_ick, CK_3430ES2 | CK_AM35XX),
3363 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2), 3368 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2),
3364 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3369 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
3365 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), 3370 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
@@ -3437,8 +3442,8 @@ static struct omap_clk omap3xxx_clks[] = {
3437 CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX), 3442 CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX),
3438 CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), 3443 CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX),
3439 CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), 3444 CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX),
3440 CLK("musb_hdrc", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), 3445 CLK("musb-am35x", "ick", &hsotgusb_ick_am35xx, CK_AM35XX),
3441 CLK("musb_hdrc", "fck", &hsotgusb_fck_am35xx, CK_AM35XX), 3446 CLK("musb-am35x", "fck", &hsotgusb_fck_am35xx, CK_AM35XX),
3442 CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX), 3447 CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX),
3443 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX), 3448 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX),
3444}; 3449};
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 1599836ba3d9..bfcd19f8368c 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -2937,6 +2937,7 @@ static struct omap_clk omap44xx_clks[] = {
2937 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), 2937 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
2938 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), 2938 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
2939 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), 2939 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
2940 CLK("ehci-omap.0", "fs_fck", &usb_host_fs_fck, CK_443X),
2940 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X), 2941 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
2941 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X), 2942 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
2942 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X), 2943 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
@@ -2948,14 +2949,18 @@ static struct omap_clk omap44xx_clks[] = {
2948 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), 2949 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
2949 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), 2950 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
2950 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X), 2951 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
2952 CLK("ehci-omap.0", "hs_fck", &usb_host_hs_fck, CK_443X),
2953 CLK("ehci-omap.0", "usbhost_ick", &dummy_ck, CK_443X),
2951 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X), 2954 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
2952 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X), 2955 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
2953 CLK("musb_hdrc", "ick", &usb_otg_hs_ick, CK_443X), 2956 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
2954 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X), 2957 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X),
2955 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X), 2958 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
2956 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X), 2959 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
2957 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X), 2960 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
2958 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X), 2961 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
2962 CLK("ehci-omap.0", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
2963 CLK("ehci-omap.0", "usbtll_fck", &dummy_ck, CK_443X),
2959 CLK(NULL, "usim_ck", &usim_ck, CK_443X), 2964 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
2960 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 2965 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
2961 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 2966 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 64a0112b70a5..7cb3c18a5e20 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -223,7 +223,7 @@ static struct resource tusb_resources[] = {
223static u64 tusb_dmamask = ~(u32)0; 223static u64 tusb_dmamask = ~(u32)0;
224 224
225static struct platform_device tusb_device = { 225static struct platform_device tusb_device = {
226 .name = "musb_hdrc", 226 .name = "musb-tusb",
227 .id = -1, 227 .id = -1,
228 .dev = { 228 .dev = {
229 .dma_mask = &tusb_dmamask, 229 .dma_mask = &tusb_dmamask,
diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h
index 8b3f12ff5cbc..ea2b8a6306e7 100644
--- a/arch/arm/plat-omap/include/plat/omap44xx.h
+++ b/arch/arm/plat-omap/include/plat/omap44xx.h
@@ -52,5 +52,10 @@
52#define OMAP4_MMU1_BASE 0x55082000 52#define OMAP4_MMU1_BASE 0x55082000
53#define OMAP4_MMU2_BASE 0x4A066000 53#define OMAP4_MMU2_BASE 0x4A066000
54 54
55#define OMAP44XX_USBTLL_BASE (L4_44XX_BASE + 0x62000)
56#define OMAP44XX_UHH_CONFIG_BASE (L4_44XX_BASE + 0x64000)
57#define OMAP44XX_HSUSB_OHCI_BASE (L4_44XX_BASE + 0x64800)
58#define OMAP44XX_HSUSB_EHCI_BASE (L4_44XX_BASE + 0x64C00)
59
55#endif /* __ASM_ARCH_OMAP44XX_H */ 60#endif /* __ASM_ARCH_OMAP44XX_H */
56 61
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 59c7fe731f28..450a332f1009 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -11,6 +11,7 @@ enum ehci_hcd_omap_mode {
11 EHCI_HCD_OMAP_MODE_UNKNOWN, 11 EHCI_HCD_OMAP_MODE_UNKNOWN,
12 EHCI_HCD_OMAP_MODE_PHY, 12 EHCI_HCD_OMAP_MODE_PHY,
13 EHCI_HCD_OMAP_MODE_TLL, 13 EHCI_HCD_OMAP_MODE_TLL,
14 EHCI_HCD_OMAP_MODE_HSIC,
14}; 15};
15 16
16enum ohci_omap3_port_mode { 17enum ohci_omap3_port_mode {
@@ -69,6 +70,10 @@ struct omap_musb_board_data {
69 u8 mode; 70 u8 mode;
70 u16 power; 71 u16 power;
71 unsigned extvbus:1; 72 unsigned extvbus:1;
73 void (*set_phy_power)(u8 on);
74 void (*clear_irq)(void);
75 void (*set_mode)(u8 mode);
76 void (*reset)(void);
72}; 77};
73 78
74enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI}; 79enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
@@ -79,6 +84,11 @@ extern void usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata);
79 84
80extern void usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata); 85extern void usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata);
81 86
87extern int omap4430_phy_power(struct device *dev, int ID, int on);
88extern int omap4430_phy_set_clk(struct device *dev, int on);
89extern int omap4430_phy_init(struct device *dev);
90extern int omap4430_phy_exit(struct device *dev);
91
82#endif 92#endif
83 93
84 94