ath79: calibrate TL-WDR4900 v2 with nvmem-cells
[openwrt/staging/wigyori.git] / target / linux / ath79 / dts / qca9558_tplink_tl-wdr4900-v2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca955x.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "tplink,tl-wdr4900-v2", "qca,qca9558";
10 model = "TP-Link TL-WDR4900 v2";
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 = &eth1;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_system: system {
24 label = "blue:system";
25 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
26 default-state = "on";
27 };
28
29 usb1 {
30 label = "green:usb1";
31 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
32 trigger-sources = <&hub_port1>;
33 linux,default-trigger = "usbport";
34 };
35
36 usb2 {
37 label = "green:usb2";
38 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
39 trigger-sources = <&hub_port0>;
40 linux,default-trigger = "usbport";
41 };
42
43 wlan2g {
44 label = "blue:wlan2g";
45 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
46 linux,default-trigger = "phy0tpt";
47 };
48
49 qss {
50 label = "blue:qss";
51 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
52 };
53 };
54
55 ath9k-leds {
56 compatible = "gpio-leds";
57
58 wlan5g {
59 label = "blue:wlan5g";
60 gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
61 linux,default-trigger = "phy1tpt";
62 };
63 };
64
65 keys {
66 compatible = "gpio-keys";
67
68 reset {
69 label = "Reset button";
70 linux,code = <KEY_RESTART>;
71 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
72 debounce-interval = <60>;
73 };
74 };
75
76 gpio-export {
77 compatible = "gpio-export";
78
79 gpio_usb1_power {
80 gpio-export,name = "tp-link:power:usb1";
81 gpio-export,output = <1>;
82 gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
83 };
84
85 gpio_usb2_power {
86 gpio-export,name = "tp-link:power:usb2";
87 gpio-export,output = <1>;
88 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
89 };
90 };
91 };
92
93 &pcie1 {
94 status = "okay";
95
96 ath9k: wifi@0,0 {
97 compatible = "pci168c,0033";
98 reg = <0x0000 0 0 0 0>;
99 nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_ath9k_pci>;
100 nvmem-cell-names = "mac-address", "calibration";
101 mac-address-increment = <(-2)>;
102 #gpio-cells = <2>;
103 gpio-controller;
104 };
105 };
106
107 &usb_phy0 {
108 status = "okay";
109 };
110
111 &usb0 {
112 #address-cells = <1>;
113 #size-cells = <0>;
114 status = "okay";
115
116 hub_port0: port@1 {
117 reg = <1>;
118 #trigger-source-cells = <0>;
119 };
120 };
121
122 &usb_phy1 {
123 status = "okay";
124 };
125
126 &usb1 {
127 #address-cells = <1>;
128 #size-cells = <0>;
129 status = "okay";
130
131 hub_port1: port@1 {
132 reg = <1>;
133 #trigger-source-cells = <0>;
134 };
135 };
136
137 &spi {
138 status = "okay";
139
140 flash@0 {
141 compatible = "jedec,spi-nor";
142 reg = <0>;
143 spi-max-frequency = <25000000>;
144
145 partitions {
146 compatible = "fixed-partitions";
147 #address-cells = <1>;
148 #size-cells = <1>;
149
150 uboot: partition@0 {
151 label = "u-boot";
152 reg = <0x000000 0x020000>;
153 read-only;
154
155 compatible = "nvmem-cells";
156 #address-cells = <1>;
157 #size-cells = <1>;
158
159 macaddr_uboot_1fc00: macaddr@1fc00 {
160 reg = <0x1fc00 0x6>;
161 };
162 };
163
164 partition@20000 {
165 compatible = "tplink,firmware";
166 label = "firmware";
167 reg = <0x020000 0x7d0000>;
168 };
169
170 art: partition@7f0000 {
171 label = "art";
172 reg = <0x7f0000 0x010000>;
173 read-only;
174
175 compatible = "nvmem-cells";
176 #address-cells = <1>;
177 #size-cells = <1>;
178
179 cal_ath9k_soc: cal_ath9k@1000 {
180 reg = <0x1000 0x440>;
181 };
182
183 cal_ath9k_pci: cal_ath9k@5000 {
184 reg = <0x5000 0x440>;
185 };
186 };
187 };
188 };
189 };
190
191 &mdio0 {
192 status = "okay";
193
194 phy0: ethernet-phy@0 {
195 reg = <0>;
196
197 qca,ar8327-initvals = <
198 0x04 0x00080080 /* PORT0 PAD MODE CTRL */
199 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
200 0x50 0xc737c737 /* LED_CTRL0 */
201 0x54 0x00000000 /* LED_CTRL1 */
202 0x58 0x00000000 /* LED_CTRL2 */
203 0x5c 0x0030c300 /* LED_CTRL3 */
204 0x7c 0x0000007e /* PORT0_STATUS */
205 0x94 0x0000007e /* PORT6 STATUS */
206 >;
207 };
208 };
209
210 &eth0 {
211 status = "okay";
212
213 nvmem-cells = <&macaddr_uboot_1fc00>;
214 nvmem-cell-names = "mac-address";
215 mac-address-increment = <1>;
216 phy-handle = <&phy0>;
217 pll-data = <0x56000000 0x00000101 0x00001616>;
218
219 gmac-config {
220 device = <&gmac>;
221 rgmii-enabled = <1>;
222 };
223 };
224
225 &eth1 {
226 status = "okay";
227
228 nvmem-cells = <&macaddr_uboot_1fc00>;
229 nvmem-cell-names = "mac-address";
230 pll-data = <0x03000101 0x00000101 0x00001616>;
231
232 fixed-link {
233 speed = <1000>;
234 full-duplex;
235 };
236 };
237
238 &wmac {
239 status = "okay";
240
241 nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_ath9k_soc>;
242 nvmem-cell-names = "mac-address", "calibration";
243 mac-address-increment = <(-1)>;
244 };