2022-05-14 01:47:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed udc

On 13/05/2022 08:57, Neal Liu wrote:
> Add device tree binding documentation for the Aspeed USB2.0 Device
> Controller.
>
> Signed-off-by: Neal Liu <[email protected]>
> ---
> .../devicetree/bindings/usb/aspeed,udc.yaml | 52 +++++++++++++++++++
> 1 file changed, 52 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/aspeed,udc.yaml

Please name the file as first compatible, so "aspeed,ast2600-udc.yaml"


>
> diff --git a/Documentation/devicetree/bindings/usb/aspeed,udc.yaml b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> new file mode 100644
> index 000000000000..d1d2f77d1c54
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (c) 2020 Facebook Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/aspeed,udc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ASPEED USB 2.0 Device Controller
> +
> +maintainers:
> + - Neal Liu <[email protected]>
> +
> +description: |+
> + The ASPEED USB 2.0 Device Controller implements 1 control endpoint and
> + 4 generic endpoints for AST260x.
> +
> + Supports independent DMA channel for each generic endpoint.
> + Supports 32/256 stages descriptor mode for all generic endpoints.
> +
> +properties:
> + compatible:
> + enum:
> + - aspeed,ast2600-udc
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1

No child properties? No ports or any other devices? No usb-hcd.yaml?
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/aspeed-clock.h>
> + udc: udc@1e6a2000 {

Node name: usb

> + compatible = "aspeed,ast2600-udc";
> + reg = <0x1e6a2000 0x300>;
> + interrupts = <9>;
> + clocks = <&syscon ASPEED_CLK_GATE_USBPORT2CLK>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_usb2bd_default>;
> + };


Best regards,
Krzysztof


2022-05-14 04:00:59

by Neal Liu

[permalink] [raw]
Subject: RE: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed udc

> -----Original Message-----
> From: Krzysztof Kozlowski <[email protected]>
> Sent: Friday, May 13, 2022 5:07 PM
> To: Neal Liu <[email protected]>; Greg Kroah-Hartman
> <[email protected]>; Rob Herring <[email protected]>;
> Krzysztof Kozlowski <[email protected]>; Joel Stanley
> <[email protected]>; Andrew Jeffery <[email protected]>; Felipe Balbi
> <[email protected]>; Sumit Semwal <[email protected]>; Christian
> König <[email protected]>; Geert Uytterhoeven <geert@linux-
> m68k.org>; Li Yang <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; dri-
> [email protected]; [email protected]; BMC-SW <BMC-
> [email protected]>
> Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed
> udc
>
> On 13/05/2022 08:57, Neal Liu wrote:
> > Add device tree binding documentation for the Aspeed USB2.0 Device
> > Controller.
> >
> > Signed-off-by: Neal Liu <[email protected]>
> > ---
> > .../devicetree/bindings/usb/aspeed,udc.yaml | 52
> +++++++++++++++++++
> > 1 file changed, 52 insertions(+)
> > create mode 100644
> > Documentation/devicetree/bindings/usb/aspeed,udc.yaml
>
> Please name the file as first compatible, so "aspeed,ast2600-udc.yaml"

Okay, I could rename it for next patch if you preferred.
But there are lots of yaml files which are not named as first compatible.

>
> >
> > diff --git a/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> > b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> > new file mode 100644
> > index 000000000000..d1d2f77d1c54
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> > @@ -0,0 +1,52 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright
> > +(c) 2020 Facebook Inc.
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/usb/aspeed,udc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ASPEED USB 2.0 Device Controller
> > +
> > +maintainers:
> > + - Neal Liu <[email protected]>
> > +
> > +description: |+
> > + The ASPEED USB 2.0 Device Controller implements 1 control endpoint
> > +and
> > + 4 generic endpoints for AST260x.
> > +
> > + Supports independent DMA channel for each generic endpoint.
> > + Supports 32/256 stages descriptor mode for all generic endpoints.
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - aspeed,ast2600-udc
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + clocks:
> > + maxItems: 1
> > +
> > + interrupts:
> > + maxItems: 1
>
> No child properties? No ports or any other devices? No usb-hcd.yaml?

Aspeed udc only has 1 port, no need extra properties for now.

> > +
> > +required:
> > + - compatible
> > + - reg
> > + - clocks
> > + - interrupts
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/aspeed-clock.h>
> > + udc: udc@1e6a2000 {
>
> Node name: usb

"udc" is more recognizable than "usb" I think. "usb" is too general, can be various like host or device.

>
> > + compatible = "aspeed,ast2600-udc";
> > + reg = <0x1e6a2000 0x300>;
> > + interrupts = <9>;
> > + clocks = <&syscon ASPEED_CLK_GATE_USBPORT2CLK>;
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&pinctrl_usb2bd_default>;
> > + };
>
>
> Best regards,
> Krzysztof

2022-05-15 21:02:55

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed udc

On 13/05/2022 17:39, Neal Liu wrote:
>> -----Original Message-----
>> From: Krzysztof Kozlowski <[email protected]>
>> Sent: Friday, May 13, 2022 5:07 PM
>> To: Neal Liu <[email protected]>; Greg Kroah-Hartman
>> <[email protected]>; Rob Herring <[email protected]>;
>> Krzysztof Kozlowski <[email protected]>; Joel Stanley
>> <[email protected]>; Andrew Jeffery <[email protected]>; Felipe Balbi
>> <[email protected]>; Sumit Semwal <[email protected]>; Christian
>> König <[email protected]>; Geert Uytterhoeven <geert@linux-
>> m68k.org>; Li Yang <[email protected]>
>> Cc: [email protected]; [email protected];
>> [email protected]; [email protected]; linux-
>> [email protected]; [email protected]; dri-
>> [email protected]; [email protected]; BMC-SW <BMC-
>> [email protected]>
>> Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed
>> udc
>>
>> On 13/05/2022 08:57, Neal Liu wrote:
>>> Add device tree binding documentation for the Aspeed USB2.0 Device
>>> Controller.
>>>
>>> Signed-off-by: Neal Liu <[email protected]>
>>> ---
>>> .../devicetree/bindings/usb/aspeed,udc.yaml | 52
>> +++++++++++++++++++
>>> 1 file changed, 52 insertions(+)
>>> create mode 100644
>>> Documentation/devicetree/bindings/usb/aspeed,udc.yaml
>>
>> Please name the file as first compatible, so "aspeed,ast2600-udc.yaml"
>
> Okay, I could rename it for next patch if you preferred.
> But there are lots of yaml files which are not named as first compatible.

Yes, I know, I quite likely I also produced such bindings, but a
specific name is rather preferred. Otherwise you will have a difficult
naming choice when your next Aspeed UDC requires new bindings file
because of some differences (not yet known now).

>
>>
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
>>> b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
>>> new file mode 100644
>>> index 000000000000..d1d2f77d1c54
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
>>> @@ -0,0 +1,52 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright
>>> +(c) 2020 Facebook Inc.
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/usb/aspeed,udc.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: ASPEED USB 2.0 Device Controller
>>> +
>>> +maintainers:
>>> + - Neal Liu <[email protected]>
>>> +
>>> +description: |+
>>> + The ASPEED USB 2.0 Device Controller implements 1 control endpoint
>>> +and
>>> + 4 generic endpoints for AST260x.
>>> +
>>> + Supports independent DMA channel for each generic endpoint.
>>> + Supports 32/256 stages descriptor mode for all generic endpoints.
>>> +
>>> +properties:
>>> + compatible:
>>> + enum:
>>> + - aspeed,ast2600-udc
>>> +
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + clocks:
>>> + maxItems: 1
>>> +
>>> + interrupts:
>>> + maxItems: 1
>>
>> No child properties? No ports or any other devices? No usb-hcd.yaml?
>
> Aspeed udc only has 1 port, no need extra properties for now.

OK

>
>>> +
>>> +required:
>>> + - compatible
>>> + - reg
>>> + - clocks
>>> + - interrupts
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> + - |
>>> + #include <dt-bindings/clock/aspeed-clock.h>
>>> + udc: udc@1e6a2000 {
>>
>> Node name: usb
>
> "udc" is more recognizable than "usb" I think. "usb" is too general, can be various like host or device.

It's still required by schema for most of USB host controllers. Existing
USB device controllers use usb as well (except Atmel mentioning gadget)
Generic name is also expected by Devicetree spec and "udc" is not on a
list of examples of generic names (usb is).


Best regards,
Krzysztof

2022-05-16 20:08:29

by Neal Liu

[permalink] [raw]
Subject: RE: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed udc

> -----Original Message-----
> From: Krzysztof Kozlowski <[email protected]>
> Sent: Sunday, May 15, 2022 4:22 AM
> To: Neal Liu <[email protected]>; Greg Kroah-Hartman
> <[email protected]>; Rob Herring <[email protected]>; Krzysztof
> Kozlowski <[email protected]>; Joel Stanley <[email protected]>;
> Andrew Jeffery <[email protected]>; Felipe Balbi <[email protected]>; Sumit
> Semwal <[email protected]>; Christian König
> <[email protected]>; Geert Uytterhoeven <[email protected]>;
> Li Yang <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; BMC-SW
> <[email protected]>
> Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed udc
>
> On 13/05/2022 17:39, Neal Liu wrote:
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <[email protected]>
> >> Sent: Friday, May 13, 2022 5:07 PM
> >> To: Neal Liu <[email protected]>; Greg Kroah-Hartman
> >> <[email protected]>; Rob Herring <[email protected]>;
> >> Krzysztof Kozlowski <[email protected]>; Joel Stanley
> >> <[email protected]>; Andrew Jeffery <[email protected]>; Felipe Balbi
> >> <[email protected]>; Sumit Semwal <[email protected]>; Christian
> >> König <[email protected]>; Geert Uytterhoeven <geert@linux-
> >> m68k.org>; Li Yang <[email protected]>
> >> Cc: [email protected]; [email protected];
> >> [email protected]; [email protected];
> >> linux- [email protected]; [email protected]; dri-
> >> [email protected]; [email protected]; BMC-SW
> >> <BMC- [email protected]>
> >> Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for
> >> aspeed udc
> >>
> >> On 13/05/2022 08:57, Neal Liu wrote:
> >>> Add device tree binding documentation for the Aspeed USB2.0 Device
> >>> Controller.
> >>>
> >>> Signed-off-by: Neal Liu <[email protected]>
> >>> ---
> >>> .../devicetree/bindings/usb/aspeed,udc.yaml | 52
> >> +++++++++++++++++++
> >>> 1 file changed, 52 insertions(+)
> >>> create mode 100644
> >>> Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> >>
> >> Please name the file as first compatible, so "aspeed,ast2600-udc.yaml"
> >
> > Okay, I could rename it for next patch if you preferred.
> > But there are lots of yaml files which are not named as first compatible.
>
> Yes, I know, I quite likely I also produced such bindings, but a specific name is
> rather preferred. Otherwise you will have a difficult naming choice when your
> next Aspeed UDC requires new bindings file because of some differences (not
> yet known now).
>
We can rename the bindings if next Aspeed UDC needs, don't you think?
Currently, Aspeed has no requirement.
> >
> >>
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> >>> b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> >>> new file mode 100644
> >>> index 000000000000..d1d2f77d1c54
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/usb/aspeed,udc.yaml
> >>> @@ -0,0 +1,52 @@
> >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) #
> >>> +Copyright
> >>> +(c) 2020 Facebook Inc.
> >>> +%YAML 1.2
> >>> +---
> >>> +$id: http://devicetree.org/schemas/usb/aspeed,udc.yaml#
> >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>> +
> >>> +title: ASPEED USB 2.0 Device Controller
> >>> +
> >>> +maintainers:
> >>> + - Neal Liu <[email protected]>
> >>> +
> >>> +description: |+
> >>> + The ASPEED USB 2.0 Device Controller implements 1 control
> >>> +endpoint and
> >>> + 4 generic endpoints for AST260x.
> >>> +
> >>> + Supports independent DMA channel for each generic endpoint.
> >>> + Supports 32/256 stages descriptor mode for all generic endpoints.
> >>> +
> >>> +properties:
> >>> + compatible:
> >>> + enum:
> >>> + - aspeed,ast2600-udc
> >>> +
> >>> + reg:
> >>> + maxItems: 1
> >>> +
> >>> + clocks:
> >>> + maxItems: 1
> >>> +
> >>> + interrupts:
> >>> + maxItems: 1
> >>
> >> No child properties? No ports or any other devices? No usb-hcd.yaml?
> >
> > Aspeed udc only has 1 port, no need extra properties for now.
>
> OK
>
> >
> >>> +
> >>> +required:
> >>> + - compatible
> >>> + - reg
> >>> + - clocks
> >>> + - interrupts
> >>> +
> >>> +additionalProperties: false
> >>> +
> >>> +examples:
> >>> + - |
> >>> + #include <dt-bindings/clock/aspeed-clock.h>
> >>> + udc: udc@1e6a2000 {
> >>
> >> Node name: usb
> >
> > "udc" is more recognizable than "usb" I think. "usb" is too general, can be
> various like host or device.
>
> It's still required by schema for most of USB host controllers. Existing USB
> device controllers use usb as well (except Atmel mentioning gadget) Generic
> name is also expected by Devicetree spec and "udc" is not on a list of
> examples of generic names (usb is).

Okay, I'll revise it for next patch.
Thanks

>
>
> Best regards,
> Krzysztof

2022-05-17 01:26:37

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] dt-bindings: usb: add documentation for aspeed udc

On 16/05/2022 03:59, Neal Liu wrote:
>>> Okay, I could rename it for next patch if you preferred.
>>> But there are lots of yaml files which are not named as first compatible.
>>
>> Yes, I know, I quite likely I also produced such bindings, but a specific name is
>> rather preferred. Otherwise you will have a difficult naming choice when your
>> next Aspeed UDC requires new bindings file because of some differences (not
>> yet known now).
>>
> We can rename the bindings if next Aspeed UDC needs, don't you think?
> Currently, Aspeed has no requirement.

So just use proper name from the beginning....


Best regards,
Krzysztof