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