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