ath79: use gpios for switch management in WZR-HP-G300NH variants
[openwrt/staging/dedeckeh.git] / target / linux / ath79 / dts / ar9132_buffalo_wzr-hp-g300nh.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9132.dtsi"
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 / {
8 aliases {
9 led-boot = &led_diag;
10 led-failsafe = &led_security;
11 led-upgrade = &led_diag;
12 };
13
14 /* There is a GPIO driven NXP 74HC153 dual 4-way multiplexer on board
15 * used for buttons that are on top of the the device.
16 */
17 mux: mux-controller {
18 compatible = "gpio-mux";
19 #mux-control-cells = <0>;
20
21 mux-gpios = <&gpio 9 GPIO_ACTIVE_HIGH>, /* s0 */
22 <&gpio 11 GPIO_ACTIVE_HIGH>; /* s1 */
23 };
24
25 gpio2: key-mux1 {
26 compatible = "gpio-cascade";
27 mux-controls = <&mux>;
28
29 gpio-controller;
30 #gpio-cells = <2>;
31
32 // GPIOs used by this node, the mux pin
33 upstream-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; /* 1y */
34 };
35
36 gpio3: key-mux2 {
37 compatible = "gpio-cascade";
38 mux-controls = <&mux>;
39
40 gpio-controller;
41 #gpio-cells = <2>;
42
43 // GPIOs used by this node, the mux pin
44 upstream-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; /* 2y */
45 };
46
47 keys {
48 compatible = "gpio-keys-polled";
49 poll-interval = <20>;
50
51 aoss {
52 label = "aoss";
53 linux,code = <KEY_WPS_BUTTON>;
54 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
55 debounce-interval = <60>;
56 };
57
58 reset {
59 label = "reset";
60 linux,code = <KEY_RESTART>;
61 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
62 debounce-interval = <60>;
63 };
64
65 router_on {
66 label = "router_on";
67 linux,code = <BTN_5>;
68 gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
69 debounce-interval = <60>;
70 };
71
72 movie_off {
73 label = "movie_off";
74 linux,code = <BTN_3>;
75 gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
76 debounce-interval = <60>;
77 };
78
79 usb {
80 label = "usb";
81 linux,code = <BTN_2>;
82 gpios = <&gpio3 1 GPIO_ACTIVE_LOW>;
83 debounce-interval = <60>;
84 };
85
86 router_auto {
87 label = "router_auto";
88 linux,code = <BTN_6>;
89 gpios = <&gpio3 2 GPIO_ACTIVE_HIGH>;
90 debounce-interval = <60>;
91 };
92
93 movie_on {
94 label = "movie_on";
95 linux,code = <BTN_4>;
96 gpios = <&gpio3 3 GPIO_ACTIVE_HIGH>;
97 debounce-interval = <60>;
98 };
99 };
100
101 flash@1e000000 {
102 compatible = "cfi-flash";
103 reg = <0x1e000000 0x2000000>;
104 bank-width = <2>;
105 device-width = <2>;
106
107 partitions {
108 compatible = "fixed-partitions";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 partition@0 {
113 label = "u-boot";
114 reg = <0x0000000 0x0040000>;
115 read-only;
116 };
117
118 partition@40000 {
119 label = "u-boot-env";
120 reg = <0x0040000 0x0020000>;
121 read-only;
122 };
123
124 partition@60000 {
125 compatible = "denx,uimage";
126 label = "firmware";
127 reg = <0x0060000 0x1f60000>;
128 };
129
130 partition@1fc0000 {
131 label = "user_property";
132 reg = <0x1fc0000 0x0020000>;
133 read-only;
134 };
135
136 art: partition@1fe0000 {
137 label = "art";
138 reg = <0x1fe0000 0x020000>;
139 read-only;
140 };
141 };
142 };
143
144 leds {
145 compatible = "gpio-leds";
146
147 usb {
148 label = "blue:usb";
149 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
150 trigger-sources = <&hub_port>;
151 linux,default-trigger = "usbport";
152 };
153
154 led_diag: diag {
155 label = "red:diag";
156 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
157 };
158
159 wireless {
160 label = "green:wireless";
161 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
162 linux,default-trigger = "phy0tpt";
163 };
164
165 led_security: security {
166 label = "amber:security";
167 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
168 };
169
170 router {
171 label = "green:router";
172 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
173 };
174 };
175
176 switch: switch {
177 status = "disabled";
178
179 gpio-sda = <&gpio 19 GPIO_ACTIVE_HIGH>;
180 gpio-sck = <&gpio 20 GPIO_ACTIVE_HIGH>;
181
182 mdio-bus {
183 status = "okay";
184
185 #address-cells = <1>;
186 #size-cells = <0>;
187
188 phy4: ethernet-phy@4 {
189 reg = <4>;
190 phy-mode = "rgmii";
191 };
192 };
193 };
194 };
195
196 &mdio0 {
197 status = "okay";
198 };
199
200 &eth0 {
201 status = "disabled";
202
203 phy-mode = "rgmii";
204 nvmem-cells = <&macaddr_art_1120c>;
205 nvmem-cell-names = "mac-address";
206
207 fixed-link {
208 speed = <1000>;
209 full-duplex;
210 };
211 };
212
213 &mdio1 {
214 status = "okay";
215 };
216
217 &eth1 {
218 status = "disabled";
219
220 compatible = "qca,ar9130-eth", "syscon";
221 reg = <0x1a000000 0x200
222 0x18070004 0x4>;
223
224 pll-reg = <0x4 0x18 22>;
225 pll-handle = <&pll>;
226
227 phy-mode = "rgmii";
228 phy-handle = <&phy4>;
229 resets = <&rst 13>;
230 reset-names = "mac";
231 qca,mac-idx = <1>;
232 nvmem-cells = <&macaddr_art_1120c>;
233 nvmem-cell-names = "mac-address";
234 };
235
236 &wmac {
237 status = "okay";
238
239 mtd-cal-data = <&art 0x11000>;
240 };
241
242 &uart {
243 status = "okay";
244 };
245
246 &usb {
247 status = "okay";
248 };
249
250 &usb_phy {
251 status = "okay";
252 };
253
254 &art {
255 compatible = "nvmem-cells";
256 #address-cells = <1>;
257 #size-cells = <1>;
258
259 macaddr_art_1120c: macaddr@1120c {
260 reg = <0x1120c 0x6>;
261 };
262 };