netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Marek Vasut <marex@denx.de>
Cc: devicetree@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Lukas Wunner <lukas@wunner.de>, Petr Stetiar <ynezz@true.cz>,
	linux@dh-electronics.com, netdev@vger.kernel.org
Subject: Re: [PATCH V2] dt-bindings: net: ks8851: Convert to YAML schema
Date: Fri, 18 Jun 2021 15:23:04 -0600	[thread overview]
Message-ID: <20210618212304.GA2927502@robh.at.kernel.org> (raw)
In-Reply-To: <20210610145954.29719-1-marex@denx.de>

On Thu, Jun 10, 2021 at 04:59:54PM +0200, Marek Vasut wrote:
> Convert the Micrel KSZ8851 DT bindings to YAML schema.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Petr Stetiar <ynezz@true.cz>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: linux@dh-electronics.com
> Cc: netdev@vger.kernel.org
> To: devicetree@vger.kernel.org
> ---
> V2: - Explicitly state the bindings are for both SPI and parallel bus options
>     - Switch the license to (GPL-2.0-only OR BSD-2-Clause)
> ---
>  .../bindings/net/micrel,ks8851.yaml           | 94 +++++++++++++++++++
>  .../devicetree/bindings/net/micrel-ks8851.txt | 18 ----
>  2 files changed, 94 insertions(+), 18 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/micrel,ks8851.yaml
>  delete mode 100644 Documentation/devicetree/bindings/net/micrel-ks8851.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/micrel,ks8851.yaml b/Documentation/devicetree/bindings/net/micrel,ks8851.yaml
> new file mode 100644
> index 000000000000..3a3fc61baac3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/micrel,ks8851.yaml
> @@ -0,0 +1,94 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/micrel,ks8851.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Micrel KS8851 Ethernet MAC (SPI and Parallel bus options)
> +
> +maintainers:
> +  - Marek Vasut <marex@denx.de>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: "micrel,ks8851"      # SPI bus option
> +      - const: "micrel,ks8851-mll"  # Parallel bus option

Don't need quotes and use 'enum' rather than 'oneOf+const'.

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  reg:
> +    minItems: 1
> +    maxItems: 2

Need to define what each entry is when more than 1.

> +
> +  reset-gpios:
> +    maxItems: 1
> +    description:
> +      The reset_n input pin
> +
> +  vdd-supply:
> +    description: |
> +      Analog 3.3V supply for Ethernet MAC (see regulator/regulator.yaml)

Drop (see regulator/regulator.yaml). (If we want that, we should 
generate the cross ref).

> +
> +  vdd-io-supply:
> +    description: |
> +      Digital 1.8V IO supply for Ethernet MAC (see regulator/regulator.yaml)
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: "micrel,ks8851"

Drop quotes

> +    then:
> +      properties:
> +        reg:
> +          maxItems: 1
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: "micrel,ks8851-mll"
> +    then:
> +      properties:
> +        reg:
> +          minItems: 2
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    /* SPI bus option */
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        ethernet@0 {
> +            compatible = "micrel,ks8851";
> +            reg = <0>;
> +            interrupt-parent = <&msmgpio>;
> +            interrupts = <90 8>;
> +            vdd-supply = <&ext_l2>;
> +            vdd-io-supply = <&pm8921_lvs6>;
> +            reset-gpios = <&msmgpio 89 0>;
> +        };
> +    };
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    /* Parallel bus option */
> +    memory-controller {
> +        #address-cells = <2>;
> +        #size-cells = <1>;
> +        ethernet@1,0 {
> +            compatible = "micrel,ks8851-mll";
> +            reg = <1 0x0 0x2>, <1 0x2 0x20000>;
> +            interrupt-parent = <&gpioc>;
> +            interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/net/micrel-ks8851.txt b/Documentation/devicetree/bindings/net/micrel-ks8851.txt
> deleted file mode 100644
> index bbdf9a7359a2..000000000000
> --- a/Documentation/devicetree/bindings/net/micrel-ks8851.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -Micrel KS8851 Ethernet mac (MLL)
> -
> -Required properties:
> -- compatible = "micrel,ks8851-mll" of parallel interface
> -- reg : 2 physical address and size of registers for data and command
> -- interrupts : interrupt connection
> -
> -Micrel KS8851 Ethernet mac (SPI)
> -
> -Required properties:
> -- compatible = "micrel,ks8851" or the deprecated "ks8851"
> -- reg : chip select number
> -- interrupts : interrupt connection
> -
> -Optional properties:
> -- vdd-supply: analog 3.3V supply for Ethernet mac
> -- vdd-io-supply: digital 1.8V IO supply for Ethernet mac
> -- reset-gpios: reset_n input pin
> -- 
> 2.30.2
> 
> 

      reply	other threads:[~2021-06-18 21:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 14:59 [PATCH V2] dt-bindings: net: ks8851: Convert to YAML schema Marek Vasut
2021-06-18 21:23 ` Rob Herring [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=20210618212304.GA2927502@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux@dh-electronics.com \
    --cc=lukas@wunner.de \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=ynezz@true.cz \
    /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).