Skip to contentSkip to conversation

usb: ehci-omap: Add Support for DM_USB and OF_CONTROL

PATCH New Adam Ford 2 participants 2 messages May 16, 2020

Subsystems (4)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v3 1/1 usb: ehci-omap: Add Support for DM_USB and OF_CONTROL

The omap3.dtsi file shows the usbhshost node with two sub-nodes for ohci and ehci. This patch file creates the usbhshost, and pulls the portX-mode information. It then locates the EHCI sub-node, and initializes the EHCI controller with the info pulled from the usbhshost node.

There is still more to do since there isn't an actual link between the 'phys' reference and the corresponding phy driver, and there is no nop-xceiv driver yet.

In the meantime, the older style reference to CONFIG_OMAP_EHCI_PHYx_RESET_GPIO is still needed to pull the phy out of reset until the phy driver is completed and the phandle reference is made.

---
V3: The omap3 device tree shows a parent node called usbhshost and
a subnode called usbhsehci. V3 splits this into two different
drivers: one for the parent which initializes the HCD, and one for the actual EHCI node, which registers the EHCI when 'start usb' is used.

This simplifies both drivers so each only has one task, eliminates one extra #ifdef by moving some of the code around to make it easier to read, refines the code that checks each port type, and lets the EHCI probe handle the return code from ehci_register.

V2: Rebase on master. There was some discussion a year ago, but
I could not replicate the build issues on Travis, and Heiko beleives it was related to a different patch. I'd like to at least get the EHCI working again for device tree enabled omap3 boards using the EHCI controller. We can progressively add features/functions as we go. This as been tested to work on both the AM3517-EVM and the Logic PD SOM-LV.

arch/arm/include/asm/ehci-omap.h +2 -0
index 1549f7bf21..f970bba937 100644
@@ -123,6 +123,7 @@ struct omap_ehci {
 	u32 insreg08;		/* 0xb0 */
 };
 
+#if !CONFIG_IS_ENABLED(DM_USB) || !CONFIG_IS_ENABLED(OF_CONTROL)
 /*
  * FIXME: forward declaration of this structs needed because omap got the
  * ehci implementation backwards. move out ehci_hcd_x from board files
@@ -133,5 +134,6 @@ struct ehci_hcor;
 int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata,
 		       struct ehci_hccr **hccr, struct ehci_hcor **hcor);
 int omap_ehci_hcd_stop(void);
+#endif
 
 #endif /* _OMAP_COMMON_EHCI_H_ */
drivers/usb/host/ehci-omap.c +120 -3

144 lines not on this page · raw message

Signature · 1 line
2.25.1
Applied
#1 lore raw

PATCH v3 1/1 usb: ehci-omap: Add Support for DM_USB and OF_CONTROL

Quoted 6 lines · Adam Ford

The omap3.dtsi file shows the usbhshost node with two sub-nodes for ohci and ehci. This patch file creates the usbhshost, and pulls the portX-mode information. It then locates the EHCI sub-node, and initializes the EHCI controller with the info pulled from the usbhshost node.

Quoted 8 lines

There is still more to do since there isn't an actual link between the 'phys' reference and the corresponding phy driver, and there is no nop-xceiv driver yet.

In the meantime, the older style reference to CONFIG_OMAP_EHCI_PHYx_RESET_GPIO is still needed to pull the phy out of reset until the phy driver is completed and the phandle reference is made.

Applied, thanks.