2022-02-25 16:33:35

by Johan Jonker

[permalink] [raw]
Subject: Re: [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568

Hi Peter,

Lots of USB series all of a sudden.
Combine possible?

On 2/25/22 15:54, Peter Geis wrote:
> The rk3568 dwc3 controllers are backwards compatible with the rk3399.
> Add the device tree description for it.
>
> Signed-off-by: Peter Geis <[email protected]>
> ---
> Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
> index 04077f2d7faf..e3044e81cc72 100644
> --- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
> @@ -30,6 +30,7 @@ select:
> enum:
> - rockchip,rk3328-dwc3
> - rockchip,rk3399-dwc3
> + - rockchip,rk3568-dwc3
> required:
> - compatible
>
> @@ -39,6 +40,7 @@ properties:
> - enum:
> - rockchip,rk3328-dwc3
> - rockchip,rk3399-dwc3
> + - rockchip,rk3568-dwc3
> - const: snps,dwc3
>
> reg:
> @@ -75,7 +77,10 @@ properties:
> maxItems: 1
>
he
> reset-names:
> - const: usb3-otg
> + items:
> + - enum:
> + - usb3-otg
> + - usb3-host

The use of reset-names is "sort of" only related to the rk3399 legacy
node. Still using this sub node DT to not to break older existing boot
loaders.

https://github.com/torvalds/linux/search?q=usb3-otg

It's only mentioned as comment in dwc3-of-simple.c but not used:

simple->resets = of_reset_control_array_get(np, false, true,
true);
core.c uses something similar.

dwc->reset = devm_reset_control_array_get_optional_shared(dev);
if (IS_ERR(dwc->reset))
return PTR_ERR(dwc->reset);


Up to the maintainers, but I wouldn't add another variant/name for the
same thing as it also optional(= not required) and no longer needed.

Johan

===

Maybe drop PCLK_PIPE as well to reduce notifications.

See example:
https://lore.kernel.org/linux-rockchip/[email protected]/T/#u

>
> unevaluatedProperties: false
>


2022-02-26 01:22:04

by Peter Geis

[permalink] [raw]
Subject: Re: [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568

On Fri, Feb 25, 2022 at 11:07 AM Johan Jonker <[email protected]> wrote:
>
> Hi Peter,
>
> Lots of USB series all of a sudden.
> Combine possible?
>
> On 2/25/22 15:54, Peter Geis wrote:
> > The rk3568 dwc3 controllers are backwards compatible with the rk3399.
> > Add the device tree description for it.
> >
> > Signed-off-by: Peter Geis <[email protected]>
> > ---
> > Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
> > index 04077f2d7faf..e3044e81cc72 100644
> > --- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
> > +++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
> > @@ -30,6 +30,7 @@ select:
> > enum:
> > - rockchip,rk3328-dwc3
> > - rockchip,rk3399-dwc3
> > + - rockchip,rk3568-dwc3
> > required:
> > - compatible
> >
> > @@ -39,6 +40,7 @@ properties:
> > - enum:
> > - rockchip,rk3328-dwc3
> > - rockchip,rk3399-dwc3
> > + - rockchip,rk3568-dwc3
> > - const: snps,dwc3
> >
> > reg:
> > @@ -75,7 +77,10 @@ properties:
> > maxItems: 1
> >
> he
> > reset-names:
> > - const: usb3-otg
> > + items:
> > + - enum:
> > + - usb3-otg
> > + - usb3-host
>
> The use of reset-names is "sort of" only related to the rk3399 legacy
> node. Still using this sub node DT to not to break older existing boot
> loaders.
>
> https://github.com/torvalds/linux/search?q=usb3-otg
>
> It's only mentioned as comment in dwc3-of-simple.c but not used:
>
> simple->resets = of_reset_control_array_get(np, false, true,
> true);
> core.c uses something similar.
>
> dwc->reset = devm_reset_control_array_get_optional_shared(dev);
> if (IS_ERR(dwc->reset))
> return PTR_ERR(dwc->reset);
>
>
> Up to the maintainers, but I wouldn't add another variant/name for the
> same thing as it also optional(= not required) and no longer needed.

I left these named separately since they are different reset signals,
but if it isn't an issue I don't mind having them both be usb3-otg.

>
> Johan
>
> ===
>
> Maybe drop PCLK_PIPE as well to reduce notifications.

I'll be conducting testing to determine if we need PCLK_PIPE here, and
as long as it isn't working simply because it's enabled by someone
else I'll drop it.
Ideally, it would be nice to have a proper clock map for these chips,
but currently that's not in the TRM.

>
> See example:
> https://lore.kernel.org/linux-rockchip/[email protected]/T/#u
>
> >
> > unevaluatedProperties: false
> >

Thanks for the review!