On 2/8/21 7:42 PM, Andre Przywara wrote: > On Sun, 7 Feb 2021 23:57:23 -0600 > Samuel Holland <sam...@sholland.org> wrote: > > (CC:ing Simon and Kever) > >> Some platforms, like the Allwinner H6, do not have a separate glue layer >> around the dwc3. Instead, they rely on the clocks/resets/phys referenced >> from the dwc3 DT node itself. Add support for enabling the clocks/resets >> referenced from the dwc3 DT node. >> >> Signed-off-by: Samuel Holland <sam...@sholland.org> > > That looks alright on a first glance, but have you checked how this > interacts with and relates to dwc3-of-simple.c? > This seems to do similar things?
Yes, they do the same thing, but with a different DT binding. dwc3-of-simple binds to, and expects the clocks/resets to be in, the DT node _containing_ the snps,dwc3 node. The xhci-dwc3 driver binds to the snps,dwc3 node itself. This is why other platforms were not affected by the change I don't think there's any way to attach two drivers to the same DT node at the same time, so we cannot take advantage of the dwc3-of-simple code without rearranging the device tree. Interestingly, Linux has supported the H6 in its version of dwc3-of-simple since commit e362098f0e12 ("usb: dwc3: of-simple: Add compatible for Allwinner H6 platform"). But the device tree ended up not using a glue layer node or this compatible. Maybe a better forward is to modify the device tree to be more similar to most other platforms? On the other hand, as you found, Hisilicon and Unipher platforms use the same binding as Allwinner. It's unfortunate that there are two distinct but equally "correct" ways to represent the same hardware. Cheers, Samuel