|
@@ -387,3 +387,173 @@ static void __init setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
|
|
case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
|
|
case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
|
|
omap_mux_init_signal("mm3_rxdp",
|
|
omap_mux_init_signal("mm3_rxdp",
|
|
OMAP_PIN_INPUT_PULLDOWN);
|
|
OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ omap_mux_init_signal("mm3_rxdm",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ /* FALLTHROUGH */
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("mm3_rxrcv",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ /* FALLTHROUGH */
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
|
|
|
|
+ omap_mux_init_signal("mm3_txen_n", OMAP_PIN_OUTPUT);
|
|
|
|
+ /* FALLTHROUGH */
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("mm3_txse0",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ omap_mux_init_signal("mm3_txdat",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ break;
|
|
|
|
+ case OMAP_USBHS_PORT_MODE_UNUSED:
|
|
|
|
+ /* FALLTHROUGH */
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static
|
|
|
|
+void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
|
|
|
|
+{
|
|
|
|
+ switch (port_mode[0]) {
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("usbb1_mm_rxdp",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ omap_mux_init_signal("usbb1_mm_rxdm",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("usbb1_mm_rxrcv",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
|
|
|
|
+ omap_mux_init_signal("usbb1_mm_txen",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("usbb1_mm_txdat",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ omap_mux_init_signal("usbb1_mm_txse0",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ case OMAP_USBHS_PORT_MODE_UNUSED:
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (port_mode[1]) {
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("usbb2_mm_rxdp",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ omap_mux_init_signal("usbb2_mm_rxdm",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("usbb2_mm_rxrcv",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
|
|
|
|
+ omap_mux_init_signal("usbb2_mm_txen",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
|
|
|
|
+ case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
|
|
|
|
+ omap_mux_init_signal("usbb2_mm_txdat",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ omap_mux_init_signal("usbb2_mm_txse0",
|
|
|
|
+ OMAP_PIN_INPUT_PULLDOWN);
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ case OMAP_USBHS_PORT_MODE_UNUSED:
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
|
|
|
|
+{
|
|
|
|
+ struct omap_hwmod *uhh_hwm, *tll_hwm;
|
|
|
|
+ struct platform_device *pdev;
|
|
|
|
+ int bus_id = -1;
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
|
|
|
|
+ usbhs_data.port_mode[i] = pdata->port_mode[i];
|
|
|
|
+ usbtll_data.port_mode[i] = pdata->port_mode[i];
|
|
|
|
+ ohci_data.port_mode[i] = pdata->port_mode[i];
|
|
|
|
+ ehci_data.port_mode[i] = pdata->port_mode[i];
|
|
|
|
+ ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
|
|
|
|
+ ehci_data.regulator[i] = pdata->regulator[i];
|
|
|
|
+ }
|
|
|
|
+ ehci_data.phy_reset = pdata->phy_reset;
|
|
|
|
+ ohci_data.es2_compatibility = pdata->es2_compatibility;
|
|
|
|
+ usbhs_data.ehci_data = &ehci_data;
|
|
|
|
+ usbhs_data.ohci_data = &ohci_data;
|
|
|
|
+
|
|
|
|
+ if (cpu_is_omap34xx()) {
|
|
|
|
+ setup_ehci_io_mux(pdata->port_mode);
|
|
|
|
+ setup_ohci_io_mux(pdata->port_mode);
|
|
|
|
+
|
|
|
|
+ if (omap_rev() <= OMAP3430_REV_ES2_1)
|
|
|
|
+ usbhs_data.single_ulpi_bypass = true;
|
|
|
|
+
|
|
|
|
+ } else if (cpu_is_omap44xx()) {
|
|
|
|
+ setup_4430ehci_io_mux(pdata->port_mode);
|
|
|
|
+ setup_4430ohci_io_mux(pdata->port_mode);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
|
|
|
|
+ if (!uhh_hwm) {
|
|
|
|
+ pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
|
|
|
|
+ if (!tll_hwm) {
|
|
|
|
+ pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
|
|
|
|
+ &usbtll_data, sizeof(usbtll_data),
|
|
|
|
+ omap_uhhtll_latency,
|
|
|
|
+ ARRAY_SIZE(omap_uhhtll_latency), false);
|
|
|
|
+ if (IS_ERR(pdev)) {
|
|
|
|
+ pr_err("Could not build hwmod device %s\n",
|
|
|
|
+ USBHS_TLL_HWMODNAME);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
|
|
|
|
+ &usbhs_data, sizeof(usbhs_data),
|
|
|
|
+ omap_uhhtll_latency,
|
|
|
|
+ ARRAY_SIZE(omap_uhhtll_latency), false);
|
|
|
|
+ if (IS_ERR(pdev)) {
|
|
|
|
+ pr_err("Could not build hwmod devices %s\n",
|
|
|
|
+ USBHS_UHH_HWMODNAME);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#else
|
|
|
|
+
|
|
|
|
+void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#endif
|