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