Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) |
| 2 | # Copyright 2019 BayLibre, SAS |
| 3 | %YAML 1.2 |
| 4 | --- |
| 5 | $id: http://devicetree.org/schemas/net/stm32-dwmac.yaml# |
| 6 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 7 | |
| 8 | title: STMicroelectronics STM32 / MCU DWMAC glue layer controller |
| 9 | |
| 10 | maintainers: |
| 11 | - Alexandre Torgue <alexandre.torgue@foss.st.com> |
| 12 | - Christophe Roullier <christophe.roullier@foss.st.com> |
| 13 | |
| 14 | description: |
| 15 | This file documents platform glue layer for stmmac. |
| 16 | |
| 17 | # We need a select here so we don't match all nodes with 'snps,dwmac' |
| 18 | select: |
| 19 | properties: |
| 20 | compatible: |
| 21 | contains: |
| 22 | enum: |
| 23 | - st,stm32-dwmac |
| 24 | - st,stm32mp1-dwmac |
| 25 | required: |
| 26 | - compatible |
| 27 | |
| 28 | allOf: |
| 29 | - $ref: snps,dwmac.yaml# |
| 30 | |
| 31 | properties: |
| 32 | compatible: |
| 33 | oneOf: |
| 34 | - items: |
| 35 | - enum: |
| 36 | - st,stm32mp1-dwmac |
| 37 | - const: snps,dwmac-4.20a |
| 38 | - items: |
| 39 | - enum: |
| 40 | - st,stm32-dwmac |
| 41 | - const: snps,dwmac-4.10a |
| 42 | - items: |
| 43 | - enum: |
| 44 | - st,stm32-dwmac |
| 45 | - const: snps,dwmac-3.50a |
| 46 | |
| 47 | reg: true |
| 48 | |
| 49 | reg-names: |
| 50 | items: |
| 51 | - const: stmmaceth |
| 52 | |
| 53 | clocks: |
| 54 | minItems: 3 |
| 55 | items: |
| 56 | - description: GMAC main clock |
| 57 | - description: MAC TX clock |
| 58 | - description: MAC RX clock |
| 59 | - description: For MPU family, used for power mode |
| 60 | - description: For MPU family, used for PHY without quartz |
| 61 | - description: PTP clock |
| 62 | |
| 63 | clock-names: |
| 64 | minItems: 3 |
| 65 | maxItems: 6 |
| 66 | contains: |
| 67 | enum: |
| 68 | - stmmaceth |
| 69 | - mac-clk-tx |
| 70 | - mac-clk-rx |
| 71 | - ethstp |
| 72 | - eth-ck |
| 73 | - ptp_ref |
| 74 | |
| 75 | st,syscon: |
| 76 | $ref: /schemas/types.yaml#/definitions/phandle-array |
| 77 | items: |
| 78 | - items: |
| 79 | - description: phandle to the syscon node which encompases the glue register |
| 80 | - description: offset of the control register |
| 81 | description: |
| 82 | Should be phandle/offset pair. The phandle to the syscon node which |
| 83 | encompases the glue register, and the offset of the control register |
| 84 | |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 85 | st,ext-phyclk: |
| 86 | description: |
| 87 | set this property in RMII mode when you have PHY without crystal 50MHz and want to |
| 88 | select RCC clock instead of ETH_REF_CLK. OR in RGMII mode when you want to select |
| 89 | RCC clock instead of ETH_CLK125. |
| 90 | type: boolean |
| 91 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 92 | st,eth-clk-sel: |
| 93 | description: |
| 94 | set this property in RGMII PHY when you want to select RCC clock instead of ETH_CLK125. |
| 95 | type: boolean |
| 96 | |
| 97 | st,eth-ref-clk-sel: |
| 98 | description: |
| 99 | set this property in RMII mode when you have PHY without crystal 50MHz and want to |
| 100 | select RCC clock instead of ETH_REF_CLK. |
| 101 | type: boolean |
| 102 | |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 103 | access-controllers: |
| 104 | minItems: 1 |
| 105 | maxItems: 2 |
| 106 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 107 | required: |
| 108 | - compatible |
| 109 | - clocks |
| 110 | - clock-names |
| 111 | - st,syscon |
| 112 | |
| 113 | unevaluatedProperties: false |
| 114 | |
| 115 | examples: |
| 116 | - | |
| 117 | #include <dt-bindings/interrupt-controller/arm-gic.h> |
| 118 | #include <dt-bindings/clock/stm32mp1-clks.h> |
| 119 | #include <dt-bindings/reset/stm32mp1-resets.h> |
| 120 | #include <dt-bindings/mfd/stm32h7-rcc.h> |
| 121 | //Example 1 |
| 122 | ethernet0: ethernet@5800a000 { |
| 123 | compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a"; |
| 124 | reg = <0x5800a000 0x2000>; |
| 125 | reg-names = "stmmaceth"; |
| 126 | interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; |
| 127 | interrupt-names = "macirq"; |
| 128 | clock-names = "stmmaceth", |
| 129 | "mac-clk-tx", |
| 130 | "mac-clk-rx", |
| 131 | "ethstp", |
| 132 | "eth-ck"; |
| 133 | clocks = <&rcc ETHMAC>, |
| 134 | <&rcc ETHTX>, |
| 135 | <&rcc ETHRX>, |
| 136 | <&rcc ETHSTP>, |
| 137 | <&rcc ETHCK_K>; |
| 138 | st,syscon = <&syscfg 0x4>; |
| 139 | snps,pbl = <2>; |
| 140 | snps,axi-config = <&stmmac_axi_config_0>; |
| 141 | snps,tso; |
| 142 | phy-mode = "rgmii"; |
| 143 | }; |
| 144 | |
| 145 | - | |
| 146 | //Example 2 (MCU example) |
| 147 | ethernet1: ethernet@40028000 { |
| 148 | compatible = "st,stm32-dwmac", "snps,dwmac-3.50a"; |
| 149 | reg = <0x40028000 0x8000>; |
| 150 | reg-names = "stmmaceth"; |
| 151 | interrupts = <0 61 0>, <0 62 0>; |
| 152 | interrupt-names = "macirq", "eth_wake_irq"; |
| 153 | clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx"; |
| 154 | clocks = <&rcc 0 25>, <&rcc 0 26>, <&rcc 0 27>; |
| 155 | st,syscon = <&syscfg 0x4>; |
| 156 | snps,pbl = <8>; |
| 157 | snps,mixed-burst; |
| 158 | phy-mode = "mii"; |
| 159 | }; |
| 160 | |
| 161 | - | |
| 162 | //Example 3 |
| 163 | ethernet2: ethernet@40027000 { |
| 164 | compatible = "st,stm32-dwmac", "snps,dwmac-4.10a"; |
| 165 | reg = <0x40028000 0x8000>; |
| 166 | reg-names = "stmmaceth"; |
| 167 | interrupts = <61>; |
| 168 | interrupt-names = "macirq"; |
| 169 | clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx"; |
| 170 | clocks = <&rcc 62>, <&rcc 61>, <&rcc 60>; |
| 171 | st,syscon = <&syscfg 0x4>; |
| 172 | snps,pbl = <8>; |
| 173 | phy-mode = "mii"; |
| 174 | }; |