devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Frank Li <Frank.Li@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Cc: imx@lists.linux.dev
Subject: Re: [PATCH 1/1] dt-bindings: net: convert enetc to yaml
Date: Wed, 26 Jun 2024 10:24:38 +0200	[thread overview]
Message-ID: <171cb592-1f5b-414d-bee2-ece87931f6cb@kernel.org> (raw)
In-Reply-To: <20240625202255.3946515-1-Frank.Li@nxp.com>

On 25/06/2024 22:22, Frank Li wrote:
> Convert enetc device binding file to yaml. Split to 3 yaml files,
> fsl-enetc.yaml, fsl-enetc-mdio.yaml, fsl-enetc-ierb.yaml.
> 
> Additional Changes:
> - Add pci<vendor id>,<production id> in compatible string.
> - Ref to common ethernet-controller.yaml and mdio.yaml.
> - Remove fixed-link part.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  .../bindings/net/fsl-enetc-ierb.yaml          |  35 ++++++
>  .../bindings/net/fsl-enetc-mdio.yaml          |  46 +++++++
>  .../devicetree/bindings/net/fsl-enetc.txt     | 119 ------------------
>  .../devicetree/bindings/net/fsl-enetc.yaml    |  43 +++++++
>  4 files changed, 124 insertions(+), 119 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/fsl-enetc-ierb.yaml
>  create mode 100644 Documentation/devicetree/bindings/net/fsl-enetc-mdio.yaml
>  delete mode 100644 Documentation/devicetree/bindings/net/fsl-enetc.txt
>  create mode 100644 Documentation/devicetree/bindings/net/fsl-enetc.yaml

Filename matching compatible, so vendor prefixes+coma+device name.

> 
> diff --git a/Documentation/devicetree/bindings/net/fsl-enetc-ierb.yaml b/Documentation/devicetree/bindings/net/fsl-enetc-ierb.yaml
> new file mode 100644
> index 0000000000000..bb083b2f8f399
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/fsl-enetc-ierb.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/fsl-enetc-ierb.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Integrated Endpoint Register Block
> +
> +description:
> +  The fsl_enetc driver can probe on the Integrated Endpoint Register
> +  Block, which preconfigures the FIFO limits for the ENETC ports.
> +
> +maintainers:
> +  - Frank Li <Frank.Li@nxp.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - fsl,ls1028a-enetc-ierb
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    ierb@1f0800000 {
> +        compatible = "fsl,ls1028a-enetc-ierb";
> +        reg = <0xf0800000 0x10000>;
> +    };
> diff --git a/Documentation/devicetree/bindings/net/fsl-enetc-mdio.yaml b/Documentation/devicetree/bindings/net/fsl-enetc-mdio.yaml
> new file mode 100644
> index 0000000000000..e8d0d4aa1112f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/fsl-enetc-mdio.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/fsl-enetc-mdio.yaml#

fsl,enetc-mdio.yaml

> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ENETC the central MDIO PCIe endpoint device
> +
> +description:
> +  In this case, the mdio node should be defined as another PCIe
> +  endpoint node, at the same level with the ENETC port nodes
> +
> +maintainers:
> +  - Frank Li <Frank.Li@nxp.com>.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - pci1957,ee01
> +      - const: fsl,enetc-mdio
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +allOf:
> +  - $ref: mdio.yaml
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    mdio@0,3 {
> +        compatible = "pci1957,ee01", "fsl,enetc-mdio";
> +        reg = <0x000300 0>;

The ranges do not match unit address, at least for simple case of
address/size-cells=1. Looks like this should be enclosed in pci {} node
and then with proper ranges. Otherwise it is a bit confusing.


> diff --git a/Documentation/devicetree/bindings/net/fsl-enetc.txt b/Documentation/devicetree/bindings/net/fsl-enetc.txt
> deleted file mode 100644
> index 9b9a3f197e2d3..0000000000000
> --- a/Documentation/devicetree/bindings/net/fsl-enetc.txt
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -* ENETC ethernet device tree bindings
> -
> -Depending on board design and ENETC port type (internal or
> -external) there are two supported link modes specified by
> -below device tree bindings.
> -
> -Required properties:
> -
> -- reg		: Specifies PCIe Device Number and Function
> -		  Number of the ENETC endpoint device, according
> -		  to parent node bindings.
> -- compatible	: Should be "fsl,enetc".
> -
> -1. The ENETC external port is connected to a MDIO configurable phy
> -
> -1.1. Using the local ENETC Port MDIO interface
> -
> -In this case, the ENETC node should include a "mdio" sub-node
> -that in turn should contain the "ethernet-phy" node describing the
> -external phy.  Below properties are required, their bindings
> -already defined in Documentation/devicetree/bindings/net/ethernet.txt or
> -Documentation/devicetree/bindings/net/phy.txt.
> -
> -Required:
> -
> -- phy-handle		: Phandle to a PHY on the MDIO bus.
> -			  Defined in ethernet.txt.
> -
> -- phy-connection-type	: Defined in ethernet.txt.
> -
> -- mdio			: "mdio" node, defined in mdio.txt.
> -
> -- ethernet-phy		: "ethernet-phy" node, defined in phy.txt.
> -
> -Example:
> -
> -	ethernet@0,0 {
> -		compatible = "fsl,enetc";
> -		reg = <0x000000 0 0 0 0>;
> -		phy-handle = <&sgmii_phy0>;
> -		phy-connection-type = "sgmii";
> -
> -		mdio {
> -			#address-cells = <1>;
> -			#size-cells = <0>;
> -			sgmii_phy0: ethernet-phy@2 {
> -				reg = <0x2>;
> -			};
> -		};
> -	};
> -
> -1.2. Using the central MDIO PCIe endpoint device
> -
> -In this case, the mdio node should be defined as another PCIe
> -endpoint node, at the same level with the ENETC port nodes.
> -
> -Required properties:
> -
> -- reg		: Specifies PCIe Device Number and Function
> -		  Number of the ENETC endpoint device, according
> -		  to parent node bindings.
> -- compatible	: Should be "fsl,enetc-mdio".
> -
> -The remaining required mdio bus properties are standard, their bindings
> -already defined in Documentation/devicetree/bindings/net/mdio.txt.
> -
> -Example:
> -
> -	ethernet@0,0 {
> -		compatible = "fsl,enetc";
> -		reg = <0x000000 0 0 0 0>;
> -		phy-handle = <&sgmii_phy0>;
> -		phy-connection-type = "sgmii";
> -	};
> -
> -	mdio@0,3 {
> -		compatible = "fsl,enetc-mdio";
> -		reg = <0x000300 0 0 0 0>;
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -		sgmii_phy0: ethernet-phy@2 {
> -			reg = <0x2>;
> -		};
> -	};
> -
> -2. The ENETC port is an internal port or has a fixed-link external
> -connection
> -
> -In this case, the ENETC port node defines a fixed link connection,
> -as specified by Documentation/devicetree/bindings/net/fixed-link.txt.
> -
> -Required:
> -
> -- fixed-link	: "fixed-link" node, defined in "fixed-link.txt".
> -
> -Example:
> -	ethernet@0,2 {
> -		compatible = "fsl,enetc";
> -		reg = <0x000200 0 0 0 0>;
> -		fixed-link {
> -			speed = <1000>;
> -			full-duplex;
> -		};
> -	};
> -
> -* Integrated Endpoint Register Block bindings
> -
> -Optionally, the fsl_enetc driver can probe on the Integrated Endpoint Register
> -Block, which preconfigures the FIFO limits for the ENETC ports. This is a node
> -with the following properties:
> -
> -- reg		: Specifies the address in the SoC memory space.
> -- compatible	: Must be "fsl,ls1028a-enetc-ierb".
> -
> -Example:
> -	ierb@1f0800000 {
> -		compatible = "fsl,ls1028a-enetc-ierb";
> -		reg = <0x01 0xf0800000 0x0 0x10000>;
> -	};
> diff --git a/Documentation/devicetree/bindings/net/fsl-enetc.yaml b/Documentation/devicetree/bindings/net/fsl-enetc.yaml
> new file mode 100644
> index 0000000000000..e60b375395fcc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/fsl-enetc.yaml
> @@ -0,0 +1,43 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/fsl-enetc.yaml#

fsl,enetc.yaml

> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ENETC ethernet


Best regards,
Krzysztof


      reply	other threads:[~2024-06-26  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 20:22 [PATCH 1/1] dt-bindings: net: convert enetc to yaml Frank Li
2024-06-26  8:24 ` Krzysztof Kozlowski [this message]

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=171cb592-1f5b-414d-bee2-ece87931f6cb@kernel.org \
    --to=krzk@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=imx@lists.linux.dev \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).