ramips: mt7621: convert to nvmem-layout
[openwrt/staging/stintel.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 label = "config";
112 reg = <0x600000 0x50000>;
113 read-only;
114
115 nvmem-layout {
116 compatible = "fixed-layout";
117 #address-cells = <1>;
118 #size-cells = <1>;
119
120 macaddr_config_10008: macaddr@10008 {
121 reg = <0x10008 0x6>;
122 };
123 };
124 };
125
126 radio: partition@7f0000 {
127 label = "radio";
128 reg = <0x7f0000 0x10000>;
129 read-only;
130
131 nvmem-layout {
132 compatible = "fixed-layout";
133 #address-cells = <1>;
134 #size-cells = <1>;
135
136 eeprom_radio_0: eeprom@0 {
137 reg = <0x0 0x400>;
138 };
139
140 eeprom_radio_8000: eeprom@8000 {
141 reg = <0x8000 0x200>;
142 };
143 };
144 };
145 };
146 };
147 };
148
149 &pcie {
150 status = "okay";
151 };
152
153 &pcie0 {
154 mt76@0,0 {
155 reg = <0x0000 0 0 0 0>;
156 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>;
157 nvmem-cell-names = "eeprom", "mac-address";
158 mac-address-increment = <1>;
159 };
160 };
161
162 &pcie1 {
163 mt76@0,0 {
164 reg = <0x0000 0 0 0 0>;
165 ieee80211-freq-limit = <5000000 6000000>;
166 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>;
167 nvmem-cell-names = "eeprom", "mac-address";
168 mac-address-increment = <2>;
169 };
170 };
171
172 &ethernet {
173 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
174 };
175
176 &gmac0 {
177 nvmem-cells = <&macaddr_config_10008>;
178 nvmem-cell-names = "mac-address";
179 };
180
181 &switch0 {
182 ports {
183 port@0 {
184 status = "okay";
185 label = "lan";
186 };
187 };
188 };
189
190 &state_default {
191 gpio {
192 groups = "rgmii2", "wdt";
193 function = "gpio";
194 };
195 };