ath79: ar: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar7242_buffalo_wzr-hp-g302h-a1a0.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar7242.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "buffalo,wzr-hp-g302h-a1a0", "qca,ar7242";
10 model = "Buffalo WZR-HP-G302H A1A0";
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 reset {
22 label = "reset";
23 linux,code = <KEY_RESTART>;
24 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
25 debounce-interval = <60>;
26 };
27
28 usb {
29 label = "usb";
30 linux,code = <BTN_2>;
31 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
32 debounce-interval = <60>;
33 };
34
35 router_on {
36 label = "router_on";
37 linux,code = <BTN_5>;
38 linux,input-type = <EV_SW>;
39 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
40 debounce-interval = <60>;
41 };
42
43 movie_engine {
44 label = "movie_engine";
45 linux,code = <BTN_3>;
46 linux,input-type = <EV_SW>;
47 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
48 debounce-interval = <60>;
49 };
50
51 wps {
52 label = "wps";
53 linux,code = <KEY_WPS_BUTTON>;
54 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
55 debounce-interval = <60>;
56 };
57 };
58
59 leds {
60 compatible = "gpio-leds";
61
62 led_diag: diag {
63 label = "red:diag";
64 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
65 };
66 };
67
68 ath9k-leds {
69 compatible = "gpio-leds";
70
71 usb {
72 label = "blue:usb";
73 gpios = <&ath9k 4 GPIO_ACTIVE_LOW>;
74 trigger-sources = <&hub_port>;
75 linux,default-trigger = "usbport";
76 };
77
78 wireless {
79 label = "green:wireless";
80 gpios = <&ath9k 5 GPIO_ACTIVE_LOW>;
81 linux,default-trigger = "phy0tpt";
82 };
83
84 security {
85 label = "orange:security";
86 gpios = <&ath9k 6 GPIO_ACTIVE_LOW>;
87 };
88
89 router {
90 label = "green:router";
91 gpios = <&ath9k 7 GPIO_ACTIVE_LOW>;
92 };
93
94 movie_engine_on {
95 label = "blue:movie_engine_on";
96 gpios = <&ath9k 8 GPIO_ACTIVE_LOW>;
97 };
98
99 movie_engine_off {
100 label = "blue:movie_engine_off";
101 gpios = <&ath9k 9 GPIO_ACTIVE_LOW>;
102 };
103 };
104
105 gpio-export {
106 compatible = "gpio-export";
107 #size-cells = <0>;
108
109 gpio_usb_power {
110 gpio-export,name = "buffalo:usb-power";
111 gpio-export,output = <1>;
112 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
113 };
114 };
115
116 virtual_flash {
117 compatible = "mtd-concat";
118 devices = <&flash0 &flash1>;
119
120 partitions {
121 compatible = "fixed-partitions";
122 #address-cells = <1>;
123 #size-cells = <1>;
124
125 partition@0 {
126 reg = <0x0 0x40000>;
127 label = "u-boot";
128 read-only;
129 };
130
131 partition@40000 {
132 reg = <0x40000 0x10000>;
133 label = "u-boot-env";
134 };
135
136 partition@50000 {
137 reg = <0x50000 0x10000>;
138 label = "art";
139 read-only;
140
141 nvmem-layout {
142 compatible = "fixed-layout";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 macaddr_art_120c: macaddr@120c {
147 reg = <0x120c 0x6>;
148 };
149
150 calibration_art_1000: calibration@1000 {
151 reg = <0x1000 0xeb8>;
152 };
153 };
154 };
155
156 partition@60000 {
157 compatible = "denx,uimage";
158 reg = <0x60000 0x1f60000>;
159 label = "firmware";
160 };
161
162 partition@1fc0000 {
163 reg = <0x1fc0000 0x40000>;
164 label = "user_property";
165 read-only;
166 };
167 };
168 };
169 };
170
171 &spi {
172 status = "okay";
173
174 flash0: flash@0 {
175 compatible = "jedec,spi-nor";
176 reg = <0>;
177 spi-max-frequency = <25000000>;
178 };
179
180 flash1: flash@1 {
181 compatible = "jedec,spi-nor";
182 reg = <1>;
183 spi-max-frequency = <25000000>;
184 };
185 };
186
187 &mdio0 {
188 status = "okay";
189
190 phy0: ethernet-phy@0 {
191 reg = <0>;
192 phy-mode = "rgmii";
193 };
194 };
195
196 &eth0 {
197 status = "okay";
198
199 pll-data = <0x1c000000 0x00000101 0x00001616>;
200
201 nvmem-cells = <&macaddr_art_120c>;
202 nvmem-cell-names = "mac-address";
203
204 phy-mode = "rgmii";
205 phy-handle = <&phy0>;
206 };
207
208 &pcie {
209 status = "okay";
210
211 ath9k: wifi@0,0 {
212 compatible = "pci168c,002a";
213 reg = <0x0000 0 0 0 0>;
214 nvmem-cells = <&macaddr_art_120c>, <&calibration_art_1000>;
215 nvmem-cell-names = "mac-address", "calibration";
216 #gpio-cells = <2>;
217 gpio-controller;
218 };
219 };
220
221 &usb_phy {
222 status = "okay";
223 };
224
225 &usb {
226 status = "okay";
227 };