ramips: convert MT7610 and MT7612 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_re350-v1.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "tplink,re350-v1", "mediatek,mt7621-soc";
8 model = "TP-LINK RE350 v1";
9
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 led_power: power {
21 label = "blue:power";
22 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
23 };
24
25 wifi2g {
26 label = "blue:wifi2G";
27 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
28 };
29
30 wifi5g {
31 label = "blue:wifi5G";
32 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
33 };
34
35 wps_r {
36 label = "red:wps";
37 gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
38 };
39
40 wps_b {
41 label = "blue:wps";
42 gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
43 };
44
45 eth {
46 label = "green:eth_act";
47 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
48 };
49
50 eth2 {
51 label = "green:eth_link";
52 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
53 };
54 };
55
56 keys {
57 compatible = "gpio-keys";
58
59 led {
60 label = "led";
61 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
62 linux,code = <BTN_0>;
63 };
64
65 reset {
66 label = "reset";
67 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
68 linux,code = <KEY_RESTART>;
69 };
70
71 power {
72 label = "power";
73 gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
74 linux,code = <KEY_POWER>;
75 };
76
77 wps {
78 label = "wps";
79 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
80 linux,code = <KEY_WPS_BUTTON>;
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 = <10000000>;
92
93 partitions {
94 compatible = "fixed-partitions";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 partition@0 {
99 label = "u-boot";
100 reg = <0x0 0x20000>;
101 read-only;
102 };
103
104 partition@20000 {
105 compatible = "tplink,firmware";
106 label = "firmware";
107 reg = <0x20000 0x5e0000>;
108 };
109
110 config: partition@600000 {
111 compatible = "nvmem-cells";
112 label = "config";
113 reg = <0x600000 0x50000>;
114 #address-cells = <1>;
115 #size-cells = <1>;
116 read-only;
117
118 macaddr_config_10008: macaddr@10008 {
119 reg = <0x10008 0x6>;
120 };
121 };
122
123 radio: partition@7f0000 {
124 compatible = "nvmem-cells";
125 label = "radio";
126 reg = <0x7f0000 0x10000>;
127 #address-cells = <1>;
128 #size-cells = <1>;
129 read-only;
130
131 eeprom_radio_0: eeprom@0 {
132 reg = <0x0 0x400>;
133 };
134
135 eeprom_radio_8000: eeprom@8000 {
136 reg = <0x8000 0x200>;
137 };
138 };
139 };
140 };
141 };
142
143 &pcie {
144 status = "okay";
145 };
146
147 &pcie0 {
148 mt76@0,0 {
149 reg = <0x0000 0 0 0 0>;
150 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>;
151 nvmem-cell-names = "eeprom", "mac-address";
152 mac-address-increment = <1>;
153 };
154 };
155
156 &pcie1 {
157 mt76@0,0 {
158 reg = <0x0000 0 0 0 0>;
159 ieee80211-freq-limit = <5000000 6000000>;
160 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>;
161 nvmem-cell-names = "eeprom", "mac-address";
162 mac-address-increment = <2>;
163 };
164 };
165
166 &ethernet {
167 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
168 };
169
170 &gmac0 {
171 nvmem-cells = <&macaddr_config_10008>;
172 nvmem-cell-names = "mac-address";
173 };
174
175 &switch0 {
176 ports {
177 port@0 {
178 status = "okay";
179 label = "lan";
180 };
181 };
182 };
183
184 &state_default {
185 gpio {
186 groups = "rgmii2", "wdt";
187 function = "gpio";
188 };
189 };