Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: net: convert net/cortina,gemini-ethernet to yaml

Converts net/cortina,gemini-ethernet.txt to yaml
This permits to detect some missing properties like interrupts

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220201144940.2488782-1-clabbe@baylibre.com

authored by

Corentin Labbe and committed by
Rob Herring
208b65f7 f4e82f19

+137 -92
-92
Documentation/devicetree/bindings/net/cortina,gemini-ethernet.txt
··· 1 - Cortina Systems Gemini Ethernet Controller 2 - ========================================== 3 - 4 - This ethernet controller is found in the Gemini SoC family: 5 - StorLink SL3512 and SL3516, also known as Cortina Systems 6 - CS3512 and CS3516. 7 - 8 - Required properties: 9 - - compatible: must be "cortina,gemini-ethernet" 10 - - reg: must contain the global registers and the V-bit and A-bit 11 - memory areas, in total three register sets. 12 - - syscon: a phandle to the system controller 13 - - #address-cells: must be specified, must be <1> 14 - - #size-cells: must be specified, must be <1> 15 - - ranges: should be state like this giving a 1:1 address translation 16 - for the subnodes 17 - 18 - The subnodes represents the two ethernet ports in this device. 19 - They are not independent of each other since they share resources 20 - in the parent node, and are thus children. 21 - 22 - Required subnodes: 23 - - port0: contains the resources for ethernet port 0 24 - - port1: contains the resources for ethernet port 1 25 - 26 - Required subnode properties: 27 - - compatible: must be "cortina,gemini-ethernet-port" 28 - - reg: must contain two register areas: the DMA/TOE memory and 29 - the GMAC memory area of the port 30 - - interrupts: should contain the interrupt line of the port. 31 - this is nominally a level interrupt active high. 32 - - resets: this must provide an SoC-integrated reset line for 33 - the port. 34 - - clocks: this should contain a handle to the PCLK clock for 35 - clocking the silicon in this port 36 - - clock-names: must be "PCLK" 37 - 38 - Optional subnode properties: 39 - - phy-mode: see ethernet.txt 40 - - phy-handle: see ethernet.txt 41 - 42 - Example: 43 - 44 - mdio-bus { 45 - (...) 46 - phy0: ethernet-phy@1 { 47 - reg = <1>; 48 - device_type = "ethernet-phy"; 49 - }; 50 - phy1: ethernet-phy@3 { 51 - reg = <3>; 52 - device_type = "ethernet-phy"; 53 - }; 54 - }; 55 - 56 - 57 - ethernet@60000000 { 58 - compatible = "cortina,gemini-ethernet"; 59 - reg = <0x60000000 0x4000>, /* Global registers, queue */ 60 - <0x60004000 0x2000>, /* V-bit */ 61 - <0x60006000 0x2000>; /* A-bit */ 62 - syscon = <&syscon>; 63 - #address-cells = <1>; 64 - #size-cells = <1>; 65 - ranges; 66 - 67 - gmac0: ethernet-port@0 { 68 - compatible = "cortina,gemini-ethernet-port"; 69 - reg = <0x60008000 0x2000>, /* Port 0 DMA/TOE */ 70 - <0x6000a000 0x2000>; /* Port 0 GMAC */ 71 - interrupt-parent = <&intcon>; 72 - interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; 73 - resets = <&syscon GEMINI_RESET_GMAC0>; 74 - clocks = <&syscon GEMINI_CLK_GATE_GMAC0>; 75 - clock-names = "PCLK"; 76 - phy-mode = "rgmii"; 77 - phy-handle = <&phy0>; 78 - }; 79 - 80 - gmac1: ethernet-port@1 { 81 - compatible = "cortina,gemini-ethernet-port"; 82 - reg = <0x6000c000 0x2000>, /* Port 1 DMA/TOE */ 83 - <0x6000e000 0x2000>; /* Port 1 GMAC */ 84 - interrupt-parent = <&intcon>; 85 - interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; 86 - resets = <&syscon GEMINI_RESET_GMAC1>; 87 - clocks = <&syscon GEMINI_CLK_GATE_GMAC1>; 88 - clock-names = "PCLK"; 89 - phy-mode = "rgmii"; 90 - phy-handle = <&phy1>; 91 - }; 92 - };
+137
Documentation/devicetree/bindings/net/cortina,gemini-ethernet.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/cortina,gemini-ethernet.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Cortina Systems Gemini Ethernet Controller 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + description: | 13 + This ethernet controller is found in the Gemini SoC family: 14 + StorLink SL3512 and SL3516, also known as Cortina Systems 15 + CS3512 and CS3516. 16 + 17 + properties: 18 + compatible: 19 + const: cortina,gemini-ethernet 20 + 21 + reg: 22 + minItems: 3 23 + description: must contain the global registers and the V-bit and A-bit 24 + memory areas, in total three register sets. 25 + 26 + "#address-cells": 27 + const: 1 28 + 29 + "#size-cells": 30 + const: 1 31 + 32 + ranges: true 33 + 34 + #The subnodes represents the two ethernet ports in this device. 35 + #They are not independent of each other since they share resources 36 + #in the parent node, and are thus children. 37 + patternProperties: 38 + "^ethernet-port@[0-9]+$": 39 + type: object 40 + description: contains the resources for ethernet port 41 + allOf: 42 + - $ref: ethernet-controller.yaml# 43 + properties: 44 + compatible: 45 + const: cortina,gemini-ethernet-port 46 + 47 + reg: 48 + items: 49 + - description: DMA/TOE memory 50 + - description: GMAC memory area of the port 51 + 52 + interrupts: 53 + maxItems: 1 54 + description: should contain the interrupt line of the port. 55 + this is nominally a level interrupt active high. 56 + 57 + resets: 58 + maxItems: 1 59 + description: this must provide an SoC-integrated reset line for the port. 60 + 61 + clocks: 62 + maxItems: 1 63 + description: this should contain a handle to the PCLK clock for 64 + clocking the silicon in this port 65 + 66 + clock-names: 67 + const: PCLK 68 + 69 + required: 70 + - reg 71 + - compatible 72 + - interrupts 73 + - resets 74 + - clocks 75 + - clock-names 76 + 77 + required: 78 + - compatible 79 + - reg 80 + - ranges 81 + 82 + additionalProperties: false 83 + 84 + examples: 85 + - | 86 + #include <dt-bindings/interrupt-controller/irq.h> 87 + #include <dt-bindings/clock/cortina,gemini-clock.h> 88 + #include <dt-bindings/reset/cortina,gemini-reset.h> 89 + mdio0: mdio { 90 + #address-cells = <1>; 91 + #size-cells = <0>; 92 + phy0: ethernet-phy@1 { 93 + reg = <1>; 94 + device_type = "ethernet-phy"; 95 + }; 96 + phy1: ethernet-phy@3 { 97 + reg = <3>; 98 + device_type = "ethernet-phy"; 99 + }; 100 + }; 101 + 102 + 103 + ethernet@60000000 { 104 + compatible = "cortina,gemini-ethernet"; 105 + reg = <0x60000000 0x4000>, /* Global registers, queue */ 106 + <0x60004000 0x2000>, /* V-bit */ 107 + <0x60006000 0x2000>; /* A-bit */ 108 + #address-cells = <1>; 109 + #size-cells = <1>; 110 + ranges; 111 + 112 + gmac0: ethernet-port@0 { 113 + compatible = "cortina,gemini-ethernet-port"; 114 + reg = <0x60008000 0x2000>, /* Port 0 DMA/TOE */ 115 + <0x6000a000 0x2000>; /* Port 0 GMAC */ 116 + interrupt-parent = <&intcon>; 117 + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; 118 + resets = <&syscon GEMINI_RESET_GMAC0>; 119 + clocks = <&syscon GEMINI_CLK_GATE_GMAC0>; 120 + clock-names = "PCLK"; 121 + phy-mode = "rgmii"; 122 + phy-handle = <&phy0>; 123 + }; 124 + 125 + gmac1: ethernet-port@1 { 126 + compatible = "cortina,gemini-ethernet-port"; 127 + reg = <0x6000c000 0x2000>, /* Port 1 DMA/TOE */ 128 + <0x6000e000 0x2000>; /* Port 1 GMAC */ 129 + interrupt-parent = <&intcon>; 130 + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; 131 + resets = <&syscon GEMINI_RESET_GMAC1>; 132 + clocks = <&syscon GEMINI_CLK_GATE_GMAC1>; 133 + clock-names = "PCLK"; 134 + phy-mode = "rgmii"; 135 + phy-handle = <&phy1>; 136 + }; 137 + };