[PATCH 3/5] usb: dwc3-generic: Add dependency on SIMPLE_BUS

Marek Vasut marex at denx.de
Mon Jan 23 04:37:17 CET 2023


On 1/23/23 04:08, Kunihiko Hayashi wrote:

Hello Hayashi-san,

>>> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
>>> index f010291d02..dadaa083e7 100644
>>> --- a/drivers/usb/dwc3/Kconfig
>>> +++ b/drivers/usb/dwc3/Kconfig
>>> @@ -25,14 +25,14 @@ config USB_DWC3_OMAP
>>>    config USB_DWC3_GENERIC
>>>        bool "Generic implementation of a DWC3 wrapper (aka dwc3 glue)"
>>> -    depends on DM_USB && USB_DWC3 && MISC
>>> +    depends on DM_USB && USB_DWC3 && (MISC || SIMPLE_BUS)
>>
>> I'm afraid I don't understand why this change is needed for all variants
>> of DWC3.
> 
> Although dwc3-generic is declared as UCLASS_NOP, the similar glue driver
> dwc3-meson-glx is declared as UCLASS_SIMPLE_BUS.

I think here it makes sense, because "amlogic,meson-axg-usb-ctrl" 
behaves like a bus with subnodes:

arch/arm/dts/meson-axg.dtsi:
  227 usb: usb at ffe09080 {
  228     compatible = "amlogic,meson-axg-usb-ctrl";
  229     reg = <0x0 0xffe09080 0x0 0x20>;
...
  244     dwc2: usb at ff400000 {
  245         compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
  246         reg = <0x0 0xff400000 0x0 0x40000>;
...
  255     };
  256
  257     dwc3: usb at ff500000 {
  258         compatible = "snps,dwc3";
  259         reg = <0x0 0xff500000 0x0 0x100000>;
...
  264     };
  265 };

arch/arm/dts/meson-gxl.dtsi
  17 usb: usb at d0078080 {
  18     compatible = "amlogic,meson-gxl-usb-ctrl";
  19     reg = <0x0 0xd0078080 0x0 0x20>;
...
  34     dwc2: usb at c9100000 {
  35         compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
  36         reg = <0x0 0xc9100000 0x0 0x40000>;
...
  45     };
  46
  47     dwc3: usb at c9000000 {
  48         compatible = "snps,dwc3";
  49         reg = <0x0 0xc9000000 0x0 0x100000>;
...
  54     };
  55 };

On the other hand, the PXS2 controller for example is not a bus:

arch/arm/dts/uniphier-pxs2.dtsi:
596 _usb0: usb at 65a00000 {
597     compatible = "socionext,uniphier-dwc3", "snps,dwc3";
598     status = "disabled";
599     reg = <0x65a00000 0xcd00>;
...
610 };

>> Is this needed for socionext dwc3 variant to handle the simple-mfd in
>> e.g. arch/arm/dts/uniphier-pxs3.dtsi :
>>
>> 614 usb-glue at 65b00000 {
>> 615     compatible = "socionext,uniphier-pxs3-dwc3-glue",
>> 616              "simple-mfd";
>>
>> ?
> 
> In case of U-Boot, the glue driver is probed by:
> 
>      /* FIXME: U-Boot own node */
>      usb at 65b00000 {
>              compatible = "socionext,uniphier-pxs3-dwc3";
> 
> And dwc3-uniphier is also declared as UCLASS_SIMPLE_BUS.
> Even if using "simple-mfd", this is included in drivers/core/simple-bus.c
> which is declared as UCLASS_SIMPLE_BUS.

If I understand this correctly, node compatible with 
"socionext,uniphier-pxs3-dwc3-glue" is not used at all , right ?

The generic driver binds to node compatible with 
"socionext,uniphier-dwc3" , right ?

That means, there is nothing which would be a bus, and so the 
dwc3-uniphier.c can be switched from UCLASS_SIMPLE_BUS to UCLASS_NOP , 
is that correct ?

[...]


More information about the U-Boot mailing list