netdev.vger.kernel.org archive mirror
 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 5/8] dt-bindings: net: Convert AMAC to YAML
Date: Wed, 8 Dec 2021 13:46:42 -0600	[thread overview]
Message-ID: <YbELog9TiauuK3fE@robh.at.kernel.org> (raw)
In-Reply-To: <20211206180049.2086907-6-f.fainelli@gmail.com>

On Mon, Dec 06, 2021 at 10:00:46AM -0800, Florian Fainelli wrote:
> Convert the Broadcom AMAC Device Tree binding to YAML to help with
> schema and dtbs checking.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  .../devicetree/bindings/net/brcm,amac.txt     | 30 -------
>  .../devicetree/bindings/net/brcm,amac.yaml    | 88 +++++++++++++++++++
>  MAINTAINERS                                   |  2 +-
>  3 files changed, 89 insertions(+), 31 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/net/brcm,amac.txt
>  create mode 100644 Documentation/devicetree/bindings/net/brcm,amac.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/brcm,amac.txt b/Documentation/devicetree/bindings/net/brcm,amac.txt
> deleted file mode 100644
> index 0120ebe93262..000000000000
> --- a/Documentation/devicetree/bindings/net/brcm,amac.txt
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -Broadcom AMAC Ethernet Controller Device Tree Bindings
> --------------------------------------------------------------
> -
> -Required properties:
> - - compatible:	"brcm,amac"
> -		"brcm,nsp-amac"
> -		"brcm,ns2-amac"
> - - reg:		Address and length of the register set for the device. It
> -		contains the information of registers in the same order as
> -		described by reg-names
> - - reg-names:	Names of the registers.
> -		"amac_base":	Address and length of the GMAC registers
> -		"idm_base":	Address and length of the GMAC IDM registers
> -				(required for NSP and Northstar2)
> -		"nicpm_base":	Address and length of the NIC Port Manager
> -				registers (required for Northstar2)
> - - interrupts:	Interrupt number
> -
> -The MAC address will be determined using the optional properties
> -defined in ethernet.txt.
> -
> -Examples:
> -
> -amac0: ethernet@18022000 {
> -	compatible = "brcm,nsp-amac";
> -	reg = <0x18022000 0x1000>,
> -	      <0x18110000 0x1000>;
> -	reg-names = "amac_base", "idm_base";
> -	interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
> -};
> diff --git a/Documentation/devicetree/bindings/net/brcm,amac.yaml b/Documentation/devicetree/bindings/net/brcm,amac.yaml
> new file mode 100644
> index 000000000000..d9de68aba7d3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/brcm,amac.yaml
> @@ -0,0 +1,88 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/brcm,amac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom AMAC Ethernet Controller Device Tree Bindings
> +
> +maintainers:
> +  - Florian Fainelli <f.fainelli@gmail.com>
> +
> +allOf:
> +  - $ref: "ethernet-controller.yaml#"
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - brcm,amac
> +    then:
> +      properties:
> +        reg:
> +          minItems: 1
> +          maxItems: 2
> +        reg-names:
> +          minItems: 1
> +          maxItems: 2
> +          items:
> +            - const: amac_base
> +            - const: idm_base
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - brcm,nsp-amac
> +    then:
> +      properties:
> +        reg:
> +          minItems: 2
> +          maxItems: 2
> +        reg-names:
> +          items:
> +            - const: amac_base
> +            - const: idm_base
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - brcm,ns2-amac
> +    then:
> +      properties:

> +        reg:
> +          minItems: 3
> +          maxItems: 3
> +        reg-names:
> +          items:
> +            - const: amac_base
> +            - const: idm_base
> +            - const: nicpm_base

Move this to the main section so that the names are only defined once. 
Then here you can just set the number of items.

> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,amac
> +      - brcm,nsp-amac
> +      - brcm,ns2-amac
> +
> +  interrupts:
> +    maxItems: 1
> +
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +   #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +   amac0: ethernet@18022000 {
> +      compatible = "brcm,nsp-amac";
> +      reg = <0x18022000 0x1000>,
> +            <0x18110000 0x1000>;
> +      reg-names = "amac_base", "idm_base";
> +      interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
> +   };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5e1064c23f41..404e76d625f1 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3861,7 +3861,7 @@ M:	Rafał Miłecki <rafal@milecki.pl>
>  M:	bcm-kernel-feedback-list@broadcom.com
>  L:	netdev@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/devicetree/bindings/net/brcm,amac.txt
> +F:	Documentation/devicetree/bindings/net/brcm,amac.yaml
>  F:	drivers/net/ethernet/broadcom/bgmac*
>  F:	drivers/net/ethernet/broadcom/unimac.h
>  
> -- 
> 2.25.1
> 
> 

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

Thread overview: 18+ 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 ` [PATCH v3 1/8] dt-bindings: net: brcm,unimac-mdio: reg-names is optional Florian Fainelli
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-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-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-08 19:32   ` 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-08 19:46   ` Rob Herring [this message]
2021-12-06 18:00 ` [PATCH v3 6/8] dt-bindings: net: Convert SYSTEMPORT " Florian Fainelli
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-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-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=YbELog9TiauuK3fE@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 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).