a3ab92c015d643dbf8a62caebb65cc4c430d34ec
[openwrt/staging/luka.git] / target / linux / ath79 / dts / ar7240_buffalo_whr-g301n.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar7240.dtsi"
8
9 / {
10 compatible = "buffalo,whr-g301n", "qca,ar7240";
11 model = "Buffalo WHR-G301N";
12
13 aliases {
14 led-boot = &diag;
15 led-failsafe = &diag;
16 led-upgrade = &diag;
17 };
18
19 gpio-keys-polled {
20 compatible = "gpio-keys-polled";
21 poll-interval = <20>;
22
23 router_on {
24 label = "router_on";
25 linux,code = <BTN_2>;
26 linux,input-type = <EV_SW>;
27 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
28 debounce-interval = <60>;
29 };
30
31 router_off {
32 label = "router_off";
33 linux,code = <BTN_3>;
34 linux,input-type = <EV_SW>;
35 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
36 debounce-interval = <60>;
37 };
38
39 reset {
40 label = "reset";
41 linux,code = <KEY_RESTART>;
42 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
43 debounce-interval = <60>;
44 };
45
46 wps {
47 label = "wps";
48 linux,code = <KEY_WPS_BUTTON>;
49 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
50 debounce-interval = <60>;
51 };
52 };
53
54 gpio-leds {
55 compatible = "gpio-leds";
56 pinctrl-names = "default";
57 pinctrl-0 = <&switch_led_pins>;
58
59 security {
60 label = "whr-g301n:orange:security";
61 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
62 };
63
64 diag: diag {
65 label = "whr-g301n:red:diag";
66 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
67 };
68
69 router {
70 label = "whr-g301n:green:router";
71 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
72 };
73
74 lan1 {
75 label = "whr-g301n:green:lan1";
76 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
77 };
78
79 lan2 {
80 label = "whr-g301n:green:lan2";
81 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
82 };
83
84 lan3 {
85 label = "whr-g301n:green:lan3";
86 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
87 };
88
89 lan4 {
90 label = "whr-g301n:green:lan4";
91 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
92 };
93
94 wan {
95 label = "whr-g301n:green:wan";
96 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
97 };
98 };
99
100 ath9k-leds {
101 compatible = "gpio-leds";
102
103 wlan {
104 label = "whr-g301n:green:wlan";
105 gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
106 default-state = "off";
107 linux,default-trigger = "phy0tpt";
108 };
109 };
110 };
111
112 &spi {
113 status = "okay";
114 num-cs = <1>;
115
116 flash@0 {
117 compatible = "jedec,spi-nor";
118 reg = <0>;
119 spi-max-frequency = <25000000>;
120
121 partitions {
122 compatible = "fixed-partitions";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 partition@0 {
127 reg = <0x0 0x3e000>;
128 label = "u-boot";
129 read-only;
130 };
131
132 partition@3e000 {
133 reg = <0x3e000 0x2000>;
134 label = "u-boot-env";
135 read-only;
136 };
137
138 partition@40000 {
139 compatible = "denx,uimage";
140 reg = <0x40000 0x3a0000>;
141 label = "firmware";
142 };
143
144 partition@3e0000 {
145 reg = <0x3e0000 0x10000>;
146 label = "user_property";
147 read-only;
148 };
149
150 art: partition@3f0000 {
151 reg = <0x3f0000 0x10000>;
152 label = "art";
153 read-only;
154 };
155 };
156 };
157 };
158
159 &eth0 {
160 status = "okay";
161
162 mtd-mac-address = <&art 0x120c>;
163 };
164
165 &eth1 {
166 status = "okay";
167
168 mtd-mac-address = <&art 0x120c>;
169 mtd-mac-address-increment = <1>;
170 };
171
172 &pcie {
173 status = "okay";
174
175 ath9k: wifi@0,0 {
176 compatible = "pci168c,002a";
177 reg = <0x0000 0 0 0 0>;
178 qca,no-eeprom;
179 mtd-mac-address = <&art 0x120c>;
180 #gpio-cells = <2>;
181 gpio-controller;
182 };
183 };
184
185 &pinmux {
186 switch_led_pins: switch_led_pins {
187 pinctrl-single,bits = <0x0 0x0 0xf8>;
188 };
189 };
190
191 &uart {
192 status = "okay";
193 };