[U-Boot] [PATCH v5 0/7] usb: Add cadence USB3 gadget/host/phy driver
sherry.sun at nxp.com
Fri Aug 30 07:14:32 UTC 2019
> On 28/08/19 7:52 PM, Sherry Sun wrote:
> > Hi Vignesh,
> >> I see that Cadence USB driver for Linux kernel is still under
> >> development and DT compatible binding is supposed to be "cdns,usb3"
> not "cdns,usb3-1.0.0".
> >> See v11:
> >> https://patch
> >> Te7SXTAQAKtF7HzOqY291upS67Eixeke9oXQ2w%3D&reserved=0
> >> Deviating from kernel binding will break sync'ing of DTs b/w kernel
> >> and U- Boot.
> > Thanks for your reminder, I only noticed the DT compatible in v5 last time.
> So I will change it to "cdns,usb3" in next version.
> >> Also, why not sync the latest host/gadget driver patches from kernel as is?
> >> That should help in borrowing bug fixes/features whenever Cadence
> >> updates kernel driver in future.
> > Since there are many differences between the cdns3 driver in uboot and
> > kernel, such as in uboot, we didn't support host mode in cdns3 core.c,
> > instead we add an
> > xhci-imx8 driver as host driver. So the patches from kernel can't be applied
> to this driver.
> I see that xhci-imx8.c is generic enough to be used with v11 upstream
> cdns3/core.c and cdns3/host.c once IMX specific stuff is moved to top level
> I see you use a separate compatible for host driver which does not match
> with kernel (as there is no separate node for host vs device). Moreover the dt
> bindings listed in patch 1/7 lists non core registers as part of Cadence USB3
> controller node.
> Above issues make it impossible to sync Kernel DT nodes with U-Boot DT
> nodes which is not acceptable for U-Boot. All non Cadence core registers and
> configurations need to part of a separate wrapper driver that then binds to
> appropriate host/device Cadence USB3 controller node based on dr_mode
> property. E.g: see who dwc3 is modeled :
> Also see cdns-ti.c in the TI U-Boot branch  )
> If there are more customization required for host driver cdns3/host.c we can
> provide vendor specific hooks/callbacks to be called from cdns3/host.c
> Current series is not usable on TI platform with Cadence USB3 IP at least in
> host mode and would need core host driver to be ported from kernel.
> Keeping Linux kernel and U-Boot driver stack in sync has a big advantage for
> you as well. It simplifies borrowing bug fixes and new features or functions
> (especially in subsystems like USB where code is pretty large)
> BTW, I have a tree with v10 of Cadence USB3 kernel driver ported to U-Boot
> here. It is based on 2019.01 U-Boot but should apply as is on the latest
> tree as well. (Tree is still missing USB3 PHY support and thus USB 3.0 support)
> and works on TI platform. I am waiting for bindings to be frozen in Linux
> before posting to U-Boot list.
> Hopefully we can find a way to collaborate!
I think your suggestions are reasonable, I agree that keep Linux kernel and U-Boot driver stack in sync is a good choice!
So I will try to test your code on i.MX8 platform later, if the common core part can work well, maybe you can post it to U-Boot list after the Linux cdns3 driver version is frozen.
>  git://git.ti.com/~vigneshr/ti-u-boot/vigneshr-ti-u-boot.git
> branch: dfu
More information about the U-Boot