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