2022-04-12 20:58:45

by Dylan Hung

[permalink] [raw]
Subject: [PATCH v4 1/3] dt-bindings: net: add reset property for aspeed, ast2600-mdio binding

The AST2600 MDIO bus controller has a reset control bit and must be
deasserted before manipulating the MDIO controller. By default, the
hardware asserts the reset so the driver only need to deassert it.

Regarding to the old DT blobs which don't have reset property in them,
the reset deassertion is usually done by the bootloader so the reset
property is optional to work with them.

Signed-off-by: Dylan Hung <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/net/aspeed,ast2600-mdio.yaml | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
index 1c88820cbcdf..1174c14898e1 100644
--- a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
@@ -20,10 +20,14 @@ allOf:
properties:
compatible:
const: aspeed,ast2600-mdio
+
reg:
maxItems: 1
description: The register range of the MDIO controller instance

+ resets:
+ maxItems: 1
+
required:
- compatible
- reg
@@ -39,6 +43,7 @@ examples:
reg = <0x1e650000 0x8>;
#address-cells = <1>;
#size-cells = <0>;
+ resets = <&syscon ASPEED_RESET_MII>;

ethphy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
--
2.25.1


2022-04-12 22:39:29

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] dt-bindings: net: add reset property for aspeed, ast2600-mdio binding

On Tue, 12 Apr 2022 14:56:09 +0800, Dylan Hung wrote:
> The AST2600 MDIO bus controller has a reset control bit and must be
> deasserted before manipulating the MDIO controller. By default, the
> hardware asserts the reset so the driver only need to deassert it.
>
> Regarding to the old DT blobs which don't have reset property in them,
> the reset deassertion is usually done by the bootloader so the reset
> property is optional to work with them.
>
> Signed-off-by: Dylan Hung <[email protected]>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
> ---
> .../devicetree/bindings/net/aspeed,ast2600-mdio.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.example.dts:25.35-36 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:364: Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1401: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2022-04-13 03:44:05

by Joel Stanley

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] dt-bindings: net: add reset property for aspeed, ast2600-mdio binding

On Tue, 12 Apr 2022 at 06:55, Dylan Hung <[email protected]> wrote:
>
> The AST2600 MDIO bus controller has a reset control bit and must be
> deasserted before manipulating the MDIO controller. By default, the
> hardware asserts the reset so the driver only need to deassert it.
>
> Regarding to the old DT blobs which don't have reset property in them,
> the reset deassertion is usually done by the bootloader so the reset
> property is optional to work with them.
>
> Signed-off-by: Dylan Hung <[email protected]>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
> ---
> .../devicetree/bindings/net/aspeed,ast2600-mdio.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> index 1c88820cbcdf..1174c14898e1 100644
> --- a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> @@ -20,10 +20,14 @@ allOf:
> properties:
> compatible:
> const: aspeed,ast2600-mdio
> +
> reg:
> maxItems: 1
> description: The register range of the MDIO controller instance
>
> + resets:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> @@ -39,6 +43,7 @@ examples:
> reg = <0x1e650000 0x8>;
> #address-cells = <1>;
> #size-cells = <0>;
> + resets = <&syscon ASPEED_RESET_MII>;

You will need to include the definition for ASPEED_RESET_MII at the
start of the example:

#include <dt-bindings/clock/ast2600-clock.h>

You can test the bindings example by doing this:

pip install dtschema

make dt_binding_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml

Cheers,

Joel

>
> ethphy0: ethernet-phy@0 {
> compatible = "ethernet-phy-ieee802.3-c22";
> --
> 2.25.1
>

2022-04-13 06:37:24

by Dylan Hung

[permalink] [raw]
Subject: RE: [PATCH v4 1/3] dt-bindings: net: add reset property for aspeed, ast2600-mdio binding

> -----Original Message-----
> From: Joel Stanley [mailto:[email protected]]
> Sent: 2022年4月13日 10:34 AM
> To: Dylan Hung <[email protected]>
> Cc: Rob Herring <[email protected]>; Andrew Jeffery <[email protected]>;
> Andrew Lunn <[email protected]>; [email protected]; Russell King
> <[email protected]>; David S . Miller <[email protected]>; Jakub
> Kicinski <[email protected]>; [email protected]; Philipp Zabel
> <[email protected]>; devicetree <[email protected]>; Linux
> ARM <[email protected]>; linux-aspeed
> <[email protected]>; Linux Kernel Mailing List
> <[email protected]>; Networking <[email protected]>;
> Krzysztof Kozlowski <[email protected]>; BMC-SW
> <[email protected]>; Krzysztof Kozlowski <[email protected]>
> Subject: Re: [PATCH v4 1/3] dt-bindings: net: add reset property for aspeed,
> ast2600-mdio binding
>
> On Tue, 12 Apr 2022 at 06:55, Dylan Hung <[email protected]>
> wrote:
> >
> > The AST2600 MDIO bus controller has a reset control bit and must be
> > deasserted before manipulating the MDIO controller. By default, the
> > hardware asserts the reset so the driver only need to deassert it.
> >
> > Regarding to the old DT blobs which don't have reset property in them,
> > the reset deassertion is usually done by the bootloader so the reset
> > property is optional to work with them.
> >
> > Signed-off-by: Dylan Hung <[email protected]>
> > Reviewed-by: Krzysztof Kozlowski <[email protected]>
> > ---
> > .../devicetree/bindings/net/aspeed,ast2600-mdio.yaml | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> > b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> > index 1c88820cbcdf..1174c14898e1 100644
> > --- a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> > +++ b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml
> > @@ -20,10 +20,14 @@ allOf:
> > properties:
> > compatible:
> > const: aspeed,ast2600-mdio
> > +
> > reg:
> > maxItems: 1
> > description: The register range of the MDIO controller instance
> >
> > + resets:
> > + maxItems: 1
> > +
> > required:
> > - compatible
> > - reg
> > @@ -39,6 +43,7 @@ examples:
> > reg = <0x1e650000 0x8>;
> > #address-cells = <1>;
> > #size-cells = <0>;
> > + resets = <&syscon ASPEED_RESET_MII>;
>
> You will need to include the definition for ASPEED_RESET_MII at the start of
> the example:
>
> #include <dt-bindings/clock/ast2600-clock.h>
>
> You can test the bindings example by doing this:
>
> pip install dtschema
>
> make dt_binding_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/aspeed,ast2600-
> mdio.yaml
>

Thank you for your comment, I have reproduced this error and fixed it on my side.
The change will be included in V5.

> Cheers,
>
> Joel
>
> >
> > ethphy0: ethernet-phy@0 {
> > compatible = "ethernet-phy-ieee802.3-c22";
> > --
> > 2.25.1
> >