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