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