ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_youhua_wr1200js.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 = "youhua,wr1200js", "mediatek,mt7621-soc";
9 model = "YouHua WR1200JS";
10
11 aliases {
12 led-boot = &led_wps;
13 led-failsafe = &led_wps;
14 };
15
16 chosen {
17 bootargs = "console=ttyS0,115200";
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 internet {
24 label = "blue:internet";
25 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
26 };
27
28 led_wps: wps {
29 function = LED_FUNCTION_WPS;
30 color = <LED_COLOR_ID_BLUE>;
31 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
32 };
33
34 usb {
35 function = LED_FUNCTION_USB;
36 color = <LED_COLOR_ID_BLUE>;
37 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
38 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
39 linux,default-trigger = "usbport";
40 };
41 };
42
43 keys {
44 compatible = "gpio-keys";
45
46 reset {
47 label = "reset";
48 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
49 linux,code = <KEY_RESTART>;
50 };
51
52 wps {
53 label = "wps";
54 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_WPS_BUTTON>;
56 };
57
58 wifi {
59 label = "wifi";
60 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_RFKILL>;
62 };
63 };
64 };
65
66 &spi0 {
67 status = "okay";
68
69 flash@0 {
70 compatible = "jedec,spi-nor";
71 reg = <0>;
72 spi-max-frequency = <10000000>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "u-boot";
81 reg = <0x0 0x30000>;
82 read-only;
83 };
84
85 partition@30000 {
86 label = "u-boot-env";
87 reg = <0x30000 0x10000>;
88 read-only;
89 };
90
91 factory: partition@40000 {
92 label = "factory";
93 reg = <0x40000 0x10000>;
94 read-only;
95
96 nvmem-layout {
97 compatible = "fixed-layout";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 eeprom_factory_0: eeprom@0 {
102 reg = <0x0 0x400>;
103 };
104
105 eeprom_factory_8000: eeprom@8000 {
106 reg = <0x8000 0x200>;
107 };
108
109 macaddr_factory_e000: macaddr@e000 {
110 reg = <0xe000 0x6>;
111 };
112
113 macaddr_factory_e006: macaddr@e006 {
114 reg = <0xe006 0x6>;
115 };
116 };
117 };
118
119 partition@50000 {
120 compatible = "denx,uimage";
121 label = "firmware";
122 reg = <0x50000 0xfb0000>;
123 };
124 };
125 };
126 };
127
128 &pcie {
129 status = "okay";
130 };
131
132 &pcie0 {
133 mt76@0,0 {
134 reg = <0x0000 0 0 0 0>;
135 nvmem-cells = <&eeprom_factory_0>;
136 nvmem-cell-names = "eeprom";
137 };
138 };
139
140 &pcie1 {
141 mt76@0,0 {
142 reg = <0x0000 0 0 0 0>;
143 nvmem-cells = <&eeprom_factory_8000>;
144 nvmem-cell-names = "eeprom";
145 ieee80211-freq-limit = <5000000 6000000>;
146
147 led {
148 led-sources = <2>;
149 led-active-low;
150 };
151 };
152 };
153
154 &gmac0 {
155 nvmem-cells = <&macaddr_factory_e000>;
156 nvmem-cell-names = "mac-address";
157 };
158
159 &gmac1 {
160 status = "okay";
161 label = "wan";
162 phy-handle = <&ethphy0>;
163
164 nvmem-cells = <&macaddr_factory_e006>;
165 nvmem-cell-names = "mac-address";
166 };
167
168 &mdio {
169 ethphy0: ethernet-phy@0 {
170 reg = <0>;
171 };
172 };
173
174 &switch0 {
175 ports {
176 port@1 {
177 status = "okay";
178 label = "lan1";
179 };
180
181 port@2 {
182 status = "okay";
183 label = "lan2";
184 };
185
186 port@3 {
187 status = "okay";
188 label = "lan3";
189 };
190
191 port@4 {
192 status = "okay";
193 label = "lan4";
194 };
195 };
196 };
197
198 &state_default {
199 gpio {
200 groups = "i2c", "uart2", "uart3", "wdt";
201 function = "gpio";
202 };
203 };