krzk changed the topic of #linux-exynos to: Linux Samsung SoC Exynos and Family | https://exynos.wiki.kernel.org | This channel is logged: https://libera.irclog.whitequark.org/linux-exynos
mripard has joined #linux-exynos
ungeskriptet8 has joined #linux-exynos
ungeskriptet has quit [Ping timeout: 264 seconds]
ungeskriptet8 has quit [Ping timeout: 268 seconds]
ungeskriptet3 has joined #linux-exynos
ungeskriptet3 is now known as ungeskriptet
f_ has joined #linux-exynos
f_ has quit [Quit: To contact me, send a memo using MemoServ, PM f_[xmpp], or send an email. See https://vitali64.duckdns.org/.]
f_ has joined #linux-exynos
knuxify has joined #linux-exynos
f_ has quit [Quit: To contact me, send a memo using MemoServ, PM f_[xmpp], or send an email. See https://vitali64.duckdns.org/.]
<knuxify> decided to work on getting USB OTG working on my Galaxy Tab 3 8.0 (Exynos 4212), and after fighting with the max77693 extcon/power supply drivers for a bit to get the cable detection to work and get the pmic to supply power to OTG devices, i seem to have hit a pretty significant issue on the exynos side of things
<knuxify> namely, either the "hs_otg" controller can be on, or the ehci/ohci controller can be on, but *not* both at the same time
<knuxify> it seems to me that despite being dwc2-compatible, the "hs_otg" controller (or usbgadget as downstream calls it) does **not** provide host mode, it only does peripheral mode
<knuxify> (which would also explain why patch "ARM: dts: samsung: exynos4412-midas: add USB connector and USB OTG" didn't work)
<knuxify> instead, the host controller is separate - that's the ehci and ohci controllers
<knuxify> but only either the hsotg or the ehci/ohci controllers can be enabled (status = "okay" in dts) at the same time - otherwise they become unhappy (hsotg complains about soft reset timeout, ohci just hangs or ehci silently fails)
<knuxify> there is a "phy mode switch" register which seems to be responsible for switching the phy from device to host mode. it's set up in the phy driver (phy-exynos4x12-usb2.c) depending on whichever phy is enabled
<knuxify> in the case of both hsotg and ehci being on, this enables every phy in order - so, it first enables DEVICE and sets the mode switch to DEVICE, then it enables HOST and sets the mode switch to HOST, and so it remains
<knuxify> i have experimented with switching it on a running system and changing the value back and forth does indeed seem to redirect the usb to device/host respectively, but it still doesn't solve the issue of not being to keep both controllers up at the same time
<knuxify> so, my question: what do you think would be the best way to handle this? it seems to me that we need some sort of mechanism to switch the relevant controllers on/off depending on cable type (we can just use data from the muic extcon - check for EXTCON_USB_HOST cable type), but i'm not sure where or how such a switch could be implemented
knuxify has quit [Quit: (feel free to answer later, i'll just check the logs)]