ath79: convert ath10k calibration data to NVMEM (binary MAC)
[openwrt/staging/jow.git] / target / linux / ath79 / dts / qca9563_tplink_archer-c7-v4.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca956x.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "tplink,archer-c7-v4", "qca,qca9563";
10 model = "TP-Link Archer C7 v4";
11
12 aliases {
13 led-boot = &led_system;
14 led-failsafe = &led_system;
15 led-running = &led_system;
16 led-upgrade = &led_system;
17 label-mac-device = &eth0;
18 };
19
20 led_spi {
21 compatible = "spi-gpio";
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 sck-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; // 74HC595 SRCLK (Serial Clock)
26 mosi-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; // 74HC595 SER (Serial)
27 cs-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; // 74HC595 RCLK (Register Clock)
28 num-chipselects = <1>;
29
30 led_gpio: led_gpio@0 {
31 compatible = "fairchild,74hc595";
32 reg = <0>;
33 gpio-controller;
34 #gpio-cells = <2>;
35 registers-number = <1>;
36 spi-max-frequency = <10000000>;
37 };
38 };
39
40 gpio-export {
41 compatible = "gpio-export";
42
43 gpio_shift_register_oe {
44 gpio-export,name = "tp-link:oe:sr";
45 gpio-export,output = <0>;
46 gpios = <&gpio 1 GPIO_ACTIVE_LOW>; // 74HC595 /OE (Output Enable)
47 };
48
49 gpio_shift_register_reset {
50 gpio-export,name = "tp-link:reset:sr";
51 gpio-export,output = <1>;
52 gpios = <&gpio 21 GPIO_ACTIVE_LOW>; // 74HC595 /SRCLR (Serial Clear)
53 };
54 };
55
56 leds {
57 compatible = "gpio-leds";
58
59 led_system: system {
60 label = "green:system";
61 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
62 default-state = "on";
63 };
64
65 usb1 {
66 label = "green:usb1";
67 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
68 trigger-sources = <&hub_port1>;
69 linux,default-trigger = "usbport";
70 };
71
72 usb2 {
73 label = "green:usb2";
74 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
75 trigger-sources = <&hub_port0>;
76 linux,default-trigger = "usbport";
77 };
78
79 wlan5g {
80 label = "green:wlan5g";
81 gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
82 linux,default-trigger = "phy0tpt";
83 };
84
85 wlan2g {
86 label = "green:wlan2g";
87 gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
88 linux,default-trigger = "phy1tpt";
89 };
90
91 wan {
92 label = "green:wan";
93 gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
94 };
95
96 wan_fail {
97 label = "orange:wan";
98 gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
99 };
100
101 lan1 {
102 label = "green:lan1";
103 gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
104 };
105
106 lan2 {
107 label = "green:lan2";
108 gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
109 };
110
111 lan3 {
112 label = "green:lan3";
113 gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
114 };
115
116 lan4 {
117 label = "green:lan4";
118 gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
119 };
120
121 wps {
122 label = "green:wps";
123 gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
124 };
125 };
126
127 keys {
128 compatible = "gpio-keys";
129
130 reset {
131 label = "Reset button";
132 linux,code = <KEY_RESTART>;
133 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
134 debounce-interval = <60>;
135 };
136
137 wps {
138 label = "WPS button";
139 linux,code = <KEY_WPS_BUTTON>;
140 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
141 debounce-interval = <60>;
142 };
143 };
144 };
145
146 &pcie {
147 status = "okay";
148
149 wifi@0,0 {
150 compatible = "qcom,ath10k";
151 reg = <0x0000 0 0 0 0>;
152 nvmem-cells = <&cal_art_5000>, <&macaddr_info_8 (-1)>;
153 nvmem-cell-names = "calibration", "mac-address";
154 };
155 };
156
157 &usb_phy0 {
158 status = "okay";
159 };
160
161 &usb0 {
162 status = "okay";
163 };
164
165 &usb_phy1 {
166 status = "okay";
167 };
168
169 &usb1 {
170 status = "okay";
171 };
172
173 &spi {
174 status = "okay";
175
176 flash@0 {
177 compatible = "jedec,spi-nor";
178 reg = <0>;
179 spi-max-frequency = <25000000>;
180
181 partitions {
182 compatible = "fixed-partitions";
183 #address-cells = <1>;
184 #size-cells = <1>;
185
186 partition@0 {
187 label = "factory-uboot";
188 reg = <0x000000 0x020000>;
189 read-only;
190 };
191
192 partition@20000 {
193 label = "u-boot";
194 reg = <0x020000 0x020000>;
195 read-only;
196 };
197
198 partition@40000 {
199 label = "firmware";
200 reg = <0x040000 0xec0000>;
201 compatible = "denx,uimage";
202 };
203
204 info: partition@f00000 {
205 label = "info";
206 reg = <0xf00000 0x0f0000>;
207 read-only;
208
209 nvmem-layout {
210 compatible = "fixed-layout";
211 #address-cells = <1>;
212 #size-cells = <1>;
213
214 macaddr_info_8: macaddr@8 {
215 compatible = "mac-base";
216 reg = <0x8 0x6>;
217 #nvmem-cell-cells = <1>;
218 };
219 };
220 };
221
222 art: partition@ff0000 {
223 label = "art";
224 reg = <0xff0000 0x010000>;
225 read-only;
226
227 nvmem-layout {
228 compatible = "fixed-layout";
229 #address-cells = <1>;
230 #size-cells = <1>;
231
232 cal_art_5000: calibration@5000 {
233 reg = <0x5000 0x844>;
234 };
235 };
236 };
237 };
238 };
239 };
240
241 &mdio0 {
242 status = "okay";
243
244 phy0: ethernet-phy@0 {
245 reg = <0>;
246 phy-mode = "sgmii";
247 qca,mib-poll-interval = <500>;
248
249 qca,ar8327-initvals = <
250 0x04 0x80080080 /* PORT0 PAD MODE CTRL */
251 0x7c 0x0000007e /* PORT0_STATUS */
252 0x94 0x00000200 /* PORT6_STATUS */
253 >;
254 };
255 };
256
257 &eth0 {
258 status = "okay";
259
260 pll-data = <0x03000101 0x00000101 0x00001919>;
261
262 phy-mode = "sgmii";
263 nvmem-cells = <&macaddr_info_8 0>;
264 nvmem-cell-names = "mac-address";
265 phy-handle = <&phy0>;
266 };
267
268 &wmac {
269 status = "okay";
270
271 mtd-cal-data = <&art 0x1000>;
272 nvmem-cells = <&macaddr_info_8 0>;
273 nvmem-cell-names = "mac-address";
274 };