diff mbox series

[v4,2/3] dt-bindings: net: support for Allwinner R40 EMAC controller

Message ID 20220111160600.58384-3-boger@wirenboard.com (mailing list archive)
State New, archived
Headers show
Series sun8i: r40: second ethernet support | expand

Commit Message

Evgeny Boger Jan. 11, 2022, 4:05 p.m. UTC
R40 and A10/A20 share the same EMAC IP.
However, on R40 the EMAC reset needs to be deasserted first,
so resets property is required.

Signed-off-by: Evgeny Boger <boger@wirenboard.com>
---
 .../net/allwinner,sun4i-a10-emac.yaml         | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

Comments

Maxime Ripard Jan. 12, 2022, 9:04 a.m. UTC | #1
Hi,

On Tue, Jan 11, 2022 at 07:05:59PM +0300, Evgeny Boger wrote:
> R40 and A10/A20 share the same EMAC IP.
> However, on R40 the EMAC reset needs to be deasserted first,
> so resets property is required.
> 
> Signed-off-by: Evgeny Boger <boger@wirenboard.com>
> ---
>  .../net/allwinner,sun4i-a10-emac.yaml         | 20 ++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml
> index 8d8560a67abf..8b38b4e981fe 100644
> --- a/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml
> @@ -15,7 +15,9 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: allwinner,sun4i-a10-emac
> +    enum:
> +      - allwinner,sun4i-a10-emac
> +      - allwinner,sun8i-r40-emac
>  
>    reg:
>      maxItems: 1
> @@ -30,6 +32,19 @@ properties:
>      description: Phandle to the device SRAM
>      $ref: /schemas/types.yaml#/definitions/phandle-array
>  
> +  resets:
> +    maxItems: 1
> +
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        const: allwinner,sun8i-r40-emac
> +
> +then:
> +  required:
> +    - resets
> +
>  required:
>    - compatible
>    - reg
> @@ -42,11 +57,14 @@ unevaluatedProperties: false
>  
>  examples:
>    - |
> +    #define RST_BUS_EMAC		14
> +
>      emac: ethernet@1c0b000 {
>          compatible = "allwinner,sun4i-a10-emac";
>          reg = <0x01c0b000 0x1000>;
>          interrupts = <55>;
>          clocks = <&ahb_gates 17>;
> +        resets = <&ccu RST_BUS_EMAC>;
>          phy-handle = <&phy0>;
>          allwinner,sram = <&emac_sram 1>;
>      };

The example doesn't make much sense now, since we can't have an A10
controller with the reset line.

Either leave it like it was, or create a new example

Maxime
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml
index 8d8560a67abf..8b38b4e981fe 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml
@@ -15,7 +15,9 @@  maintainers:
 
 properties:
   compatible:
-    const: allwinner,sun4i-a10-emac
+    enum:
+      - allwinner,sun4i-a10-emac
+      - allwinner,sun8i-r40-emac
 
   reg:
     maxItems: 1
@@ -30,6 +32,19 @@  properties:
     description: Phandle to the device SRAM
     $ref: /schemas/types.yaml#/definitions/phandle-array
 
+  resets:
+    maxItems: 1
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: allwinner,sun8i-r40-emac
+
+then:
+  required:
+    - resets
+
 required:
   - compatible
   - reg
@@ -42,11 +57,14 @@  unevaluatedProperties: false
 
 examples:
   - |
+    #define RST_BUS_EMAC		14
+
     emac: ethernet@1c0b000 {
         compatible = "allwinner,sun4i-a10-emac";
         reg = <0x01c0b000 0x1000>;
         interrupts = <55>;
         clocks = <&ahb_gates 17>;
+        resets = <&ccu RST_BUS_EMAC>;
         phy-handle = <&phy0>;
         allwinner,sram = <&emac_sram 1>;
     };