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