All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: devicetree@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"maintainer:BROADCOM IPROC GBIT ETHERNET DRIVER"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Doug Berger" <opendmb@gmail.com>, "Ray Jui" <rjui@broadcom.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"moderated list:BROADCOM IPROC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:GENERIC PHY FRAMEWORK" <linux-phy@lists.infradead.org>
Subject: Re: [PATCH v3 4/8] dt-bindings: net: Convert GENET binding to YAML
Date: Wed, 8 Dec 2021 13:32:16 -0600	[thread overview]
Message-ID: <YbEIQNoSRR8II7fF@robh.at.kernel.org> (raw)
In-Reply-To: <20211206180049.2086907-5-f.fainelli@gmail.com>

On Mon, Dec 06, 2021 at 10:00:45AM -0800, Florian Fainelli wrote:
> Convert the GENET binding to YAML, leveraging brcm,unimac-mdio.yaml and
> the standard ethernet-controller.yaml files.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  .../devicetree/bindings/net/brcm,bcmgenet.txt | 125 ---------------
>  .../bindings/net/brcm,bcmgenet.yaml           | 145 ++++++++++++++++++
>  MAINTAINERS                                   |   2 +-
>  3 files changed, 146 insertions(+), 126 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
>  create mode 100644 Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> deleted file mode 100644
> index 0b5994fba35f..000000000000
> --- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -* Broadcom BCM7xxx Ethernet Controller (GENET)
> -
> -Required properties:
> -- compatible: should contain one of "brcm,genet-v1", "brcm,genet-v2",
> -  "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5", "brcm,bcm2711-genet-v5" or
> -  "brcm,bcm7712-genet-v5".
> -- reg: address and length of the register set for the device
> -- interrupts and/or interrupts-extended: must be two cells, the first cell
> -  is the general purpose interrupt line, while the second cell is the
> -  interrupt for the ring RX and TX queues operating in ring mode.  An
> -  optional third interrupt cell for Wake-on-LAN can be specified.
> -  See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> -  for information on the property specifics.
> -- phy-mode: see ethernet.txt file in the same directory
> -- #address-cells: should be 1
> -- #size-cells: should be 1
> -
> -Optional properties:
> -- clocks: When provided, must be two phandles to the functional clocks nodes
> -  of the GENET block. The first phandle is the main GENET clock used during
> -  normal operation, while the second phandle is the Wake-on-LAN clock.
> -- clock-names: When provided, names of the functional clock phandles, first
> -  name should be "enet" and second should be "enet-wol".
> -
> -- phy-handle: See ethernet.txt file in the same directory; used to describe
> -  configurations where a PHY (internal or external) is used.
> -
> -- fixed-link: When the GENET interface is connected to a MoCA hardware block or
> -  when operating in a RGMII to RGMII type of connection, or when the MDIO bus is
> -  voluntarily disabled, this property should be used to describe the "fixed link".
> -  See Documentation/devicetree/bindings/net/fixed-link.txt for information on
> -  the property specifics
> -
> -Required child nodes:
> -
> -- mdio bus node: this node should always be present regardless of the PHY
> -  configuration of the GENET instance
> -
> -MDIO bus node required properties:
> -
> -- compatible: should contain one of "brcm,genet-mdio-v1", "brcm,genet-mdio-v2"
> -  "brcm,genet-mdio-v3", "brcm,genet-mdio-v4", "brcm,genet-mdio-v5", the version
> -  has to match the parent node compatible property (e.g: brcm,genet-v4 pairs
> -  with brcm,genet-mdio-v4)
> -- reg: address and length relative to the parent node base register address
> -- #address-cells: address cell for MDIO bus addressing, should be 1
> -- #size-cells: size of the cells for MDIO bus addressing, should be 0
> -
> -Ethernet PHY node properties:
> -
> -See Documentation/devicetree/bindings/net/phy.txt for the list of required and
> -optional properties.
> -
> -Internal Gigabit PHY example:
> -
> -ethernet@f0b60000 {
> -	phy-mode = "internal";
> -	phy-handle = <&phy1>;
> -	mac-address = [ 00 10 18 36 23 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0b60000 0xfc4c>;
> -	interrupts = <0x0 0x14 0x0>, <0x0 0x15 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -
> -		phy1: ethernet-phy@1 {
> -			max-speed = <1000>;
> -			reg = <0x1>;
> -			compatible = "ethernet-phy-ieee802.3-c22";
> -		};
> -	};
> -};
> -
> -MoCA interface / MAC to MAC example:
> -
> -ethernet@f0b80000 {
> -	phy-mode = "moca";
> -	fixed-link = <1 0 1000 0 0>;
> -	mac-address = [ 00 10 18 36 24 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0b80000 0xfc4c>;
> -	interrupts = <0x0 0x16 0x0>, <0x0 0x17 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -	};
> -};
> -
> -
> -External MDIO-connected Gigabit PHY/switch:
> -
> -ethernet@f0ba0000 {
> -	phy-mode = "rgmii";
> -	phy-handle = <&phy0>;
> -	mac-address = [ 00 10 18 36 26 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0ba0000 0xfc4c>;
> -	interrupts = <0x0 0x18 0x0>, <0x0 0x19 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -
> -		phy0: ethernet-phy@0 {
> -			max-speed = <1000>;
> -			reg = <0x0>;
> -			compatible = "ethernet-phy-ieee802.3-c22";
> -		};
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml b/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> new file mode 100644
> index 000000000000..ba9a6d156815
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> @@ -0,0 +1,145 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/brcm,bcmgenet.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom BCM7xxx Ethernet Controller (GENET) binding
> +
> +maintainers:
> +  - Doug Berger <opendmb@gmail.com>
> +  - Florian Fainelli <f.fainelli@gmail.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,genet-v1
> +      - brcm,genet-v2
> +      - brcm,genet-v3
> +      - brcm,genet-v4
> +      - brcm,genet-v5
> +      - brcm,bcm2711-genet-v5
> +      - brcm,bcm7712-genet-v5
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 2
> +    items:
> +      - description: general purpose interrupt line
> +      - description: RX and TX rings interrupt line
> +      - description: Wake-on-LAN interrupt line
> +
> +
> +  clocks:
> +    minItems: 1
> +    items:
> +      - description: main clock
> +      - description: EEE clock
> +      - description: Wake-on-LAN clock
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - const: enet
> +      - const: enet-eee
> +      - const: enet-wol
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1
> +
> +patternProperties:
> +  "^mdio@[0-9a-f]+$":
> +    type: object
> +    $ref: "brcm,unimac-mdio.yaml"
> +
> +    description:
> +      GENET internal UniMAC MDIO bus
> +
> +required:
> +  - reg
> +  - interrupts
> +  - phy-mode
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml
> +
> +additionalProperties: true

This should be 'unevaluatedProperties: false'. I'll fixup while 
applying.

> +
> +examples:
> +  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +  - |
> +    ethernet@f0b60000 {
> +        phy-mode = "internal";
> +        phy-handle = <&phy1>;
> +        mac-address = [ 00 10 18 36 23 1a ];
> +        compatible = "brcm,genet-v4";
> +        reg = <0xf0b60000 0xfc4c>;
> +        interrupts = <0x0 0x14 0x0>, <0x0 0x15 0x0>;
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        mdio0: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +
> +           phy1: ethernet-phy@1 {
> +                max-speed = <1000>;
> +                reg = <1>;
> +                compatible = "ethernet-phy-ieee802.3-c22";
> +           };
> +        };
> +    };
> +
> +  - |
> +    ethernet@f0b80000 {
> +        phy-mode = "moca";
> +        fixed-link = <1 0 1000 0 0>;
> +        mac-address = [ 00 10 18 36 24 1a ];
> +        compatible = "brcm,genet-v4";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        reg = <0xf0b80000 0xfc4c>;
> +        interrupts = <0x0 0x16 0x0>, <0x0 0x17 0x0>;
> +
> +        mdio1: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +        };
> +    };
> +
> +  - |
> +    ethernet@f0ba0000 {
> +        phy-mode = "rgmii";
> +        phy-handle = <&phy0>;
> +        mac-address = [ 00 10 18 36 26 1a ];
> +        compatible = "brcm,genet-v4";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        reg = <0xf0ba0000 0xfc4c>;
> +        interrupts = <0x0 0x18 0x0>, <0x0 0x19 0x0>;
> +
> +        mdio2: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +
> +           phy0: ethernet-phy@0 {
> +                max-speed = <1000>;
> +                reg = <0>;
> +                compatible = "ethernet-phy-ieee802.3-c22";
> +           };
> +        };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7a2345ce8521..5e1064c23f41 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3819,7 +3819,7 @@ M:	Florian Fainelli <f.fainelli@gmail.com>
>  L:	bcm-kernel-feedback-list@broadcom.com
>  L:	netdev@vger.kernel.org
>  S:	Supported
> -F:	Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> +F:	Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
>  F:	Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
>  F:	drivers/net/ethernet/broadcom/genet/
>  F:	drivers/net/ethernet/broadcom/unimac.h
> -- 
> 2.25.1
> 
> 

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: devicetree@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"maintainer:BROADCOM IPROC GBIT ETHERNET DRIVER"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Doug Berger" <opendmb@gmail.com>, "Ray Jui" <rjui@broadcom.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"moderated list:BROADCOM IPROC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:GENERIC PHY FRAMEWORK" <linux-phy@lists.infradead.org>
Subject: Re: [PATCH v3 4/8] dt-bindings: net: Convert GENET binding to YAML
Date: Wed, 8 Dec 2021 13:32:16 -0600	[thread overview]
Message-ID: <YbEIQNoSRR8II7fF@robh.at.kernel.org> (raw)
In-Reply-To: <20211206180049.2086907-5-f.fainelli@gmail.com>

On Mon, Dec 06, 2021 at 10:00:45AM -0800, Florian Fainelli wrote:
> Convert the GENET binding to YAML, leveraging brcm,unimac-mdio.yaml and
> the standard ethernet-controller.yaml files.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  .../devicetree/bindings/net/brcm,bcmgenet.txt | 125 ---------------
>  .../bindings/net/brcm,bcmgenet.yaml           | 145 ++++++++++++++++++
>  MAINTAINERS                                   |   2 +-
>  3 files changed, 146 insertions(+), 126 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
>  create mode 100644 Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> deleted file mode 100644
> index 0b5994fba35f..000000000000
> --- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -* Broadcom BCM7xxx Ethernet Controller (GENET)
> -
> -Required properties:
> -- compatible: should contain one of "brcm,genet-v1", "brcm,genet-v2",
> -  "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5", "brcm,bcm2711-genet-v5" or
> -  "brcm,bcm7712-genet-v5".
> -- reg: address and length of the register set for the device
> -- interrupts and/or interrupts-extended: must be two cells, the first cell
> -  is the general purpose interrupt line, while the second cell is the
> -  interrupt for the ring RX and TX queues operating in ring mode.  An
> -  optional third interrupt cell for Wake-on-LAN can be specified.
> -  See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> -  for information on the property specifics.
> -- phy-mode: see ethernet.txt file in the same directory
> -- #address-cells: should be 1
> -- #size-cells: should be 1
> -
> -Optional properties:
> -- clocks: When provided, must be two phandles to the functional clocks nodes
> -  of the GENET block. The first phandle is the main GENET clock used during
> -  normal operation, while the second phandle is the Wake-on-LAN clock.
> -- clock-names: When provided, names of the functional clock phandles, first
> -  name should be "enet" and second should be "enet-wol".
> -
> -- phy-handle: See ethernet.txt file in the same directory; used to describe
> -  configurations where a PHY (internal or external) is used.
> -
> -- fixed-link: When the GENET interface is connected to a MoCA hardware block or
> -  when operating in a RGMII to RGMII type of connection, or when the MDIO bus is
> -  voluntarily disabled, this property should be used to describe the "fixed link".
> -  See Documentation/devicetree/bindings/net/fixed-link.txt for information on
> -  the property specifics
> -
> -Required child nodes:
> -
> -- mdio bus node: this node should always be present regardless of the PHY
> -  configuration of the GENET instance
> -
> -MDIO bus node required properties:
> -
> -- compatible: should contain one of "brcm,genet-mdio-v1", "brcm,genet-mdio-v2"
> -  "brcm,genet-mdio-v3", "brcm,genet-mdio-v4", "brcm,genet-mdio-v5", the version
> -  has to match the parent node compatible property (e.g: brcm,genet-v4 pairs
> -  with brcm,genet-mdio-v4)
> -- reg: address and length relative to the parent node base register address
> -- #address-cells: address cell for MDIO bus addressing, should be 1
> -- #size-cells: size of the cells for MDIO bus addressing, should be 0
> -
> -Ethernet PHY node properties:
> -
> -See Documentation/devicetree/bindings/net/phy.txt for the list of required and
> -optional properties.
> -
> -Internal Gigabit PHY example:
> -
> -ethernet@f0b60000 {
> -	phy-mode = "internal";
> -	phy-handle = <&phy1>;
> -	mac-address = [ 00 10 18 36 23 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0b60000 0xfc4c>;
> -	interrupts = <0x0 0x14 0x0>, <0x0 0x15 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -
> -		phy1: ethernet-phy@1 {
> -			max-speed = <1000>;
> -			reg = <0x1>;
> -			compatible = "ethernet-phy-ieee802.3-c22";
> -		};
> -	};
> -};
> -
> -MoCA interface / MAC to MAC example:
> -
> -ethernet@f0b80000 {
> -	phy-mode = "moca";
> -	fixed-link = <1 0 1000 0 0>;
> -	mac-address = [ 00 10 18 36 24 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0b80000 0xfc4c>;
> -	interrupts = <0x0 0x16 0x0>, <0x0 0x17 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -	};
> -};
> -
> -
> -External MDIO-connected Gigabit PHY/switch:
> -
> -ethernet@f0ba0000 {
> -	phy-mode = "rgmii";
> -	phy-handle = <&phy0>;
> -	mac-address = [ 00 10 18 36 26 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0ba0000 0xfc4c>;
> -	interrupts = <0x0 0x18 0x0>, <0x0 0x19 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -
> -		phy0: ethernet-phy@0 {
> -			max-speed = <1000>;
> -			reg = <0x0>;
> -			compatible = "ethernet-phy-ieee802.3-c22";
> -		};
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml b/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> new file mode 100644
> index 000000000000..ba9a6d156815
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> @@ -0,0 +1,145 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/brcm,bcmgenet.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom BCM7xxx Ethernet Controller (GENET) binding
> +
> +maintainers:
> +  - Doug Berger <opendmb@gmail.com>
> +  - Florian Fainelli <f.fainelli@gmail.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,genet-v1
> +      - brcm,genet-v2
> +      - brcm,genet-v3
> +      - brcm,genet-v4
> +      - brcm,genet-v5
> +      - brcm,bcm2711-genet-v5
> +      - brcm,bcm7712-genet-v5
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 2
> +    items:
> +      - description: general purpose interrupt line
> +      - description: RX and TX rings interrupt line
> +      - description: Wake-on-LAN interrupt line
> +
> +
> +  clocks:
> +    minItems: 1
> +    items:
> +      - description: main clock
> +      - description: EEE clock
> +      - description: Wake-on-LAN clock
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - const: enet
> +      - const: enet-eee
> +      - const: enet-wol
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1
> +
> +patternProperties:
> +  "^mdio@[0-9a-f]+$":
> +    type: object
> +    $ref: "brcm,unimac-mdio.yaml"
> +
> +    description:
> +      GENET internal UniMAC MDIO bus
> +
> +required:
> +  - reg
> +  - interrupts
> +  - phy-mode
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml
> +
> +additionalProperties: true

This should be 'unevaluatedProperties: false'. I'll fixup while 
applying.

> +
> +examples:
> +  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +  - |
> +    ethernet@f0b60000 {
> +        phy-mode = "internal";
> +        phy-handle = <&phy1>;
> +        mac-address = [ 00 10 18 36 23 1a ];
> +        compatible = "brcm,genet-v4";
> +        reg = <0xf0b60000 0xfc4c>;
> +        interrupts = <0x0 0x14 0x0>, <0x0 0x15 0x0>;
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        mdio0: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +
> +           phy1: ethernet-phy@1 {
> +                max-speed = <1000>;
> +                reg = <1>;
> +                compatible = "ethernet-phy-ieee802.3-c22";
> +           };
> +        };
> +    };
> +
> +  - |
> +    ethernet@f0b80000 {
> +        phy-mode = "moca";
> +        fixed-link = <1 0 1000 0 0>;
> +        mac-address = [ 00 10 18 36 24 1a ];
> +        compatible = "brcm,genet-v4";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        reg = <0xf0b80000 0xfc4c>;
> +        interrupts = <0x0 0x16 0x0>, <0x0 0x17 0x0>;
> +
> +        mdio1: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +        };
> +    };
> +
> +  - |
> +    ethernet@f0ba0000 {
> +        phy-mode = "rgmii";
> +        phy-handle = <&phy0>;
> +        mac-address = [ 00 10 18 36 26 1a ];
> +        compatible = "brcm,genet-v4";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        reg = <0xf0ba0000 0xfc4c>;
> +        interrupts = <0x0 0x18 0x0>, <0x0 0x19 0x0>;
> +
> +        mdio2: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +
> +           phy0: ethernet-phy@0 {
> +                max-speed = <1000>;
> +                reg = <0>;
> +                compatible = "ethernet-phy-ieee802.3-c22";
> +           };
> +        };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7a2345ce8521..5e1064c23f41 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3819,7 +3819,7 @@ M:	Florian Fainelli <f.fainelli@gmail.com>
>  L:	bcm-kernel-feedback-list@broadcom.com
>  L:	netdev@vger.kernel.org
>  S:	Supported
> -F:	Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> +F:	Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
>  F:	Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
>  F:	drivers/net/ethernet/broadcom/genet/
>  F:	drivers/net/ethernet/broadcom/unimac.h
> -- 
> 2.25.1
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: devicetree@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"maintainer:BROADCOM IPROC GBIT ETHERNET DRIVER"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Doug Berger" <opendmb@gmail.com>, "Ray Jui" <rjui@broadcom.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"moderated list:BROADCOM IPROC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:GENERIC PHY FRAMEWORK" <linux-phy@lists.infradead.org>
Subject: Re: [PATCH v3 4/8] dt-bindings: net: Convert GENET binding to YAML
Date: Wed, 8 Dec 2021 13:32:16 -0600	[thread overview]
Message-ID: <YbEIQNoSRR8II7fF@robh.at.kernel.org> (raw)
In-Reply-To: <20211206180049.2086907-5-f.fainelli@gmail.com>

On Mon, Dec 06, 2021 at 10:00:45AM -0800, Florian Fainelli wrote:
> Convert the GENET binding to YAML, leveraging brcm,unimac-mdio.yaml and
> the standard ethernet-controller.yaml files.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  .../devicetree/bindings/net/brcm,bcmgenet.txt | 125 ---------------
>  .../bindings/net/brcm,bcmgenet.yaml           | 145 ++++++++++++++++++
>  MAINTAINERS                                   |   2 +-
>  3 files changed, 146 insertions(+), 126 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
>  create mode 100644 Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> deleted file mode 100644
> index 0b5994fba35f..000000000000
> --- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -* Broadcom BCM7xxx Ethernet Controller (GENET)
> -
> -Required properties:
> -- compatible: should contain one of "brcm,genet-v1", "brcm,genet-v2",
> -  "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5", "brcm,bcm2711-genet-v5" or
> -  "brcm,bcm7712-genet-v5".
> -- reg: address and length of the register set for the device
> -- interrupts and/or interrupts-extended: must be two cells, the first cell
> -  is the general purpose interrupt line, while the second cell is the
> -  interrupt for the ring RX and TX queues operating in ring mode.  An
> -  optional third interrupt cell for Wake-on-LAN can be specified.
> -  See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> -  for information on the property specifics.
> -- phy-mode: see ethernet.txt file in the same directory
> -- #address-cells: should be 1
> -- #size-cells: should be 1
> -
> -Optional properties:
> -- clocks: When provided, must be two phandles to the functional clocks nodes
> -  of the GENET block. The first phandle is the main GENET clock used during
> -  normal operation, while the second phandle is the Wake-on-LAN clock.
> -- clock-names: When provided, names of the functional clock phandles, first
> -  name should be "enet" and second should be "enet-wol".
> -
> -- phy-handle: See ethernet.txt file in the same directory; used to describe
> -  configurations where a PHY (internal or external) is used.
> -
> -- fixed-link: When the GENET interface is connected to a MoCA hardware block or
> -  when operating in a RGMII to RGMII type of connection, or when the MDIO bus is
> -  voluntarily disabled, this property should be used to describe the "fixed link".
> -  See Documentation/devicetree/bindings/net/fixed-link.txt for information on
> -  the property specifics
> -
> -Required child nodes:
> -
> -- mdio bus node: this node should always be present regardless of the PHY
> -  configuration of the GENET instance
> -
> -MDIO bus node required properties:
> -
> -- compatible: should contain one of "brcm,genet-mdio-v1", "brcm,genet-mdio-v2"
> -  "brcm,genet-mdio-v3", "brcm,genet-mdio-v4", "brcm,genet-mdio-v5", the version
> -  has to match the parent node compatible property (e.g: brcm,genet-v4 pairs
> -  with brcm,genet-mdio-v4)
> -- reg: address and length relative to the parent node base register address
> -- #address-cells: address cell for MDIO bus addressing, should be 1
> -- #size-cells: size of the cells for MDIO bus addressing, should be 0
> -
> -Ethernet PHY node properties:
> -
> -See Documentation/devicetree/bindings/net/phy.txt for the list of required and
> -optional properties.
> -
> -Internal Gigabit PHY example:
> -
> -ethernet@f0b60000 {
> -	phy-mode = "internal";
> -	phy-handle = <&phy1>;
> -	mac-address = [ 00 10 18 36 23 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0b60000 0xfc4c>;
> -	interrupts = <0x0 0x14 0x0>, <0x0 0x15 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -
> -		phy1: ethernet-phy@1 {
> -			max-speed = <1000>;
> -			reg = <0x1>;
> -			compatible = "ethernet-phy-ieee802.3-c22";
> -		};
> -	};
> -};
> -
> -MoCA interface / MAC to MAC example:
> -
> -ethernet@f0b80000 {
> -	phy-mode = "moca";
> -	fixed-link = <1 0 1000 0 0>;
> -	mac-address = [ 00 10 18 36 24 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0b80000 0xfc4c>;
> -	interrupts = <0x0 0x16 0x0>, <0x0 0x17 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -	};
> -};
> -
> -
> -External MDIO-connected Gigabit PHY/switch:
> -
> -ethernet@f0ba0000 {
> -	phy-mode = "rgmii";
> -	phy-handle = <&phy0>;
> -	mac-address = [ 00 10 18 36 26 1a ];
> -	compatible = "brcm,genet-v4";
> -	#address-cells = <0x1>;
> -	#size-cells = <0x1>;
> -	reg = <0xf0ba0000 0xfc4c>;
> -	interrupts = <0x0 0x18 0x0>, <0x0 0x19 0x0>;
> -
> -	mdio@e14 {
> -		compatible = "brcm,genet-mdio-v4";
> -		#address-cells = <0x1>;
> -		#size-cells = <0x0>;
> -		reg = <0xe14 0x8>;
> -
> -		phy0: ethernet-phy@0 {
> -			max-speed = <1000>;
> -			reg = <0x0>;
> -			compatible = "ethernet-phy-ieee802.3-c22";
> -		};
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml b/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> new file mode 100644
> index 000000000000..ba9a6d156815
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
> @@ -0,0 +1,145 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/brcm,bcmgenet.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom BCM7xxx Ethernet Controller (GENET) binding
> +
> +maintainers:
> +  - Doug Berger <opendmb@gmail.com>
> +  - Florian Fainelli <f.fainelli@gmail.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,genet-v1
> +      - brcm,genet-v2
> +      - brcm,genet-v3
> +      - brcm,genet-v4
> +      - brcm,genet-v5
> +      - brcm,bcm2711-genet-v5
> +      - brcm,bcm7712-genet-v5
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 2
> +    items:
> +      - description: general purpose interrupt line
> +      - description: RX and TX rings interrupt line
> +      - description: Wake-on-LAN interrupt line
> +
> +
> +  clocks:
> +    minItems: 1
> +    items:
> +      - description: main clock
> +      - description: EEE clock
> +      - description: Wake-on-LAN clock
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - const: enet
> +      - const: enet-eee
> +      - const: enet-wol
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 1
> +
> +patternProperties:
> +  "^mdio@[0-9a-f]+$":
> +    type: object
> +    $ref: "brcm,unimac-mdio.yaml"
> +
> +    description:
> +      GENET internal UniMAC MDIO bus
> +
> +required:
> +  - reg
> +  - interrupts
> +  - phy-mode
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml
> +
> +additionalProperties: true

This should be 'unevaluatedProperties: false'. I'll fixup while 
applying.

> +
> +examples:
> +  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +  - |
> +    ethernet@f0b60000 {
> +        phy-mode = "internal";
> +        phy-handle = <&phy1>;
> +        mac-address = [ 00 10 18 36 23 1a ];
> +        compatible = "brcm,genet-v4";
> +        reg = <0xf0b60000 0xfc4c>;
> +        interrupts = <0x0 0x14 0x0>, <0x0 0x15 0x0>;
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +
> +        mdio0: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +
> +           phy1: ethernet-phy@1 {
> +                max-speed = <1000>;
> +                reg = <1>;
> +                compatible = "ethernet-phy-ieee802.3-c22";
> +           };
> +        };
> +    };
> +
> +  - |
> +    ethernet@f0b80000 {
> +        phy-mode = "moca";
> +        fixed-link = <1 0 1000 0 0>;
> +        mac-address = [ 00 10 18 36 24 1a ];
> +        compatible = "brcm,genet-v4";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        reg = <0xf0b80000 0xfc4c>;
> +        interrupts = <0x0 0x16 0x0>, <0x0 0x17 0x0>;
> +
> +        mdio1: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +        };
> +    };
> +
> +  - |
> +    ethernet@f0ba0000 {
> +        phy-mode = "rgmii";
> +        phy-handle = <&phy0>;
> +        mac-address = [ 00 10 18 36 26 1a ];
> +        compatible = "brcm,genet-v4";
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        reg = <0xf0ba0000 0xfc4c>;
> +        interrupts = <0x0 0x18 0x0>, <0x0 0x19 0x0>;
> +
> +        mdio2: mdio@e14 {
> +           compatible = "brcm,genet-mdio-v4";
> +           #address-cells = <1>;
> +           #size-cells = <0>;
> +           reg = <0xe14 0x8>;
> +
> +           phy0: ethernet-phy@0 {
> +                max-speed = <1000>;
> +                reg = <0>;
> +                compatible = "ethernet-phy-ieee802.3-c22";
> +           };
> +        };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7a2345ce8521..5e1064c23f41 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3819,7 +3819,7 @@ M:	Florian Fainelli <f.fainelli@gmail.com>
>  L:	bcm-kernel-feedback-list@broadcom.com
>  L:	netdev@vger.kernel.org
>  S:	Supported
> -F:	Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
> +F:	Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml
>  F:	Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
>  F:	drivers/net/ethernet/broadcom/genet/
>  F:	drivers/net/ethernet/broadcom/unimac.h
> -- 
> 2.25.1
> 
> 

  reply	other threads:[~2021-12-08 19:32 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 18:00 [PATCH v3 0/8] Broadcom DT bindings conversion to YAML Florian Fainelli
2021-12-06 18:00 ` Florian Fainelli
2021-12-06 18:00 ` Florian Fainelli
2021-12-06 18:00 ` [PATCH v3 1/8] dt-bindings: net: brcm, unimac-mdio: reg-names is optional Florian Fainelli
2021-12-06 18:00   ` [PATCH v3 1/8] dt-bindings: net: brcm,unimac-mdio: " Florian Fainelli
2021-12-06 18:00   ` [PATCH v3 1/8] dt-bindings: net: brcm, unimac-mdio: " Florian Fainelli
2021-12-08 19:28   ` [PATCH v3 1/8] dt-bindings: net: brcm,unimac-mdio: " Rob Herring
2021-12-08 19:28     ` Rob Herring
2021-12-08 19:28     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 2/8] dt-bindings: net: brcm, unimac-mdio: Update maintainers for binding Florian Fainelli
2021-12-06 18:00   ` [PATCH v3 2/8] dt-bindings: net: brcm,unimac-mdio: " Florian Fainelli
2021-12-06 18:00   ` [PATCH v3 2/8] dt-bindings: net: brcm, unimac-mdio: " Florian Fainelli
2021-12-08 19:29   ` [PATCH v3 2/8] dt-bindings: net: brcm,unimac-mdio: " Rob Herring
2021-12-08 19:29     ` Rob Herring
2021-12-08 19:29     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 3/8] dt-bindings: net: Document moca PHY interface Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-08 19:29   ` Rob Herring
2021-12-08 19:29     ` Rob Herring
2021-12-08 19:29     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 4/8] dt-bindings: net: Convert GENET binding to YAML Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-08 19:32   ` Rob Herring [this message]
2021-12-08 19:32     ` Rob Herring
2021-12-08 19:32     ` Rob Herring
2021-12-08 19:33   ` Rob Herring
2021-12-08 19:33     ` Rob Herring
2021-12-08 19:33     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 5/8] dt-bindings: net: Convert AMAC " Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-08 19:46   ` Rob Herring
2021-12-08 19:46     ` Rob Herring
2021-12-08 19:46     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 6/8] dt-bindings: net: Convert SYSTEMPORT " Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-08 19:48   ` Rob Herring
2021-12-08 19:48     ` Rob Herring
2021-12-08 19:48     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 7/8] dt-bindings: phy: Convert Northstar 2 PCIe PHY " Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-08 19:48   ` Rob Herring
2021-12-08 19:48     ` Rob Herring
2021-12-08 19:48     ` Rob Herring
2021-12-06 18:00 ` [PATCH v3 8/8] dt-bindings: net: Convert iProc MDIO mux " Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-06 18:00   ` Florian Fainelli
2021-12-08 19:49   ` Rob Herring
2021-12-08 19:49     ` Rob Herring
2021-12-08 19:49     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YbEIQNoSRR8II7fF@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=kishon@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.