dt-bindings: net: ks8851: Convert to YAML schema
Subsystems (3)
PATCH v2 1/1 dt-bindings: net: ks8851: Convert to YAML schema
Convert the Micrel KSZ8851 DT bindings to YAML schema.
To: [email protected]
---
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
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +94 -0
@@ -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 <[email protected]> + +properties: + compatible: + oneOf: + - const: "micrel,ks8851" # SPI bus option + - const: "micrel,ks8851-mll" # Parallel bus option + + interrupts: + maxItems: 1 + + reg: + minItems: 1 + maxItems: 2 + + reset-gpios: + maxItems: 1 + description: + The reset_n input pin + + vdd-supply: + description: | + Analog 3.3V supply for Ethernet MAC (see regulator/regulator.yaml) + + 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" + 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>; + }; + };
Documentation/devicetree/bindings/net/micrel-ks8851.txt deleted +0 -18
@@ -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
Signature · 1 line
2.30.2
Rob Herring
maintainerQuoted 33 lines · Marek Vasut
Convert the Micrel KSZ8851 DT bindings to YAML schema.
Signed-off-by Marek Vasut <[email protected]>Cc Andrew Lunn <[email protected]>Cc David S. Miller <[email protected]>Cc Lukas Wunner <[email protected]>Cc Petr Stetiar <[email protected]>Cc Rob Herring <[email protected]>To: [email protected]
---
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.txtDocumentation/devicetree/bindings/net/micrel,ks8851.yaml new file +6
-0@@ -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# +
Documentation/devicetree/bindings/net/micrel,ks8851.yaml line 16
Quoted 10 lines
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +10
-0+title: Micrel KS8851 Ethernet MAC (SPI and Parallel bus options) + +maintainers: + - Marek Vasut <[email protected]> + +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'.
Documentation/devicetree/bindings/net/micrel,ks8851.yaml line 23
Quoted 7 lines
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +7
-0+ + interrupts: + maxItems: 1 + + reg: + minItems: 1 + maxItems: 2
Need to define what each entry is when more than 1.
Documentation/devicetree/bindings/net/micrel,ks8851.yaml line 32
Quoted 9 lines
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +9
-0+ + 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).
Quoted 7 lines
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +7
-0+ + vdd-io-supply: + description: | + Digital 1.8V IO supply for Ethernet MAC (see regulator/regulator.yaml) + +required: + - compatible
Documentation/devicetree/bindings/net/micrel,ks8851.yaml line 49
Quoted 10 lines
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +10
-0+ - reg + - interrupts + +allOf: + - $ref: ethernet-controller.yaml# + - if: + properties: + compatible: + contains: + const: "micrel,ks8851"
Drop quotes
Quoted 73 lines
Documentation/devicetree/bindings/net/micrel,ks8851.yaml new file +45
-0+ 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>; + }; + };Documentation/devicetree/bindings/net/micrel-ks8851.txt deleted +0
-18@@ -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 pinSignature · 1 line
2.30.2