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

dt-bindings: net: convert Broadcom Starfighter 2 binding to the json-schema

This helps validating DTS files. Only the current (not deprecated one)
binding was converted.

Minor changes:
1. Dropped dsa/dsa.txt references
2. Updated node name to match dsa.yaml requirement
3. Fixed 2 typos in examples

The new binding was validated using the dt_binding_check.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20210106213202.17459-1-zajec5@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Rafał Miłecki and committed by
Jakub Kicinski
c7ee3a40 49888961

+175 -98
+3 -98
Documentation/devicetree/bindings/net/brcm,bcm7445-switch-v4.0.txt
··· 1 1 * Broadcom Starfighter 2 integrated swich 2 2 3 - Required properties: 3 + See dsa/brcm,bcm7445-switch-v4.0.yaml for the documentation. 4 4 5 - - compatible: should be one of 6 - "brcm,bcm7445-switch-v4.0" 7 - "brcm,bcm7278-switch-v4.0" 8 - "brcm,bcm7278-switch-v4.8" 9 - - reg: addresses and length of the register sets for the device, must be 6 10 - pairs of register addresses and lengths 11 - - interrupts: interrupts for the devices, must be two interrupts 12 - - #address-cells: must be 1, see dsa/dsa.txt 13 - - #size-cells: must be 0, see dsa/dsa.txt 14 - 15 - Deprecated binding required properties: 5 + *Deprecated* binding required properties: 16 6 17 7 - dsa,mii-bus: phandle to the MDIO bus controller, see dsa/dsa.txt 18 8 - dsa,ethernet: phandle to the CPU network interface controller, see dsa/dsa.txt 19 9 - #address-cells: must be 2, see dsa/dsa.txt 20 - 21 - Subnodes: 22 - 23 - The integrated switch subnode should be specified according to the binding 24 - described in dsa/dsa.txt. 25 - 26 - Optional properties: 27 - 28 - - reg-names: litteral names for the device base register addresses, when present 29 - must be: "core", "reg", "intrl2_0", "intrl2_1", "fcb", "acb" 30 - 31 - - interrupt-names: litternal names for the device interrupt lines, when present 32 - must be: "switch_0" and "switch_1" 33 - 34 - - brcm,num-gphy: specify the maximum number of integrated gigabit PHYs in the 35 - switch 36 - 37 - - brcm,num-rgmii-ports: specify the maximum number of RGMII interfaces supported 38 - by the switch 39 - 40 - - brcm,fcb-pause-override: boolean property, if present indicates that the switch 41 - supports Failover Control Block pause override capability 42 - 43 - - brcm,acb-packets-inflight: boolean property, if present indicates that the switch 44 - Admission Control Block supports reporting the number of packets in-flight in a 45 - switch queue 46 - 47 - - resets: a single phandle and reset identifier pair. See 48 - Documentation/devicetree/bindings/reset/reset.txt for details. 49 - 50 - - reset-names: If the "reset" property is specified, this property should have 51 - the value "switch" to denote the switch reset line. 52 - 53 - - clocks: when provided, the first phandle is to the switch's main clock and 54 - is valid for both BCM7445 and BCM7278. The second phandle is only applicable 55 - to BCM7445 and is to support dividing the switch core clock. 56 - 57 - - clock-names: when provided, the first phandle must be "sw_switch", and the 58 - second must be named "sw_switch_mdiv". 59 - 60 - Port subnodes: 61 - 62 - Optional properties: 63 - 64 - - brcm,use-bcm-hdr: boolean property, if present, indicates that the switch 65 - port has Broadcom tags enabled (per-packet metadata) 66 - 67 - Example: 68 - 69 - switch_top@f0b00000 { 70 - compatible = "simple-bus"; 71 - #size-cells = <1>; 72 - #address-cells = <1>; 73 - ranges = <0 0xf0b00000 0x40804>; 74 - 75 - ethernet_switch@0 { 76 - compatible = "brcm,bcm7445-switch-v4.0"; 77 - #size-cells = <0>; 78 - #address-cells = <1>; 79 - reg = <0x0 0x40000 80 - 0x40000 0x110 81 - 0x40340 0x30 82 - 0x40380 0x30 83 - 0x40400 0x34 84 - 0x40600 0x208>; 85 - reg-names = "core", "reg", intrl2_0", "intrl2_1", 86 - "fcb, "acb"; 87 - interrupts = <0 0x18 0 88 - 0 0x19 0>; 89 - brcm,num-gphy = <1>; 90 - brcm,num-rgmii-ports = <2>; 91 - brcm,fcb-pause-override; 92 - brcm,acb-packets-inflight; 93 - 94 - ports { 95 - #address-cells = <1>; 96 - #size-cells = <0>; 97 - 98 - port@0 { 99 - label = "gphy"; 100 - reg = <0>; 101 - }; 102 - }; 103 - }; 104 - }; 105 10 106 11 Example using the old DSA DeviceTree binding: 107 12 ··· 37 132 switch@0 { 38 133 reg = <0 0>; 39 134 #size-cells = <0>; 40 - #address-cells <1>; 135 + #address-cells = <1>; 41 136 42 137 port@0 { 43 138 label = "gphy";
+172
Documentation/devicetree/bindings/net/dsa/brcm,sf2.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/dsa/brcm,sf2.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom Starfighter 2 integrated swich 8 + 9 + maintainers: 10 + - Florian Fainelli <f.fainelli@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + items: 15 + - enum: 16 + - brcm,bcm7278-switch-v4.0 17 + - brcm,bcm7278-switch-v4.8 18 + - brcm,bcm7445-switch-v4.0 19 + 20 + reg: 21 + minItems: 6 22 + maxItems: 6 23 + 24 + reg-names: 25 + items: 26 + - const: core 27 + - const: reg 28 + - const: intrl2_0 29 + - const: intrl2_1 30 + - const: fcb 31 + - const: acb 32 + 33 + interrupts: 34 + minItems: 2 35 + maxItems: 2 36 + 37 + interrupt-names: 38 + items: 39 + - const: switch_0 40 + - const: switch_1 41 + 42 + resets: 43 + maxItems: 1 44 + 45 + reset-names: 46 + const: switch 47 + 48 + clocks: 49 + minItems: 1 50 + maxItems: 2 51 + items: 52 + - description: switch's main clock 53 + - description: dividing of the switch core clock 54 + 55 + clock-names: 56 + minItems: 1 57 + maxItems: 2 58 + items: 59 + - const: sw_switch 60 + - const: sw_switch_mdiv 61 + 62 + brcm,num-gphy: 63 + $ref: /schemas/types.yaml#/definitions/uint32 64 + description: maximum number of integrated gigabit PHYs in the switch 65 + 66 + brcm,num-rgmii-ports: 67 + $ref: /schemas/types.yaml#/definitions/uint32 68 + description: maximum number of RGMII interfaces supported by the switch 69 + 70 + brcm,fcb-pause-override: 71 + description: if present indicates that the switch supports Failover Control 72 + Block pause override capability 73 + type: boolean 74 + 75 + brcm,acb-packets-inflight: 76 + description: if present indicates that the switch Admission Control Block 77 + supports reporting the number of packets in-flight in a switch queue 78 + type: boolean 79 + 80 + "#address-cells": 81 + const: 1 82 + 83 + "#size-cells": 84 + const: 0 85 + 86 + ports: 87 + type: object 88 + 89 + properties: 90 + brcm,use-bcm-hdr: 91 + description: if present, indicates that the switch port has Broadcom 92 + tags enabled (per-packet metadata) 93 + type: boolean 94 + 95 + required: 96 + - reg 97 + - interrupts 98 + - "#address-cells" 99 + - "#size-cells" 100 + 101 + allOf: 102 + - $ref: "dsa.yaml#" 103 + - if: 104 + properties: 105 + compatible: 106 + contains: 107 + enum: 108 + - brcm,bcm7278-switch-v4.0 109 + - brcm,bcm7278-switch-v4.8 110 + then: 111 + properties: 112 + clocks: 113 + minItems: 1 114 + maxItems: 1 115 + clock-names: 116 + minItems: 1 117 + maxItems: 1 118 + required: 119 + - clocks 120 + - clock-names 121 + - if: 122 + properties: 123 + compatible: 124 + contains: 125 + const: brcm,bcm7445-switch-v4.0 126 + then: 127 + properties: 128 + clocks: 129 + minItems: 2 130 + maxItems: 2 131 + clock-names: 132 + minItems: 2 133 + maxItems: 2 134 + required: 135 + - clocks 136 + - clock-names 137 + 138 + additionalProperties: false 139 + 140 + examples: 141 + - | 142 + switch@f0b00000 { 143 + compatible = "brcm,bcm7445-switch-v4.0"; 144 + #address-cells = <1>; 145 + #size-cells = <0>; 146 + reg = <0xf0b00000 0x40000>, 147 + <0xf0b40000 0x110>, 148 + <0xf0b40340 0x30>, 149 + <0xf0b40380 0x30>, 150 + <0xf0b40400 0x34>, 151 + <0xf0b40600 0x208>; 152 + reg-names = "core", "reg", "intrl2_0", "intrl2_1", 153 + "fcb", "acb"; 154 + interrupts = <0 0x18 0>, 155 + <0 0x19 0>; 156 + clocks = <&sw_switch>, <&sw_switch_mdiv>; 157 + clock-names = "sw_switch", "sw_switch_mdiv"; 158 + brcm,num-gphy = <1>; 159 + brcm,num-rgmii-ports = <2>; 160 + brcm,fcb-pause-override; 161 + brcm,acb-packets-inflight; 162 + 163 + ports { 164 + #address-cells = <1>; 165 + #size-cells = <0>; 166 + 167 + port@0 { 168 + label = "gphy"; 169 + reg = <0>; 170 + }; 171 + }; 172 + };