ramips: reset mt7620 ethernet phy via reset controller
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_mr600-v2-eu.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,mr600-v2-eu", "mediatek,mt7621-soc";
11 model = "TP-Link MR600 v2 (EU)";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 wlan {
29 label = "wlan";
30 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_WLAN>;
32 };
33
34 reset {
35 label = "reset";
36 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_power: power {
45 label = "white:power";
46 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
47 };
48 wlan {
49 label = "white:wlan";
50 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
51 linux,default-trigger = "phy1tpt";
52 };
53 wan {
54 label = "white:wan";
55 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
56 };
57
58 signal1 {
59 label = "white:signal1";
60 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
61 };
62
63 signal2 {
64 label = "white:signal2";
65 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
66 };
67
68 signal3 {
69 label = "white:signal3";
70 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
71 };
72
73 4g {
74 label = "white:4g";
75 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
76 };
77 lan {
78 label = "white:lan";
79 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
80 };
81 };
82
83 };
84
85 &spi0 {
86 status = "okay";
87
88 flash@0 {
89 compatible = "jedec,spi-nor";
90 reg = <0>;
91 spi-max-frequency = <80000000>;
92
93 partitions {
94 compatible = "fixed-partitions";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 partition@0 {
99 label = "uboot";
100 reg = <0x00000 0x20000>;
101 read-only;
102 };
103
104 partition@20000 {
105 compatible = "openwrt,uimage";
106 openwrt,offset = <512>; /* account for the 512-byte long header */
107 label = "firmware";
108 reg = <0x20000 0xfa0000>;
109 };
110
111 romfile: partition@fc0000 {
112 label = "romfile";
113 reg = <0xfc0000 0x10000>;
114 read-only;
115
116 nvmem-layout {
117 compatible = "fixed-layout";
118 #address-cells = <1>;
119 #size-cells = <1>;
120
121 macaddr_romfile_f100: romfile@f100 {
122 compatible = "mac-base";
123 reg = <0xf100 0x6>;
124 #nvmem-cell-cells = <1>;
125 };
126 };
127 };
128
129 partition@fd0000 {
130 label = "config";
131 reg = <0xfd0000 0x10000>;
132 read-only;
133 };
134
135 radio: partition@fe0000 {
136 label = "radio";
137 reg = <0xfe0000 0x10000>;
138 read-only;
139
140 nvmem-layout {
141 compatible = "fixed-layout";
142 #address-cells = <1>;
143 #size-cells = <1>;
144
145 eeprom_radio_0: eeprom@0 {
146 reg = <0x0 0x400>;
147 };
148
149 eeprom_radio_8000: eeprom@8000 {
150 reg = <0x8000 0x4da8>;
151 };
152 };
153 };
154 };
155 };
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162
163 &pcie0 {
164 mt76@0,0 {
165 compatible = "mediatek,mt76";
166 reg = <0x0000 0 0 0 0>;
167 nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100 0>;
168 nvmem-cell-names = "eeprom", "mac-address";
169 ieee80211-freq-limit = <2400000 2500000>;
170 };
171 };
172
173 &pcie1 {
174 mt76@0,0 {
175 compatible = "mediatek,mt76";
176 reg = <0x0000 0 0 0 0>;
177 ieee80211-freq-limit = <5000000 6000000>;
178 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100 (-1)>;
179 nvmem-cell-names = "eeprom", "mac-address";
180 };
181 };
182
183 &gmac0 {
184 nvmem-cells = <&macaddr_romfile_f100 0>;
185 nvmem-cell-names = "mac-address";
186 };
187
188 &gmac1 {
189 status = "okay";
190 label = "wan";
191 phy-handle = <&ethphy4>;
192
193 nvmem-cells = <&macaddr_romfile_f100 0>;
194 nvmem-cell-names = "mac-address";
195 };
196
197 &mdio {
198 ethphy4: ethernet-phy@4 {
199 reg = <4>;
200 };
201 };
202
203
204 &switch0 {
205 ports {
206 port@1 {
207 status = "okay";
208 label = "lan1";
209 };
210 port@2 {
211 status = "okay";
212 label = "lan2";
213 };
214 port@3 {
215 status = "okay";
216 label = "lan3";
217 };
218 };
219 };