ath79: fix support for Buffalo WZR-HP-G450H and split to dts/dtsi
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7242_buffalo_wzr-bhr.dtsi
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 "ar7242.dtsi"
8
9 / {
10         aliases {
11                 led-boot = &diag;
12                 led-failsafe = &diag;
13                 led-upgrade = &diag;
14         };
15
16         extosc: ref {
17                 compatible = "fixed-clock";
18                 #clock-cells = <0>;
19                 clock-frequency = <40000000>;
20         };
21
22         keys: keys {
23                 compatible = "gpio-keys-polled";
24                 poll-interval = <20>;
25
26                 usb {
27                         label = "usb";
28                         linux,code = <BTN_2>;
29                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
30                         debounce-interval = <60>;
31                 };
32
33                 reset {
34                         label = "reset";
35                         linux,code = <KEY_RESTART>;
36                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
37                         debounce-interval = <60>;
38                 };
39         };
40
41         leds {
42                 compatible = "gpio-leds";
43
44                 sec_vpn: sec_vpn {
45                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
46                         default-state = "off";
47                 };
48
49                 diag: diag {
50                         label = "buffalo:red:diag";
51                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
52                         default-state = "off";
53                 };
54
55                 usb {
56                         label = "buffalo:green:usb";
57                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
58                         default-state = "off";
59                         trigger-sources = <&hub_port>;
60                         linux,default-trigger = "usbport";
61                 };
62         };
63
64         gpio-export {
65                 compatible = "gpio-export";
66                 #size-cells = <0>;
67
68                 gpio_usb_power {
69                         gpio-export,name = "buffalo:usb-power";
70                         gpio-export,output = <1>;
71                         gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
72                 };
73         };
74
75         virtual_flash {
76                 compatible = "mtd-concat";
77                 devices = <&flash0 &flash1>;
78
79                 partitions {
80                         compatible = "fixed-partitions";
81                         #address-cells = <1>;
82                         #size-cells = <1>;
83
84                         partition@0 {
85                                 reg = <0x0 0x40000>;
86                                 label = "u-boot";
87                                 read-only;
88                         };
89
90                         partition@40000 {
91                                 reg = <0x40000 0x10000>;
92                                 label = "u-boot-env";
93                         };
94
95                         ART: partition@50000 {
96                                 reg = <0x50000 0x10000>;
97                                 label = "ART";
98                                 read-only;
99                         };
100
101                         partition@60000 {
102                                 reg = <0x60000 0x1f80000>;
103                                 label = "firmware";
104                         };
105
106                         partition@1fe0000 {
107                                 reg = <0x1fe0000 0x20000>;
108                                 label = "user_property";
109                                 read-only;
110                         };
111                 };
112         };
113 };
114
115 &spi {
116         status = "okay";
117         cs-gpios = <0>, <0>;
118         num-cs = <2>;
119
120         flash0: flash@0 {
121                 compatible = "jedec,spi-nor";
122                 reg = <0>;
123                 spi-max-frequency = <25000000>;
124         };
125
126         flash1: flash@1 {
127                 compatible = "jedec,spi-nor";
128                 reg = <1>;
129                 spi-max-frequency = <25000000>;
130         };
131 };
132
133 &mdio0 {
134         status = "okay";
135
136         phy-mask = <0x1>;
137
138         phy0: ethernet-phy@0 {
139                 reg = <0>;
140                 phy-mode = "rgmii";
141         };
142 };
143
144 &eth0 {
145         status = "okay";
146
147         mtd-mac-address = <&ART 0x1002>;
148
149         phy-mode = "rgmii";
150         phy-handle = <&phy0>;
151 };
152
153 &pll {
154         clocks = <&extosc>;
155 };
156
157 &uart {
158         status = "okay";
159 };
160
161 &usb_phy {
162         status = "okay";
163 };
164
165 &usb {
166         #address-cells = <1>;
167         #size-cells = <0>;
168         status = "okay";
169
170         hub_port: port@1 {
171                 reg = <1>;
172                 #trigger-source-cells = <0>;
173         };
174 };