diff mbox series

[v2,4/8] dt-bindings: net: renesas: Document Renesas Ethernet Switch

Message ID 20220921084745.3355107-5-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series treewide: Add R-Car S4-8 Ethernet Switch support | expand

Commit Message

Yoshihiro Shimoda Sept. 21, 2022, 8:47 a.m. UTC
Document Renesas Etherent Switch for R-Car S4-8 (r8a779f0).

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 .../bindings/net/renesas,etherswitch.yaml     | 286 ++++++++++++++++++
 1 file changed, 286 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/renesas,etherswitch.yaml

Comments

Krzysztof Kozlowski Sept. 22, 2022, 7:37 a.m. UTC | #1
On 21/09/2022 10:47, Yoshihiro Shimoda wrote:
> Document Renesas Etherent Switch for R-Car S4-8 (r8a779f0).
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  .../bindings/net/renesas,etherswitch.yaml     | 286 ++++++++++++++++++
>  1 file changed, 286 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> new file mode 100644
> index 000000000000..988d14f5c54e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml

Isn't dsa directory for this?

> @@ -0,0 +1,286 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/renesas,etherswitch.yaml#

Filename: renesas,r8a779f0-ether-switch.yaml

> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas Ethernet Switch
> +
> +maintainers:
> +  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> +
> +properties:
> +  compatible:
> +    const: renesas,r8a779f0-ether-switch
> +
> +  reg:
> +    maxItems: 2
> +
> +  reg-names:
> +    items:
> +      - const: base
> +      - const: secure_base
> +
> +  interrupts:
> +    maxItems: 47
> +
> +  interrupt-names:
> +    items:
> +      - const: mfwd_error
> +      - const: race_error
> +      - const: coma_error
> +      - const: gwca0_error
> +      - const: gwca1_error
> +      - const: etha0_error
> +      - const: etha1_error
> +      - const: etha2_error
> +      - const: gptp0_status
> +      - const: gptp1_status
> +      - const: mfwd_status
> +      - const: race_status
> +      - const: coma_status
> +      - const: gwca0_status
> +      - const: gwca1_status
> +      - const: etha0_status
> +      - const: etha1_status
> +      - const: etha2_status
> +      - const: rmac0_status
> +      - const: rmac1_status
> +      - const: rmac2_status
> +      - const: gwca0_rxtx0
> +      - const: gwca0_rxtx1
> +      - const: gwca0_rxtx2
> +      - const: gwca0_rxtx3
> +      - const: gwca0_rxtx4
> +      - const: gwca0_rxtx5
> +      - const: gwca0_rxtx6
> +      - const: gwca0_rxtx7
> +      - const: gwca1_rxtx0
> +      - const: gwca1_rxtx1
> +      - const: gwca1_rxtx2
> +      - const: gwca1_rxtx3
> +      - const: gwca1_rxtx4
> +      - const: gwca1_rxtx5
> +      - const: gwca1_rxtx6
> +      - const: gwca1_rxtx7
> +      - const: gwca0_rxts0
> +      - const: gwca0_rxts1
> +      - const: gwca1_rxts0
> +      - const: gwca1_rxts1
> +      - const: rmac0_mdio
> +      - const: rmac1_mdio
> +      - const: rmac2_mdio
> +      - const: rmac0_phy
> +      - const: rmac1_phy
> +      - const: rmac2_phy
> +
> +  clocks:
> +    maxItems: 2
> +
> +  clock-names:
> +    items:
> +      - const: fck
> +      - const: tsn
> +
> +  resets:
> +    maxItems: 2
> +
> +  reset-names:
> +    items:
> +      - const: rswitch2
> +      - const: tsn
> +
> +  iommus:
> +    maxItems: 16
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  ethernet-ports:
> +    type: object
> +
> +    properties:
> +      '#address-cells':
> +        description: Port number of ETHA (TSNA).
> +        const: 1

Blank line

> +      '#size-cells':
> +        const: 0
> +
> +    additionalProperties: false

Don't put it between properties. For nested object usually this is
before properties:

> +
> +    patternProperties:
> +      "^port@[0-9a-f]+$":
> +        type: object
> +

Skip blank line.

> +        $ref: "/schemas/net/ethernet-controller.yaml#"

No need for quotes.

> +        unevaluatedProperties: false
> +
> +        properties:
> +          reg:
> +            description:
> +              Port number of ETHA (TSNA).
> +
> +          phy-handle:
> +            description:
> +              Phandle of an Ethernet PHY.

Why do you need to mention this property? Isn't it coming from
ethernet-controller.yaml?

> +
> +          phy-mode:
> +            description:
> +              This specifies the interface used by the Ethernet PHY.
> +            enum:
> +              - mii
> +              - sgmii
> +              - usxgmii
> +
> +          phys:
> +            maxItems: 1
> +            description:
> +              Phandle of an Ethernet SERDES.

This is getting confusing. You have now:
- phy-handle
- phy
- phy-device
- phys
in one schema... although lan966x serdes seems to do the same. :/

> +
> +          mdio:
> +            $ref: "/schemas/net/mdio.yaml#"

No need for quotes. Are you sure this is property of each port? I don't
know the net/ethernet bindings that good, so I need to ask sometimes
basic questions. Other bindings seem to do it differently a bit.

> +            unevaluatedProperties: false
> +
> +        required:
> +          - phy-handle
> +          - phy-mode
> +          - phys
> +          - mdio
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - interrupts
> +  - interrupt-names
> +  - clocks
> +  - clock-names
> +  - resets
> +  - power-domains
> +  - ethernet-ports
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/power/r8a779f0-sysc.h>
> +
> +    ethernet@e6880000 {
> +            compatible = "renesas,r8a779f0-ether-switch";

Wrong indentation. Use 4 spaces.

> +            reg = <0xe6880000 0x20000>, <0xe68c0000 0x20000>;
> +            reg-names = "base", "secure_base";
> +            interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
> +                         <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
Best regards,
Krzysztof
Andrew Lunn Sept. 22, 2022, 12:13 p.m. UTC | #2
On Thu, Sep 22, 2022 at 09:37:28AM +0200, Krzysztof Kozlowski wrote:
> On 21/09/2022 10:47, Yoshihiro Shimoda wrote:
> > Document Renesas Etherent Switch for R-Car S4-8 (r8a779f0).
> > 
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  .../bindings/net/renesas,etherswitch.yaml     | 286 ++++++++++++++++++
> >  1 file changed, 286 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> > new file mode 100644
> > index 000000000000..988d14f5c54e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> 
> Isn't dsa directory for this?

This is not a DSA driver, but a pure switchdev driver. It is similar
to prestera, lan966x, sparx5, which put there binding in net.

   Andrew
Yoshihiro Shimoda Sept. 26, 2022, 6:10 a.m. UTC | #3
Hi Krzysztof,

> From: Krzysztof Kozlowski, Sent: Thursday, September 22, 2022 4:37 PM
> 
> On 21/09/2022 10:47, Yoshihiro Shimoda wrote:
> > Document Renesas Etherent Switch for R-Car S4-8 (r8a779f0).
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  .../bindings/net/renesas,etherswitch.yaml     | 286 ++++++++++++++++++
> >  1 file changed, 286 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> > new file mode 100644
> > index 000000000000..988d14f5c54e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
> 
> Isn't dsa directory for this?

As Andrew mentioned, this is not a DSA driver.

> > @@ -0,0 +1,286 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/renesas,etherswitch.yaml#
> 
> Filename: renesas,r8a779f0-ether-switch.yaml

I'll rename this file.

> > +$schema:
<snip>
> > +
> > +title: Renesas Ethernet Switch
> > +
> > +maintainers:
> > +  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: renesas,r8a779f0-ether-switch
> > +
> > +  reg:
> > +    maxItems: 2
> > +
> > +  reg-names:
> > +    items:
> > +      - const: base
> > +      - const: secure_base
> > +
> > +  interrupts:
> > +    maxItems: 47
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: mfwd_error
> > +      - const: race_error
> > +      - const: coma_error
> > +      - const: gwca0_error
> > +      - const: gwca1_error
> > +      - const: etha0_error
> > +      - const: etha1_error
> > +      - const: etha2_error
> > +      - const: gptp0_status
> > +      - const: gptp1_status
> > +      - const: mfwd_status
> > +      - const: race_status
> > +      - const: coma_status
> > +      - const: gwca0_status
> > +      - const: gwca1_status
> > +      - const: etha0_status
> > +      - const: etha1_status
> > +      - const: etha2_status
> > +      - const: rmac0_status
> > +      - const: rmac1_status
> > +      - const: rmac2_status
> > +      - const: gwca0_rxtx0
> > +      - const: gwca0_rxtx1
> > +      - const: gwca0_rxtx2
> > +      - const: gwca0_rxtx3
> > +      - const: gwca0_rxtx4
> > +      - const: gwca0_rxtx5
> > +      - const: gwca0_rxtx6
> > +      - const: gwca0_rxtx7
> > +      - const: gwca1_rxtx0
> > +      - const: gwca1_rxtx1
> > +      - const: gwca1_rxtx2
> > +      - const: gwca1_rxtx3
> > +      - const: gwca1_rxtx4
> > +      - const: gwca1_rxtx5
> > +      - const: gwca1_rxtx6
> > +      - const: gwca1_rxtx7
> > +      - const: gwca0_rxts0
> > +      - const: gwca0_rxts1
> > +      - const: gwca1_rxts0
> > +      - const: gwca1_rxts1
> > +      - const: rmac0_mdio
> > +      - const: rmac1_mdio
> > +      - const: rmac2_mdio
> > +      - const: rmac0_phy
> > +      - const: rmac1_phy
> > +      - const: rmac2_phy
> > +
> > +  clocks:
> > +    maxItems: 2
> > +
> > +  clock-names:
> > +    items:
> > +      - const: fck
> > +      - const: tsn
> > +
> > +  resets:
> > +    maxItems: 2
> > +
> > +  reset-names:
> > +    items:
> > +      - const: rswitch2
> > +      - const: tsn
> > +
> > +  iommus:
> > +    maxItems: 16
> > +
> > +  power-domains:
> > +    maxItems: 1
> > +
> > +  ethernet-ports:
> > +    type: object
> > +
> > +    properties:
> > +      '#address-cells':
> > +        description: Port number of ETHA (TSNA).
> > +        const: 1
> 
> Blank line

I'll add a blank line here.

> > +      '#size-cells':
> > +        const: 0
> > +
> > +    additionalProperties: false
> 
> Don't put it between properties. For nested object usually this is
> before properties:

I'll drop it.

> > +
> > +    patternProperties:
> > +      "^port@[0-9a-f]+$":
> > +        type: object
> > +
> 
> Skip blank line.

I got it.

> > +        $ref: "/schemas/net/ethernet-controller.yaml#"
> 
> No need for quotes.

I'll drop the quotes.

> > +        unevaluatedProperties: false
> > +
> > +        properties:
> > +          reg:
> > +            description:
> > +              Port number of ETHA (TSNA).
> > +
> > +          phy-handle:
> > +            description:
> > +              Phandle of an Ethernet PHY.
> 
> Why do you need to mention this property? Isn't it coming from
> ethernet-controller.yaml?

Indeed. I'll drop the description.

> > +
> > +          phy-mode:
> > +            description:
> > +              This specifies the interface used by the Ethernet PHY.
> > +            enum:
> > +              - mii
> > +              - sgmii
> > +              - usxgmii
> > +
> > +          phys:
> > +            maxItems: 1
> > +            description:
> > +              Phandle of an Ethernet SERDES.
> 
> This is getting confusing. You have now:
> - phy-handle
> - phy
> - phy-device
> - phys
> in one schema... although lan966x serdes seems to do the same. :/

Yes... I found the following documents have "phy" and "phy-handle" by using
git grep -l -w "phys" `git grep -l phy-handle Documentation/devicetree/bindings/`:
Documentation/devicetree/bindings/net/cdns,macb.yaml
Documentation/devicetree/bindings/net/cpsw.txt
Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml
Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml
Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml
Documentation/devicetree/bindings/phy/phy-bindings.txt

And I'm interesting that the phy-bindings.txt said the following:
-----
phys : the phandle for the PHY device (used by the PHY subsystem; not to be
       confused with the Ethernet specific 'phy' and 'phy-handle' properties,
       see Documentation/devicetree/bindings/net/ethernet.txt for these)
-----

> > +
> > +          mdio:
> > +            $ref: "/schemas/net/mdio.yaml#"
> 
> No need for quotes.

I got it.

> Are you sure this is property of each port? I don't
> know the net/ethernet bindings that good, so I need to ask sometimes
> basic questions. Other bindings seem to do it differently a bit.

Yes, each port has mdio bus.

> > +            unevaluatedProperties: false
> > +
> > +        required:
> > +          - phy-handle
> > +          - phy-mode
> > +          - phys
> > +          - mdio
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - reg-names
> > +  - interrupts
> > +  - interrupt-names
> > +  - clocks
> > +  - clock-names
> > +  - resets
> > +  - power-domains
> > +  - ethernet-ports
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +    #include <dt-bindings/power/r8a779f0-sysc.h>
> > +
> > +    ethernet@e6880000 {
> > +            compatible = "renesas,r8a779f0-ether-switch";
> 
> Wrong indentation. Use 4 spaces.

I'll fix it.

Best regards,
Yoshihiro Shimoda

> > +            reg = <0xe6880000 0x20000>, <0xe68c0000 0x20000>;
> > +            reg-names = "base", "secure_base";
> > +            interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
> > +                         <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
> Best regards,
> Krzysztof
Krzysztof Kozlowski Sept. 26, 2022, 6:50 a.m. UTC | #4
On 26/09/2022 08:10, Yoshihiro Shimoda wrote:

> I'll add a blank line here.
> 
>>> +      '#size-cells':
>>> +        const: 0
>>> +
>>> +    additionalProperties: false
>>
>> Don't put it between properties. For nested object usually this is
>> before properties:
> 
> I'll drop it.

Don't drop, but instead put it before "properties" for this nested object.

> 
>>> +
>>> +    patternProperties:
>>> +      "^port@[0-9a-f]+$":
>>> +        type: object
>>> +
>>
>> Skip blank line.
> 
> I got it.
> 
>>> +        $ref: "/schemas/net/ethernet-controller.yaml#"
>>
>> No need for quotes.
> 
> I'll drop the quotes.
> 
>>> +        unevaluatedProperties: false
>>> +
>>> +        properties:
>>> +          reg:
>>> +            description:
>>> +              Port number of ETHA (TSNA).
>>> +
>>> +          phy-handle:
>>> +            description:
>>> +              Phandle of an Ethernet PHY.
>>
>> Why do you need to mention this property? Isn't it coming from
>> ethernet-controller.yaml?
> 
> Indeed. I'll drop the description.
> 
>>> +
>>> +          phy-mode:
>>> +            description:
>>> +              This specifies the interface used by the Ethernet PHY.
>>> +            enum:
>>> +              - mii
>>> +              - sgmii
>>> +              - usxgmii
>>> +
>>> +          phys:
>>> +            maxItems: 1
>>> +            description:
>>> +              Phandle of an Ethernet SERDES.
>>
>> This is getting confusing. You have now:
>> - phy-handle
>> - phy
>> - phy-device
>> - phys
>> in one schema... although lan966x serdes seems to do the same. :/
> 
> Yes... I found the following documents have "phy" and "phy-handle" by using
> git grep -l -w "phys" `git grep -l phy-handle Documentation/devicetree/bindings/`:
> Documentation/devicetree/bindings/net/cdns,macb.yaml
> Documentation/devicetree/bindings/net/cpsw.txt
> Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml
> Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
> Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml
> Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml
> Documentation/devicetree/bindings/phy/phy-bindings.txt
> 
> And I'm interesting that the phy-bindings.txt said the following:
> -----
> phys : the phandle for the PHY device (used by the PHY subsystem; not to be
>        confused with the Ethernet specific 'phy' and 'phy-handle' properties,
>        see Documentation/devicetree/bindings/net/ethernet.txt for these)
> -----

Indeed, seems ok.

> 

Best regards,
Krzysztof
Yoshihiro Shimoda Sept. 26, 2022, 9:14 a.m. UTC | #5
> From: Krzysztof Kozlowski, Sent: Monday, September 26, 2022 3:50 PM
> 
> On 26/09/2022 08:10, Yoshihiro Shimoda wrote:
> 
> > I'll add a blank line here.
> >
> >>> +      '#size-cells':
> >>> +        const: 0
> >>> +
> >>> +    additionalProperties: false
> >>
> >> Don't put it between properties. For nested object usually this is
> >> before properties:
> >
> > I'll drop it.
> 
> Don't drop, but instead put it before "properties" for this nested object.

Oh, I got it. Thanks!
I'll put this before "properties:" like below:
-----
  ethernet-ports:
    type: object

    additionalProperties: false

    properties:
      '#address-cells':
        description: Port number of ETHA (TSNA).
        const: 1

      '#size-cells':
        const: 0
-----

Best regards,
Yoshihiro Shimoda

> >
> >>> +
> >>> +    patternProperties:
> >>> +      "^port@[0-9a-f]+$":
> >>> +        type: object
> >>> +
> >>
> >> Skip blank line.
> >
> > I got it.
> >
> >>> +        $ref: "/schemas/net/ethernet-controller.yaml#"
> >>
> >> No need for quotes.
> >
> > I'll drop the quotes.
> >
> >>> +        unevaluatedProperties: false
> >>> +
> >>> +        properties:
> >>> +          reg:
> >>> +            description:
> >>> +              Port number of ETHA (TSNA).
> >>> +
> >>> +          phy-handle:
> >>> +            description:
> >>> +              Phandle of an Ethernet PHY.
> >>
> >> Why do you need to mention this property? Isn't it coming from
> >> ethernet-controller.yaml?
> >
> > Indeed. I'll drop the description.
> >
> >>> +
> >>> +          phy-mode:
> >>> +            description:
> >>> +              This specifies the interface used by the Ethernet PHY.
> >>> +            enum:
> >>> +              - mii
> >>> +              - sgmii
> >>> +              - usxgmii
> >>> +
> >>> +          phys:
> >>> +            maxItems: 1
> >>> +            description:
> >>> +              Phandle of an Ethernet SERDES.
> >>
> >> This is getting confusing. You have now:
> >> - phy-handle
> >> - phy
> >> - phy-device
> >> - phys
> >> in one schema... although lan966x serdes seems to do the same. :/
> >
> > Yes... I found the following documents have "phy" and "phy-handle" by using
> > git grep -l -w "phys" `git grep -l phy-handle Documentation/devicetree/bindings/`:
> > Documentation/devicetree/bindings/net/cdns,macb.yaml
> > Documentation/devicetree/bindings/net/cpsw.txt
> > Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml
> > Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
> > Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml
> > Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml
> > Documentation/devicetree/bindings/phy/phy-bindings.txt
> >
> > And I'm interesting that the phy-bindings.txt said the following:
> > -----
> > phys : the phandle for the PHY device (used by the PHY subsystem; not to be
> >        confused with the Ethernet specific 'phy' and 'phy-handle' properties,
> >        see Documentation/devicetree/bindings/net/ethernet.txt for these)
> > -----
> 
> Indeed, seems ok.
> 
> >
> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Sept. 26, 2022, 9:25 a.m. UTC | #6
On 26/09/2022 11:14, Yoshihiro Shimoda wrote:

>>
>> Don't drop, but instead put it before "properties" for this nested object.
> 
> Oh, I got it. Thanks!
> I'll put this before "properties:" like below:
> -----
>   ethernet-ports:
>     type: object
> 

Without blank line here.

>     additionalProperties: false
>>     properties:

This is ok.

>       '#address-cells':
>         description: Port number of ETHA (TSNA).
>         const: 1
> 
>       '#size-cells':
>         const: 0
> -----

Best regards,
Krzysztof
Yoshihiro Shimoda Sept. 26, 2022, 10:20 a.m. UTC | #7
> From: Krzysztof Kozlowski, Sent: Monday, September 26, 2022 6:25 PM
> 
> On 26/09/2022 11:14, Yoshihiro Shimoda wrote:
> 
> >>
> >> Don't drop, but instead put it before "properties" for this nested object.
> >
> > Oh, I got it. Thanks!
> > I'll put this before "properties:" like below:
> > -----
> >   ethernet-ports:
> >     type: object
> >
> 
> Without blank line here.

I got it. Thank you very much for your support!

Best regards,
Yoshihiro Shimoda

> >     additionalProperties: false
> >>     properties:
> 
> This is ok.
> 
> >       '#address-cells':
> >         description: Port number of ETHA (TSNA).
> >         const: 1
> >
> >       '#size-cells':
> >         const: 0
> > -----
> 
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
new file mode 100644
index 000000000000..988d14f5c54e
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/renesas,etherswitch.yaml
@@ -0,0 +1,286 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/renesas,etherswitch.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Ethernet Switch
+
+maintainers:
+  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+
+properties:
+  compatible:
+    const: renesas,r8a779f0-ether-switch
+
+  reg:
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: base
+      - const: secure_base
+
+  interrupts:
+    maxItems: 47
+
+  interrupt-names:
+    items:
+      - const: mfwd_error
+      - const: race_error
+      - const: coma_error
+      - const: gwca0_error
+      - const: gwca1_error
+      - const: etha0_error
+      - const: etha1_error
+      - const: etha2_error
+      - const: gptp0_status
+      - const: gptp1_status
+      - const: mfwd_status
+      - const: race_status
+      - const: coma_status
+      - const: gwca0_status
+      - const: gwca1_status
+      - const: etha0_status
+      - const: etha1_status
+      - const: etha2_status
+      - const: rmac0_status
+      - const: rmac1_status
+      - const: rmac2_status
+      - const: gwca0_rxtx0
+      - const: gwca0_rxtx1
+      - const: gwca0_rxtx2
+      - const: gwca0_rxtx3
+      - const: gwca0_rxtx4
+      - const: gwca0_rxtx5
+      - const: gwca0_rxtx6
+      - const: gwca0_rxtx7
+      - const: gwca1_rxtx0
+      - const: gwca1_rxtx1
+      - const: gwca1_rxtx2
+      - const: gwca1_rxtx3
+      - const: gwca1_rxtx4
+      - const: gwca1_rxtx5
+      - const: gwca1_rxtx6
+      - const: gwca1_rxtx7
+      - const: gwca0_rxts0
+      - const: gwca0_rxts1
+      - const: gwca1_rxts0
+      - const: gwca1_rxts1
+      - const: rmac0_mdio
+      - const: rmac1_mdio
+      - const: rmac2_mdio
+      - const: rmac0_phy
+      - const: rmac1_phy
+      - const: rmac2_phy
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: fck
+      - const: tsn
+
+  resets:
+    maxItems: 2
+
+  reset-names:
+    items:
+      - const: rswitch2
+      - const: tsn
+
+  iommus:
+    maxItems: 16
+
+  power-domains:
+    maxItems: 1
+
+  ethernet-ports:
+    type: object
+
+    properties:
+      '#address-cells':
+        description: Port number of ETHA (TSNA).
+        const: 1
+      '#size-cells':
+        const: 0
+
+    additionalProperties: false
+
+    patternProperties:
+      "^port@[0-9a-f]+$":
+        type: object
+
+        $ref: "/schemas/net/ethernet-controller.yaml#"
+        unevaluatedProperties: false
+
+        properties:
+          reg:
+            description:
+              Port number of ETHA (TSNA).
+
+          phy-handle:
+            description:
+              Phandle of an Ethernet PHY.
+
+          phy-mode:
+            description:
+              This specifies the interface used by the Ethernet PHY.
+            enum:
+              - mii
+              - sgmii
+              - usxgmii
+
+          phys:
+            maxItems: 1
+            description:
+              Phandle of an Ethernet SERDES.
+
+          mdio:
+            $ref: "/schemas/net/mdio.yaml#"
+            unevaluatedProperties: false
+
+        required:
+          - phy-handle
+          - phy-mode
+          - phys
+          - mdio
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+  - resets
+  - power-domains
+  - ethernet-ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/r8a779f0-sysc.h>
+
+    ethernet@e6880000 {
+            compatible = "renesas,r8a779f0-ether-switch";
+            reg = <0xe6880000 0x20000>, <0xe68c0000 0x20000>;
+            reg-names = "base", "secure_base";
+            interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 289 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 291 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 292 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 293 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 294 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 295 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 296 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 298 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 301 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>;
+            interrupt-names = "mfwd_error", "race_error",
+                              "coma_error", "gwca0_error",
+                              "gwca1_error", "etha0_error",
+                              "etha1_error", "etha2_error",
+                              "gptp0_status", "gptp1_status",
+                              "mfwd_status", "race_status",
+                              "coma_status", "gwca0_status",
+                              "gwca1_status", "etha0_status",
+                              "etha1_status", "etha2_status",
+                              "rmac0_status", "rmac1_status",
+                              "rmac2_status",
+                              "gwca0_rxtx0", "gwca0_rxtx1",
+                              "gwca0_rxtx2", "gwca0_rxtx3",
+                              "gwca0_rxtx4", "gwca0_rxtx5",
+                              "gwca0_rxtx6", "gwca0_rxtx7",
+                              "gwca1_rxtx0", "gwca1_rxtx1",
+                              "gwca1_rxtx2", "gwca1_rxtx3",
+                              "gwca1_rxtx4", "gwca1_rxtx5",
+                              "gwca1_rxtx6", "gwca1_rxtx7",
+                              "gwca0_rxts0", "gwca0_rxts1",
+                              "gwca1_rxts0", "gwca1_rxts1",
+                              "rmac0_mdio", "rmac1_mdio",
+                              "rmac2_mdio",
+                              "rmac0_phy", "rmac1_phy",
+                              "rmac2_phy";
+            clocks = <&cpg CPG_MOD 1506>, <&cpg CPG_MOD 1505>;
+            clock-names = "fck", "tsn";
+            power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+            resets = <&cpg 1506>, <&cpg 1505>;
+            reset-names = "rswitch2", "tsn";
+
+            ethernet-ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+                    port@0 {
+                            reg = <0>;
+                            phy-handle = <&eth_phy0>;
+                            phy-mode = "sgmii";
+                            phys = <&eth_serdes 0>;
+                            mdio {
+                                    #address-cells = <1>;
+                                    #size-cells = <0>;
+                            };
+                    };
+                    port@1 {
+                            reg = <1>;
+                            phy-handle = <&eth_phy1>;
+                            phy-mode = "sgmii";
+                            phys = <&eth_serdes 1>;
+                            mdio {
+                                    #address-cells = <1>;
+                                    #size-cells = <0>;
+                            };
+                    };
+                    port@2 {
+                            reg = <2>;
+                            phy-handle = <&eth_phy2>;
+                            phy-mode = "sgmii";
+                            phys = <&eth_serdes 2>;
+                            mdio {
+                                    #address-cells = <1>;
+                                    #size-cells = <0>;
+                            };
+                    };
+            };
+    };