diff mbox series

dt-bindings: net: cdns,macb: Convert to json-schema

Message ID 104dcbfd22f95fc77de9fe15e8abd83869603ea5.1637927673.git.geert@linux-m68k.org
State Accepted, archived
Headers show
Series dt-bindings: net: cdns,macb: Convert to json-schema | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 162 lines checked
robh/dt-meta-schema success
robh/dtbs-check success

Commit Message

Geert Uytterhoeven Nov. 26, 2021, 11:57 a.m. UTC
Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
documentation to json-schema.

Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
Remove PicoXcell bindings")) as there are active users on non-PicoXcell
platforms.
Add missing "ether_clk" clock.
Add missing properties.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 .../devicetree/bindings/net/cdns,macb.yaml    | 162 ++++++++++++++++++
 .../devicetree/bindings/net/macb.txt          |  60 -------
 2 files changed, 162 insertions(+), 60 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/cdns,macb.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/macb.txt

Comments

Nicolas Ferre Nov. 29, 2021, 1:21 p.m. UTC | #1
On 26/11/2021 at 12:57, Geert Uytterhoeven wrote:
> Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
> documentation to json-schema.
> 
> Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
> Remove PicoXcell bindings")) as there are active users on non-PicoXcell
> platforms.
> Add missing "ether_clk" clock.
> Add missing properties.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

This is very appreciated work Geert! Thanks for having made the comments 
for each compatible string very explicit.

With my very limited knowledge of Yaml DT format:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thanks! Best regards,
   Nicolas


> ---
>   .../devicetree/bindings/net/cdns,macb.yaml    | 162 ++++++++++++++++++
>   .../devicetree/bindings/net/macb.txt          |  60 -------
>   2 files changed, 162 insertions(+), 60 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/net/cdns,macb.yaml
>   delete mode 100644 Documentation/devicetree/bindings/net/macb.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
> new file mode 100644
> index 0000000000000000..c7d00350430aa503
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
> @@ -0,0 +1,162 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/cdns,macb.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cadence MACB/GEM Ethernet controller
> +
> +maintainers:
> +  - Nicolas Ferre <nicolas.ferre@microchip.com>
> +  - Claudiu Beznea <claudiu.beznea@microchip.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - cdns,at91rm9200-emac  # Atmel at91rm9200 SoC
> +          - const: cdns,emac          # Generic
> +
> +      - items:
> +          - enum:
> +              - cdns,zynq-gem         # Xilinx Zynq-7xxx SoC
> +              - cdns,zynqmp-gem       # Xilinx Zynq Ultrascale+ MPSoC
> +          - const: cdns,gem           # Generic
> +
> +      - items:
> +          - enum:
> +              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs
> +              - cdns,sam9x60-macb     # Microchip sam9x60 SoC
> +          - const: cdns,macb          # Generic
> +
> +      - items:
> +          - enum:
> +              - atmel,sama5d3-macb    # 10/100Mbit IP on Atmel sama5d3 SoCs
> +          - enum:
> +              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs.
> +          - const: cdns,macb          # Generic
> +
> +      - enum:
> +          - atmel,sama5d29-gem        # GEM XL IP (10/100) on Atmel sama5d29 SoCs
> +          - atmel,sama5d2-gem         # GEM IP (10/100) on Atmel sama5d2 SoCs
> +          - atmel,sama5d3-gem         # Gigabit IP on Atmel sama5d3 SoCs
> +          - atmel,sama5d4-gem         # GEM IP (10/100) on Atmel sama5d4 SoCs
> +          - cdns,at32ap7000-macb      # Other 10/100 usage or use the generic form
> +          - cdns,np4-macb             # NP4 SoC devices
> +          - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
> +          - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
> +          - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC
> +          - cdns,emac                 # Generic
> +          - cdns,gem                  # Generic
> +          - cdns,macb                 # Generic
> +
> +  reg:
> +    minItems: 1
> +    items:
> +      - description: Basic register set
> +      - description: GEMGXL Management block registers on SiFive FU540-C000 SoC
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 8
> +    description: One interrupt per available hardware queue
> +
> +  clocks:
> +    minItems: 1
> +    maxItems: 5
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - enum: [ ether_clk, hclk, pclk ]
> +      - enum: [ hclk, pclk ]
> +      - const: tx_clk
> +      - enum: [ rx_clk, tsu_clk ]
> +      - const: tsu_clk
> +
> +  local-mac-address: true
> +
> +  phy-mode: true
> +
> +  phy-handle: true
> +
> +  fixed-link: true
> +
> +  iommus:
> +    maxItems: 1
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 0
> +
> +  '#stream-id-cells':
> +    const: 1
> +
> +  mdio:
> +    type: object
> +    description:
> +      Node containing PHY children. If this node is not present, then PHYs will
> +      be direct children.
> +
> +patternProperties:
> +  "^ethernet-phy@[0-9a-f]$":
> +    type: object
> +    $ref: ethernet-phy.yaml#
> +
> +    properties:
> +      reset-gpios: true
> +
> +      magic-packet:
> +        description:
> +          Indicates that the hardware supports waking up via magic packet.
> +
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - phy-mode
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml#
> +
> +  - if:
> +      not:
> +        properties:
> +          compatible:
> +            contains:
> +              const: sifive,fu540-c000-gem
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 1
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    macb0: ethernet@fffc4000 {
> +            compatible = "cdns,at32ap7000-macb";
> +            reg = <0xfffc4000 0x4000>;
> +            interrupts = <21>;
> +            phy-mode = "rmii";
> +            local-mac-address = [3a 0e 03 04 05 06];
> +            clock-names = "pclk", "hclk", "tx_clk";
> +            clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            ethernet-phy@1 {
> +                    reg = <0x1>;
> +                    reset-gpios = <&pioE 6 1>;
> +            };
> +    };
> diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
> deleted file mode 100644
> index a1b06fd1962e4d93..0000000000000000
> --- a/Documentation/devicetree/bindings/net/macb.txt
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -* Cadence MACB/GEM Ethernet controller
> -
> -Required properties:
> -- compatible: Should be "cdns,[<chip>-]{macb|gem}"
> -  Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
> -  Use "cdns,at91sam9260-macb" for Atmel at91sam9 SoCs.
> -  Use "cdns,sam9x60-macb" for Microchip sam9x60 SoC.
> -  Use "cdns,np4-macb" for NP4 SoC devices.
> -  Use "cdns,at32ap7000-macb" for other 10/100 usage or use the generic form: "cdns,macb".
> -  Use "atmel,sama5d2-gem" for the GEM IP (10/100) available on Atmel sama5d2 SoCs.
> -  Use "atmel,sama5d29-gem" for GEM XL IP (10/100) available on Atmel sama5d29 SoCs.
> -  Use "atmel,sama5d3-macb" for the 10/100Mbit IP available on Atmel sama5d3 SoCs.
> -  Use "atmel,sama5d3-gem" for the Gigabit IP available on Atmel sama5d3 SoCs.
> -  Use "atmel,sama5d4-gem" for the GEM IP (10/100) available on Atmel sama5d4 SoCs.
> -  Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.
> -  Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC.
> -  Use "sifive,fu540-c000-gem" for SiFive FU540-C000 SoC.
> -  Use "microchip,sama7g5-emac" for Microchip SAMA7G5 ethernet interface.
> -  Use "microchip,sama7g5-gem" for Microchip SAMA7G5 gigabit ethernet interface.
> -  Or the generic form: "cdns,emac".
> -- reg: Address and length of the register set for the device
> -       For "sifive,fu540-c000-gem", second range is required to specify the
> -       address and length of the registers for GEMGXL Management block.
> -- interrupts: Should contain macb interrupt
> -- phy-mode: See ethernet.txt file in the same directory.
> -- clock-names: Tuple listing input clock names.
> -       Required elements: 'pclk', 'hclk'
> -       Optional elements: 'tx_clk'
> -       Optional elements: 'rx_clk' applies to cdns,zynqmp-gem
> -       Optional elements: 'tsu_clk'
> -- clocks: Phandles to input clocks.
> -
> -Optional properties:
> -- mdio: node containing PHY children. If this node is not present, then PHYs
> -        will be direct children.
> -
> -The MAC address will be determined using the optional properties
> -defined in ethernet.txt.
> -
> -Optional properties for PHY child node:
> -- reset-gpios : Should specify the gpio for phy reset
> -- magic-packet : If present, indicates that the hardware supports waking
> -  up via magic packet.
> -- phy-handle : see ethernet.txt file in the same directory
> -
> -Examples:
> -
> -       macb0: ethernet@fffc4000 {
> -               compatible = "cdns,at32ap7000-macb";
> -               reg = <0xfffc4000 0x4000>;
> -               interrupts = <21>;
> -               phy-mode = "rmii";
> -               local-mac-address = [3a 0e 03 04 05 06];
> -               clock-names = "pclk", "hclk", "tx_clk";
> -               clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
> -               ethernet-phy@1 {
> -                       reg = <0x1>;
> -                       reset-gpios = <&pioE 6 1>;
> -               };
> -       };
> --
> 2.25.1
>
Rob Herring Dec. 1, 2021, 11:25 p.m. UTC | #2
On Fri, Nov 26, 2021 at 12:57:00PM +0100, Geert Uytterhoeven wrote:
> Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
> documentation to json-schema.
> 
> Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
> Remove PicoXcell bindings")) as there are active users on non-PicoXcell
> platforms.
> Add missing "ether_clk" clock.
> Add missing properties.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  .../devicetree/bindings/net/cdns,macb.yaml    | 162 ++++++++++++++++++
>  .../devicetree/bindings/net/macb.txt          |  60 -------
>  2 files changed, 162 insertions(+), 60 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/cdns,macb.yaml
>  delete mode 100644 Documentation/devicetree/bindings/net/macb.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
> new file mode 100644
> index 0000000000000000..c7d00350430aa503
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
> @@ -0,0 +1,162 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/cdns,macb.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cadence MACB/GEM Ethernet controller
> +
> +maintainers:
> +  - Nicolas Ferre <nicolas.ferre@microchip.com>
> +  - Claudiu Beznea <claudiu.beznea@microchip.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - cdns,at91rm9200-emac  # Atmel at91rm9200 SoC
> +          - const: cdns,emac          # Generic
> +
> +      - items:
> +          - enum:
> +              - cdns,zynq-gem         # Xilinx Zynq-7xxx SoC
> +              - cdns,zynqmp-gem       # Xilinx Zynq Ultrascale+ MPSoC
> +          - const: cdns,gem           # Generic
> +
> +      - items:
> +          - enum:
> +              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs
> +              - cdns,sam9x60-macb     # Microchip sam9x60 SoC
> +          - const: cdns,macb          # Generic
> +
> +      - items:
> +          - enum:
> +              - atmel,sama5d3-macb    # 10/100Mbit IP on Atmel sama5d3 SoCs
> +          - enum:
> +              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs.
> +          - const: cdns,macb          # Generic
> +
> +      - enum:
> +          - atmel,sama5d29-gem        # GEM XL IP (10/100) on Atmel sama5d29 SoCs
> +          - atmel,sama5d2-gem         # GEM IP (10/100) on Atmel sama5d2 SoCs
> +          - atmel,sama5d3-gem         # Gigabit IP on Atmel sama5d3 SoCs
> +          - atmel,sama5d4-gem         # GEM IP (10/100) on Atmel sama5d4 SoCs
> +          - cdns,at32ap7000-macb      # Other 10/100 usage or use the generic form
> +          - cdns,np4-macb             # NP4 SoC devices
> +          - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
> +          - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
> +          - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC
> +          - cdns,emac                 # Generic
> +          - cdns,gem                  # Generic
> +          - cdns,macb                 # Generic
> +
> +  reg:
> +    minItems: 1
> +    items:
> +      - description: Basic register set
> +      - description: GEMGXL Management block registers on SiFive FU540-C000 SoC
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 8
> +    description: One interrupt per available hardware queue
> +
> +  clocks:
> +    minItems: 1
> +    maxItems: 5
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - enum: [ ether_clk, hclk, pclk ]
> +      - enum: [ hclk, pclk ]
> +      - const: tx_clk
> +      - enum: [ rx_clk, tsu_clk ]
> +      - const: tsu_clk
> +
> +  local-mac-address: true
> +
> +  phy-mode: true
> +
> +  phy-handle: true
> +
> +  fixed-link: true
> +
> +  iommus:
> +    maxItems: 1
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 0
> +
> +  '#stream-id-cells':
> +    const: 1

I can't figure out why you have this here. I'll drop it while applying.

> +
> +  mdio:
> +    type: object
> +    description:
> +      Node containing PHY children. If this node is not present, then PHYs will
> +      be direct children.
> +
> +patternProperties:
> +  "^ethernet-phy@[0-9a-f]$":
> +    type: object
> +    $ref: ethernet-phy.yaml#
> +
> +    properties:
> +      reset-gpios: true
> +
> +      magic-packet:
> +        description:
> +          Indicates that the hardware supports waking up via magic packet.
> +
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - phy-mode
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml#
> +
> +  - if:
> +      not:
> +        properties:
> +          compatible:
> +            contains:
> +              const: sifive,fu540-c000-gem
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 1
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    macb0: ethernet@fffc4000 {
> +            compatible = "cdns,at32ap7000-macb";
> +            reg = <0xfffc4000 0x4000>;
> +            interrupts = <21>;
> +            phy-mode = "rmii";
> +            local-mac-address = [3a 0e 03 04 05 06];
> +            clock-names = "pclk", "hclk", "tx_clk";
> +            clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            ethernet-phy@1 {
> +                    reg = <0x1>;
> +                    reset-gpios = <&pioE 6 1>;
> +            };
> +    };
> diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
> deleted file mode 100644
> index a1b06fd1962e4d93..0000000000000000
> --- a/Documentation/devicetree/bindings/net/macb.txt
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -* Cadence MACB/GEM Ethernet controller
> -
> -Required properties:
> -- compatible: Should be "cdns,[<chip>-]{macb|gem}"
> -  Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
> -  Use "cdns,at91sam9260-macb" for Atmel at91sam9 SoCs.
> -  Use "cdns,sam9x60-macb" for Microchip sam9x60 SoC.
> -  Use "cdns,np4-macb" for NP4 SoC devices.
> -  Use "cdns,at32ap7000-macb" for other 10/100 usage or use the generic form: "cdns,macb".
> -  Use "atmel,sama5d2-gem" for the GEM IP (10/100) available on Atmel sama5d2 SoCs.
> -  Use "atmel,sama5d29-gem" for GEM XL IP (10/100) available on Atmel sama5d29 SoCs.
> -  Use "atmel,sama5d3-macb" for the 10/100Mbit IP available on Atmel sama5d3 SoCs.
> -  Use "atmel,sama5d3-gem" for the Gigabit IP available on Atmel sama5d3 SoCs.
> -  Use "atmel,sama5d4-gem" for the GEM IP (10/100) available on Atmel sama5d4 SoCs.
> -  Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.
> -  Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC.
> -  Use "sifive,fu540-c000-gem" for SiFive FU540-C000 SoC.
> -  Use "microchip,sama7g5-emac" for Microchip SAMA7G5 ethernet interface.
> -  Use "microchip,sama7g5-gem" for Microchip SAMA7G5 gigabit ethernet interface.
> -  Or the generic form: "cdns,emac".
> -- reg: Address and length of the register set for the device
> -	For "sifive,fu540-c000-gem", second range is required to specify the
> -	address and length of the registers for GEMGXL Management block.
> -- interrupts: Should contain macb interrupt
> -- phy-mode: See ethernet.txt file in the same directory.
> -- clock-names: Tuple listing input clock names.
> -	Required elements: 'pclk', 'hclk'
> -	Optional elements: 'tx_clk'
> -	Optional elements: 'rx_clk' applies to cdns,zynqmp-gem
> -	Optional elements: 'tsu_clk'
> -- clocks: Phandles to input clocks.
> -
> -Optional properties:
> -- mdio: node containing PHY children. If this node is not present, then PHYs
> -        will be direct children.
> -
> -The MAC address will be determined using the optional properties
> -defined in ethernet.txt.
> -
> -Optional properties for PHY child node:
> -- reset-gpios : Should specify the gpio for phy reset
> -- magic-packet : If present, indicates that the hardware supports waking
> -  up via magic packet.
> -- phy-handle : see ethernet.txt file in the same directory
> -
> -Examples:
> -
> -	macb0: ethernet@fffc4000 {
> -		compatible = "cdns,at32ap7000-macb";
> -		reg = <0xfffc4000 0x4000>;
> -		interrupts = <21>;
> -		phy-mode = "rmii";
> -		local-mac-address = [3a 0e 03 04 05 06];
> -		clock-names = "pclk", "hclk", "tx_clk";
> -		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
> -		ethernet-phy@1 {
> -			reg = <0x1>;
> -			reset-gpios = <&pioE 6 1>;
> -		};
> -	};
> -- 
> 2.25.1
> 
>
Rob Herring Dec. 1, 2021, 11:27 p.m. UTC | #3
On Fri, 26 Nov 2021 12:57:00 +0100, Geert Uytterhoeven wrote:
> Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
> documentation to json-schema.
> 
> Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
> Remove PicoXcell bindings")) as there are active users on non-PicoXcell
> platforms.
> Add missing "ether_clk" clock.
> Add missing properties.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  .../devicetree/bindings/net/cdns,macb.yaml    | 162 ++++++++++++++++++
>  .../devicetree/bindings/net/macb.txt          |  60 -------
>  2 files changed, 162 insertions(+), 60 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/cdns,macb.yaml
>  delete mode 100644 Documentation/devicetree/bindings/net/macb.txt
> 

Applied, thanks!
Geert Uytterhoeven Dec. 2, 2021, 10:10 a.m. UTC | #4
Hi Rob,

CC Michal

On Thu, Dec 2, 2021 at 12:25 AM Rob Herring <robh@kernel.org> wrote:
> On Fri, Nov 26, 2021 at 12:57:00PM +0100, Geert Uytterhoeven wrote:
> > Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
> > documentation to json-schema.
> >
> > Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
> > Remove PicoXcell bindings")) as there are active users on non-PicoXcell
> > platforms.
> > Add missing "ether_clk" clock.
> > Add missing properties.
> >
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml

> > +  '#stream-id-cells':
> > +    const: 1
>
> I can't figure out why you have this here. I'll drop it while applying.

See arch/arm64/boot/dts/xilinx/zynqmp.dtsi and
drivers/iommu/arm/arm-smmu/arm-smmu.c.

It wasn't clear to me if this is still needed, or legacy. Michal?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Rob Herring Dec. 2, 2021, 3:53 p.m. UTC | #5
On Thu, Dec 2, 2021 at 4:10 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Rob,
>
> CC Michal
>
> On Thu, Dec 2, 2021 at 12:25 AM Rob Herring <robh@kernel.org> wrote:
> > On Fri, Nov 26, 2021 at 12:57:00PM +0100, Geert Uytterhoeven wrote:
> > > Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
> > > documentation to json-schema.
> > >
> > > Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
> > > Remove PicoXcell bindings")) as there are active users on non-PicoXcell
> > > platforms.
> > > Add missing "ether_clk" clock.
> > > Add missing properties.
> > >
> > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
>
> > > +  '#stream-id-cells':
> > > +    const: 1
> >
> > I can't figure out why you have this here. I'll drop it while applying.
>
> See arch/arm64/boot/dts/xilinx/zynqmp.dtsi and
> drivers/iommu/arm/arm-smmu/arm-smmu.c.
>
> It wasn't clear to me if this is still needed, or legacy. Michal?

They should update to the iommu binding instead of the legacy smmu
one. It's been around for years now.

Rob
Michal Simek Dec. 6, 2021, 12:16 p.m. UTC | #6
Hi,

On 12/2/21 16:53, Rob Herring wrote:
> On Thu, Dec 2, 2021 at 4:10 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>
>> Hi Rob,
>>
>> CC Michal
>>
>> On Thu, Dec 2, 2021 at 12:25 AM Rob Herring <robh@kernel.org> wrote:
>>> On Fri, Nov 26, 2021 at 12:57:00PM +0100, Geert Uytterhoeven wrote:
>>>> Convert the Cadence MACB/GEM Ethernet controller Device Tree binding
>>>> documentation to json-schema.
>>>>
>>>> Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings:
>>>> Remove PicoXcell bindings")) as there are active users on non-PicoXcell
>>>> platforms.
>>>> Add missing "ether_clk" clock.
>>>> Add missing properties.
>>>>
>>>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
>>
>>>> +  '#stream-id-cells':
>>>> +    const: 1
>>>
>>> I can't figure out why you have this here. I'll drop it while applying.
>>
>> See arch/arm64/boot/dts/xilinx/zynqmp.dtsi and
>> drivers/iommu/arm/arm-smmu/arm-smmu.c.
>>
>> It wasn't clear to me if this is still needed, or legacy. Michal?
> 
> They should update to the iommu binding instead of the legacy smmu
> one. It's been around for years now.

At the beginning it was there for XEN usage which was using this legacy 
binding.
Stefano: Please confirm that it is not needed anymore that we can remove 
it for zynqmp and versal.

Thanks,
Michal
Harini Katakam Dec. 9, 2021, 4:38 a.m. UTC | #7
Hi Rob, Geert,

On Mon, Dec 6, 2021 at 6:32 PM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Dec 2, 2021 at 4:10 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >
> > Hi Rob,
> >
> > CC Michal
> >
<snip>
> >
> > It wasn't clear to me if this is still needed, or legacy. Michal?
>
> They should update to the iommu binding instead of the legacy smmu
> one. It's been around for years now.

Yes, this is a legacy entry and not used anymore. We'll plan to update our
devicetree.

Regards,
Harini
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
new file mode 100644
index 0000000000000000..c7d00350430aa503
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
@@ -0,0 +1,162 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/cdns,macb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cadence MACB/GEM Ethernet controller
+
+maintainers:
+  - Nicolas Ferre <nicolas.ferre@microchip.com>
+  - Claudiu Beznea <claudiu.beznea@microchip.com>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - cdns,at91rm9200-emac  # Atmel at91rm9200 SoC
+          - const: cdns,emac          # Generic
+
+      - items:
+          - enum:
+              - cdns,zynq-gem         # Xilinx Zynq-7xxx SoC
+              - cdns,zynqmp-gem       # Xilinx Zynq Ultrascale+ MPSoC
+          - const: cdns,gem           # Generic
+
+      - items:
+          - enum:
+              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs
+              - cdns,sam9x60-macb     # Microchip sam9x60 SoC
+          - const: cdns,macb          # Generic
+
+      - items:
+          - enum:
+              - atmel,sama5d3-macb    # 10/100Mbit IP on Atmel sama5d3 SoCs
+          - enum:
+              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs.
+          - const: cdns,macb          # Generic
+
+      - enum:
+          - atmel,sama5d29-gem        # GEM XL IP (10/100) on Atmel sama5d29 SoCs
+          - atmel,sama5d2-gem         # GEM IP (10/100) on Atmel sama5d2 SoCs
+          - atmel,sama5d3-gem         # Gigabit IP on Atmel sama5d3 SoCs
+          - atmel,sama5d4-gem         # GEM IP (10/100) on Atmel sama5d4 SoCs
+          - cdns,at32ap7000-macb      # Other 10/100 usage or use the generic form
+          - cdns,np4-macb             # NP4 SoC devices
+          - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
+          - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
+          - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC
+          - cdns,emac                 # Generic
+          - cdns,gem                  # Generic
+          - cdns,macb                 # Generic
+
+  reg:
+    minItems: 1
+    items:
+      - description: Basic register set
+      - description: GEMGXL Management block registers on SiFive FU540-C000 SoC
+
+  interrupts:
+    minItems: 1
+    maxItems: 8
+    description: One interrupt per available hardware queue
+
+  clocks:
+    minItems: 1
+    maxItems: 5
+
+  clock-names:
+    minItems: 1
+    items:
+      - enum: [ ether_clk, hclk, pclk ]
+      - enum: [ hclk, pclk ]
+      - const: tx_clk
+      - enum: [ rx_clk, tsu_clk ]
+      - const: tsu_clk
+
+  local-mac-address: true
+
+  phy-mode: true
+
+  phy-handle: true
+
+  fixed-link: true
+
+  iommus:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  '#stream-id-cells':
+    const: 1
+
+  mdio:
+    type: object
+    description:
+      Node containing PHY children. If this node is not present, then PHYs will
+      be direct children.
+
+patternProperties:
+  "^ethernet-phy@[0-9a-f]$":
+    type: object
+    $ref: ethernet-phy.yaml#
+
+    properties:
+      reset-gpios: true
+
+      magic-packet:
+        description:
+          Indicates that the hardware supports waking up via magic packet.
+
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - phy-mode
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              const: sifive,fu540-c000-gem
+    then:
+      properties:
+        reg:
+          maxItems: 1
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    macb0: ethernet@fffc4000 {
+            compatible = "cdns,at32ap7000-macb";
+            reg = <0xfffc4000 0x4000>;
+            interrupts = <21>;
+            phy-mode = "rmii";
+            local-mac-address = [3a 0e 03 04 05 06];
+            clock-names = "pclk", "hclk", "tx_clk";
+            clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            ethernet-phy@1 {
+                    reg = <0x1>;
+                    reset-gpios = <&pioE 6 1>;
+            };
+    };
diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
deleted file mode 100644
index a1b06fd1962e4d93..0000000000000000
--- a/Documentation/devicetree/bindings/net/macb.txt
+++ /dev/null
@@ -1,60 +0,0 @@ 
-* Cadence MACB/GEM Ethernet controller
-
-Required properties:
-- compatible: Should be "cdns,[<chip>-]{macb|gem}"
-  Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
-  Use "cdns,at91sam9260-macb" for Atmel at91sam9 SoCs.
-  Use "cdns,sam9x60-macb" for Microchip sam9x60 SoC.
-  Use "cdns,np4-macb" for NP4 SoC devices.
-  Use "cdns,at32ap7000-macb" for other 10/100 usage or use the generic form: "cdns,macb".
-  Use "atmel,sama5d2-gem" for the GEM IP (10/100) available on Atmel sama5d2 SoCs.
-  Use "atmel,sama5d29-gem" for GEM XL IP (10/100) available on Atmel sama5d29 SoCs.
-  Use "atmel,sama5d3-macb" for the 10/100Mbit IP available on Atmel sama5d3 SoCs.
-  Use "atmel,sama5d3-gem" for the Gigabit IP available on Atmel sama5d3 SoCs.
-  Use "atmel,sama5d4-gem" for the GEM IP (10/100) available on Atmel sama5d4 SoCs.
-  Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.
-  Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC.
-  Use "sifive,fu540-c000-gem" for SiFive FU540-C000 SoC.
-  Use "microchip,sama7g5-emac" for Microchip SAMA7G5 ethernet interface.
-  Use "microchip,sama7g5-gem" for Microchip SAMA7G5 gigabit ethernet interface.
-  Or the generic form: "cdns,emac".
-- reg: Address and length of the register set for the device
-	For "sifive,fu540-c000-gem", second range is required to specify the
-	address and length of the registers for GEMGXL Management block.
-- interrupts: Should contain macb interrupt
-- phy-mode: See ethernet.txt file in the same directory.
-- clock-names: Tuple listing input clock names.
-	Required elements: 'pclk', 'hclk'
-	Optional elements: 'tx_clk'
-	Optional elements: 'rx_clk' applies to cdns,zynqmp-gem
-	Optional elements: 'tsu_clk'
-- clocks: Phandles to input clocks.
-
-Optional properties:
-- mdio: node containing PHY children. If this node is not present, then PHYs
-        will be direct children.
-
-The MAC address will be determined using the optional properties
-defined in ethernet.txt.
-
-Optional properties for PHY child node:
-- reset-gpios : Should specify the gpio for phy reset
-- magic-packet : If present, indicates that the hardware supports waking
-  up via magic packet.
-- phy-handle : see ethernet.txt file in the same directory
-
-Examples:
-
-	macb0: ethernet@fffc4000 {
-		compatible = "cdns,at32ap7000-macb";
-		reg = <0xfffc4000 0x4000>;
-		interrupts = <21>;
-		phy-mode = "rmii";
-		local-mac-address = [3a 0e 03 04 05 06];
-		clock-names = "pclk", "hclk", "tx_clk";
-		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
-		ethernet-phy@1 {
-			reg = <0x1>;
-			reset-gpios = <&pioE 6 1>;
-		};
-	};