ramips: mt7621: convert to nvmem-layout
[openwrt/staging/jow.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 reg = <0xf100 0x6>;
123 };
124 };
125 };
126
127 partition@fd0000 {
128 label = "config";
129 reg = <0xfd0000 0x10000>;
130 read-only;
131 };
132
133 radio: partition@fe0000 {
134 label = "radio";
135 reg = <0xfe0000 0x10000>;
136 read-only;
137
138 nvmem-layout {
139 compatible = "fixed-layout";
140 #address-cells = <1>;
141 #size-cells = <1>;
142
143 eeprom_radio_0: eeprom@0 {
144 reg = <0x0 0x400>;
145 };
146
147 eeprom_radio_8000: eeprom@8000 {
148 reg = <0x8000 0x4da8>;
149 };
150 };
151 };
152 };
153 };
154 };
155
156 &pcie {
157 status = "okay";
158 };
159
160
161 &pcie0 {
162 mt76@0,0 {
163 compatible = "mediatek,mt76";
164 reg = <0x0000 0 0 0 0>;
165 nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100>;
166 nvmem-cell-names = "eeprom", "mac-address";
167 ieee80211-freq-limit = <2400000 2500000>;
168 };
169 };
170
171 &pcie1 {
172 mt76@0,0 {
173 compatible = "mediatek,mt76";
174 reg = <0x0000 0 0 0 0>;
175 ieee80211-freq-limit = <5000000 6000000>;
176 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100>;
177 nvmem-cell-names = "eeprom", "mac-address";
178 mac-address-increment = <(-1)>;
179 };
180 };
181
182 &gmac0 {
183 nvmem-cells = <&macaddr_romfile_f100>;
184 nvmem-cell-names = "mac-address";
185 };
186
187 &gmac1 {
188 status = "okay";
189 label = "wan";
190 phy-handle = <&ethphy4>;
191
192 nvmem-cells = <&macaddr_romfile_f100>;
193 nvmem-cell-names = "mac-address";
194 };
195
196 &mdio {
197 ethphy4: ethernet-phy@4 {
198 reg = <4>;
199 };
200 };
201
202
203 &switch0 {
204 ports {
205 port@1 {
206 status = "okay";
207 label = "lan1";
208 };
209 port@2 {
210 status = "okay";
211 label = "lan2";
212 };
213 port@3 {
214 status = "okay";
215 label = "lan3";
216 };
217 };
218 };