ramips: Use dts alias based status led
[openwrt/openwrt.git] / target / linux / ramips / dts / WSR-600.dts
1 /dts-v1/;
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "buffalo,wsr-600dhp", "mediatek,mt7621-soc";
10 model = "Buffalo WSR-600DHP";
11
12 aliases {
13 led-status = &led_power;
14 };
15
16 memory@0 {
17 device_type = "memory";
18 reg = <0x0 0x4000000>;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,57600";
23 };
24
25 gpio-leds {
26 compatible = "gpio-leds";
27
28 led_power: power {
29 label = "wsr-600:green:power";
30 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
31 };
32
33 wifi_o {
34 label = "wsr-600:orange:wifi";
35 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
36 };
37
38 diag {
39 label = "wsr-600:orange:diag";
40 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
41 };
42
43 wifi_g {
44 label = "wsr-600:green:wifi";
45 gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
46 };
47
48 router_o {
49 label = "wsr-600:orange:router";
50 gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
51 };
52
53 router_g {
54 label = "wsr-600:green:router";
55 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
56 };
57
58 internet_o {
59 label = "wsr-600:orange:internet";
60 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
61 };
62
63 internet_g {
64 label = "wsr-600:green:internet";
65 gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
66 };
67 };
68
69 gpio-keys-polled {
70 compatible = "gpio-keys-polled";
71 #address-cells = <1>;
72 #size-cells = <0>;
73 poll-interval = <20>;
74
75 power {
76 label = "power";
77 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
78 linux,code = <KEY_POWER>;
79 };
80
81 reset {
82 label = "reset";
83 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
84 linux,code = <KEY_RESTART>;
85 };
86
87 aoss {
88 label = "aoss";
89 gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
90 linux,code = <KEY_WPS_BUTTON>;
91 };
92
93 auto {
94 label = "mode";
95 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
96 linux,code = <BTN_0>;
97 linux,input-type = <EV_SW>;
98 };
99
100 ap {
101 label = "ap";
102 gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
103 linux,code = <BTN_0>;
104 linux,input-type = <EV_SW>;
105 };
106
107 router {
108 label = "router";
109 gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
110 linux,code = <BTN_0>;
111 linux,input-type = <EV_SW>;
112 };
113 };
114
115 gpio_poweroff {
116 compatible = "gpio-poweroff";
117 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
118 };
119 };
120
121 &spi0 {
122 status = "okay";
123
124 m25p80@0 {
125 #address-cells = <1>;
126 #size-cells = <1>;
127 compatible = "jedec,spi-nor";
128 reg = <0>;
129 spi-max-frequency = <10000000>;
130 m25p,chunked-io = <32>;
131
132 partition@0 {
133 label = "u-boot";
134 reg = <0x0 0x30000>;
135 read-only;
136 };
137
138 partition@30000 {
139 label = "u-boot-env";
140 reg = <0x30000 0x10000>;
141 read-only;
142 };
143
144 factory: partition@40000 {
145 label = "factory";
146 reg = <0x40000 0x10000>;
147 read-only;
148 };
149
150 partition@50000 {
151 label = "firmware";
152 reg = <0x50000 0xfb0000>;
153 };
154 };
155 };
156
157 &pinctrl {
158 state_default: pinctrl0 {
159 gpio {
160 ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
161 ralink,function = "gpio";
162 };
163 };
164 };
165
166 &pcie {
167 status = "okay";
168
169 pcie0 {
170 rt5592@0,0 {
171 reg = <0x0000 0 0 0 0>;
172 device_type = "pci";
173 ralink,mtd-eeprom = <&factory 0x8000>;
174 };
175 };
176
177 pcie1 {
178 mt76@1,0 {
179 reg = <0x0000 0 0 0 0>;
180 device_type = "pci";
181 mediatek,mtd-eeprom = <&factory 0x0000>;
182 };
183 };
184 };
185
186 &xhci {
187 status = "disabled";
188 };