Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | %YAML 1.2 |
| 3 | --- |
Rob Herring | e1ff739 | 2019-07-26 17:36:52 -0600 | [diff] [blame] | 4 | $id: http://devicetree.org/schemas/net/allwinner,sun8i-a83t-emac.yaml# |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: Allwinner A83t EMAC Device Tree Bindings |
| 8 | |
| 9 | maintainers: |
| 10 | - Chen-Yu Tsai <wens@csie.org> |
Maxime Ripard | 5c7404b | 2019-12-09 10:32:48 +0100 | [diff] [blame] | 11 | - Maxime Ripard <mripard@kernel.org> |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 12 | |
| 13 | properties: |
| 14 | compatible: |
| 15 | oneOf: |
| 16 | - const: allwinner,sun8i-a83t-emac |
| 17 | - const: allwinner,sun8i-h3-emac |
Maxime Ripard | b33be51 | 2021-09-24 09:27:55 +0200 | [diff] [blame] | 18 | - const: allwinner,sun8i-r40-gmac |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 19 | - const: allwinner,sun8i-v3s-emac |
| 20 | - const: allwinner,sun50i-a64-emac |
| 21 | - items: |
Samuel Holland | 0f31ab2 | 2021-09-07 22:02:40 -0500 | [diff] [blame] | 22 | - enum: |
| 23 | - allwinner,sun20i-d1-emac |
| 24 | - allwinner,sun50i-h6-emac |
Rob Herring | 9f60a65 | 2020-04-15 19:55:48 -0500 | [diff] [blame] | 25 | - const: allwinner,sun50i-a64-emac |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 26 | |
| 27 | reg: |
| 28 | maxItems: 1 |
| 29 | |
| 30 | interrupts: |
| 31 | maxItems: 1 |
| 32 | |
| 33 | interrupt-names: |
| 34 | const: macirq |
| 35 | |
| 36 | clocks: |
| 37 | maxItems: 1 |
| 38 | |
| 39 | clock-names: |
| 40 | const: stmmaceth |
| 41 | |
| 42 | syscon: |
Rob Herring | d69c6dd | 2020-12-17 16:34:29 -0600 | [diff] [blame] | 43 | $ref: /schemas/types.yaml#/definitions/phandle |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 44 | description: |
| 45 | Phandle to the device containing the EMAC or GMAC clock |
| 46 | register |
| 47 | |
| 48 | required: |
| 49 | - compatible |
| 50 | - reg |
| 51 | - interrupts |
| 52 | - interrupt-names |
| 53 | - clocks |
| 54 | - clock-names |
| 55 | - resets |
| 56 | - reset-names |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 57 | - phy-handle |
Maxime Ripard | 67d0da9 | 2019-07-03 11:55:12 +0200 | [diff] [blame] | 58 | - phy-mode |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 59 | - syscon |
| 60 | |
| 61 | allOf: |
| 62 | - $ref: "snps,dwmac.yaml#" |
| 63 | - if: |
| 64 | properties: |
| 65 | compatible: |
| 66 | contains: |
| 67 | enum: |
| 68 | - allwinner,sun8i-a83t-emac |
| 69 | - allwinner,sun8i-h3-emac |
| 70 | - allwinner,sun8i-v3s-emac |
| 71 | - allwinner,sun50i-a64-emac |
| 72 | |
| 73 | then: |
| 74 | properties: |
| 75 | allwinner,tx-delay-ps: |
| 76 | default: 0 |
| 77 | minimum: 0 |
| 78 | maximum: 700 |
| 79 | multipleOf: 100 |
| 80 | description: |
| 81 | External RGMII PHY TX clock delay chain value in ps. |
| 82 | |
| 83 | allwinner,rx-delay-ps: |
| 84 | default: 0 |
| 85 | minimum: 0 |
| 86 | maximum: 3100 |
| 87 | multipleOf: 100 |
| 88 | description: |
| 89 | External RGMII PHY TX clock delay chain value in ps. |
| 90 | |
| 91 | - if: |
| 92 | properties: |
| 93 | compatible: |
| 94 | contains: |
| 95 | enum: |
Maxime Ripard | b33be51 | 2021-09-24 09:27:55 +0200 | [diff] [blame] | 96 | - allwinner,sun8i-r40-gmac |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 97 | |
| 98 | then: |
| 99 | properties: |
| 100 | allwinner,rx-delay-ps: |
| 101 | default: 0 |
| 102 | minimum: 0 |
| 103 | maximum: 700 |
| 104 | multipleOf: 100 |
| 105 | description: |
| 106 | External RGMII PHY TX clock delay chain value in ps. |
| 107 | |
| 108 | - if: |
| 109 | properties: |
| 110 | compatible: |
| 111 | contains: |
| 112 | enum: |
| 113 | - allwinner,sun8i-h3-emac |
| 114 | - allwinner,sun8i-v3s-emac |
| 115 | |
| 116 | then: |
| 117 | properties: |
| 118 | allwinner,leds-active-low: |
Rob Herring | d69c6dd | 2020-12-17 16:34:29 -0600 | [diff] [blame] | 119 | $ref: /schemas/types.yaml#/definitions/flag |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 120 | description: |
| 121 | EPHY LEDs are active low. |
| 122 | |
| 123 | mdio-mux: |
| 124 | type: object |
Rob Herring | b2d2864 | 2022-01-05 09:10:09 -0600 | [diff] [blame] | 125 | unevaluatedProperties: false |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 126 | |
| 127 | properties: |
| 128 | compatible: |
| 129 | const: allwinner,sun8i-h3-mdio-mux |
| 130 | |
| 131 | mdio-parent-bus: |
Rob Herring | d69c6dd | 2020-12-17 16:34:29 -0600 | [diff] [blame] | 132 | $ref: /schemas/types.yaml#/definitions/phandle |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 133 | description: |
| 134 | Phandle to EMAC MDIO. |
| 135 | |
Rob Herring | b2d2864 | 2022-01-05 09:10:09 -0600 | [diff] [blame] | 136 | "#address-cells": |
| 137 | const: 1 |
| 138 | |
| 139 | "#size-cells": |
| 140 | const: 0 |
| 141 | |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 142 | mdio@1: |
Rob Herring | b2d2864 | 2022-01-05 09:10:09 -0600 | [diff] [blame] | 143 | $ref: mdio.yaml# |
| 144 | unevaluatedProperties: false |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 145 | description: Internal MDIO Bus |
| 146 | |
| 147 | properties: |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 148 | compatible: |
| 149 | const: allwinner,sun8i-h3-mdio-internal |
| 150 | |
| 151 | reg: |
| 152 | const: 1 |
| 153 | |
| 154 | patternProperties: |
| 155 | "^ethernet-phy@[0-9a-f]$": |
| 156 | type: object |
| 157 | description: |
| 158 | Integrated PHY node |
| 159 | |
| 160 | properties: |
| 161 | clocks: |
| 162 | maxItems: 1 |
| 163 | |
| 164 | resets: |
| 165 | maxItems: 1 |
| 166 | |
| 167 | required: |
| 168 | - clocks |
| 169 | - resets |
| 170 | |
| 171 | |
| 172 | mdio@2: |
Rob Herring | b2d2864 | 2022-01-05 09:10:09 -0600 | [diff] [blame] | 173 | $ref: mdio.yaml# |
| 174 | unevaluatedProperties: false |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 175 | description: External MDIO Bus (H3 only) |
| 176 | |
| 177 | properties: |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 178 | reg: |
| 179 | const: 2 |
| 180 | |
| 181 | required: |
| 182 | - compatible |
| 183 | - mdio-parent-bus |
| 184 | - mdio@1 |
| 185 | |
Maxime Ripard | 454f5d9 | 2019-11-01 14:58:08 +0100 | [diff] [blame] | 186 | unevaluatedProperties: false |
| 187 | |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 188 | examples: |
| 189 | - | |
| 190 | ethernet@1c0b000 { |
| 191 | compatible = "allwinner,sun8i-h3-emac"; |
| 192 | syscon = <&syscon>; |
| 193 | reg = <0x01c0b000 0x104>; |
| 194 | interrupts = <0 82 1>; |
| 195 | interrupt-names = "macirq"; |
| 196 | resets = <&ccu 12>; |
| 197 | reset-names = "stmmaceth"; |
| 198 | clocks = <&ccu 27>; |
| 199 | clock-names = "stmmaceth"; |
| 200 | |
| 201 | phy-handle = <&int_mii_phy>; |
Maxime Ripard | 67d0da9 | 2019-07-03 11:55:12 +0200 | [diff] [blame] | 202 | phy-mode = "mii"; |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 203 | allwinner,leds-active-low; |
| 204 | |
| 205 | mdio1: mdio { |
| 206 | #address-cells = <1>; |
| 207 | #size-cells = <0>; |
| 208 | compatible = "snps,dwmac-mdio"; |
| 209 | }; |
| 210 | |
| 211 | mdio-mux { |
| 212 | compatible = "allwinner,sun8i-h3-mdio-mux"; |
| 213 | #address-cells = <1>; |
| 214 | #size-cells = <0>; |
| 215 | |
| 216 | mdio-parent-bus = <&mdio1>; |
| 217 | |
| 218 | int_mii_phy: mdio@1 { |
| 219 | compatible = "allwinner,sun8i-h3-mdio-internal"; |
| 220 | reg = <1>; |
| 221 | #address-cells = <1>; |
| 222 | #size-cells = <0>; |
| 223 | |
| 224 | ethernet-phy@1 { |
| 225 | reg = <1>; |
| 226 | clocks = <&ccu 67>; |
| 227 | resets = <&ccu 39>; |
| 228 | phy-is-integrated; |
| 229 | }; |
| 230 | }; |
| 231 | |
| 232 | mdio@2 { |
| 233 | reg = <2>; |
| 234 | #address-cells = <1>; |
| 235 | #size-cells = <0>; |
| 236 | }; |
| 237 | }; |
| 238 | }; |
| 239 | |
| 240 | - | |
| 241 | ethernet@1c0b000 { |
| 242 | compatible = "allwinner,sun8i-h3-emac"; |
| 243 | syscon = <&syscon>; |
| 244 | reg = <0x01c0b000 0x104>; |
| 245 | interrupts = <0 82 1>; |
| 246 | interrupt-names = "macirq"; |
| 247 | resets = <&ccu 12>; |
| 248 | reset-names = "stmmaceth"; |
| 249 | clocks = <&ccu 27>; |
| 250 | clock-names = "stmmaceth"; |
| 251 | |
| 252 | phy-handle = <&ext_rgmii_phy>; |
Maxime Ripard | 67d0da9 | 2019-07-03 11:55:12 +0200 | [diff] [blame] | 253 | phy-mode = "rgmii"; |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 254 | allwinner,leds-active-low; |
| 255 | |
| 256 | mdio2: mdio { |
| 257 | #address-cells = <1>; |
| 258 | #size-cells = <0>; |
| 259 | compatible = "snps,dwmac-mdio"; |
| 260 | }; |
| 261 | |
| 262 | mdio-mux { |
| 263 | compatible = "allwinner,sun8i-h3-mdio-mux"; |
| 264 | #address-cells = <1>; |
| 265 | #size-cells = <0>; |
| 266 | mdio-parent-bus = <&mdio2>; |
| 267 | |
| 268 | mdio@1 { |
| 269 | compatible = "allwinner,sun8i-h3-mdio-internal"; |
| 270 | reg = <1>; |
| 271 | #address-cells = <1>; |
| 272 | #size-cells = <0>; |
| 273 | |
| 274 | ethernet-phy@1 { |
| 275 | reg = <1>; |
| 276 | clocks = <&ccu 67>; |
| 277 | resets = <&ccu 39>; |
| 278 | }; |
| 279 | }; |
| 280 | |
| 281 | mdio@2 { |
| 282 | reg = <2>; |
| 283 | #address-cells = <1>; |
| 284 | #size-cells = <0>; |
| 285 | |
| 286 | ext_rgmii_phy: ethernet-phy@1 { |
| 287 | reg = <1>; |
| 288 | }; |
| 289 | }; |
| 290 | }; |
| 291 | }; |
| 292 | |
| 293 | - | |
| 294 | ethernet@1c0b000 { |
| 295 | compatible = "allwinner,sun8i-a83t-emac"; |
| 296 | syscon = <&syscon>; |
| 297 | reg = <0x01c0b000 0x104>; |
| 298 | interrupts = <0 82 1>; |
| 299 | interrupt-names = "macirq"; |
| 300 | resets = <&ccu 13>; |
| 301 | reset-names = "stmmaceth"; |
| 302 | clocks = <&ccu 27>; |
| 303 | clock-names = "stmmaceth"; |
| 304 | phy-handle = <&ext_rgmii_phy1>; |
Maxime Ripard | 67d0da9 | 2019-07-03 11:55:12 +0200 | [diff] [blame] | 305 | phy-mode = "rgmii"; |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 306 | |
| 307 | mdio { |
| 308 | compatible = "snps,dwmac-mdio"; |
| 309 | #address-cells = <1>; |
| 310 | #size-cells = <0>; |
| 311 | |
| 312 | ext_rgmii_phy1: ethernet-phy@1 { |
| 313 | reg = <1>; |
| 314 | }; |
| 315 | }; |
| 316 | }; |
| 317 | |
Maxime Ripard | 0569929 | 2019-06-27 17:31:52 +0200 | [diff] [blame] | 318 | ... |