ath79: qcn: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ath79 / dts / qcn5502_tplink_archer-a9-v6.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 model = "TP-Link Archer A9 v6";
10 compatible = "tplink,archer-a9-v6", "qca,qcn5500", "qca,qca9560";
11
12 aliases {
13 label-mac-device = &eth0;
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 linux,code = <KEY_RESTART>;
26 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
27 debounce-interval = <60>;
28 };
29
30 wps {
31 label = "wps";
32 linux,code = <KEY_WPS_BUTTON>;
33 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 };
36 };
37
38 leds {
39 compatible = "gpio-leds";
40
41 led_power: power {
42 label = "green:power";
43 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
44 default-state = "on";
45 };
46
47 usb {
48 label = "green:usb";
49 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
50 trigger-sources = <&hub_port0>;
51 linux,default-trigger = "usbport";
52 };
53
54 wan {
55 label = "green:wan";
56 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
57 };
58
59 wan_orange {
60 label = "orange:wan";
61 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
62 };
63
64 wlan2g {
65 label = "green:wlan2g";
66 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
67 linux,default-trigger = "phy1tpt";
68 };
69
70 wlan5g {
71 label = "green:wlan5g";
72 gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
73 linux,default-trigger = "phy0tpt";
74 };
75
76 wps {
77 label = "green:wps";
78 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
79 };
80 };
81 };
82
83 &eth0 {
84 status = "okay";
85
86 pll-data = <0x03000101 0x00000101 0x00001919>;
87
88 phy-mode = "sgmii";
89 phy-handle = <&phy0>;
90
91 nvmem-cells = <&macaddr_info_8 0>;
92 nvmem-cell-names = "mac-address";
93 };
94
95 &mdio0 {
96 status = "okay";
97
98 phy0: ethernet-phy@0 {
99 reg = <0>;
100 phy-mode = "sgmii";
101 qca,mib-poll-interval = <500>;
102
103 qca,ar8327-initvals = <
104 0x04 0x80080080 /* PORT0 PAD MODE CTRL */
105 0x08 0x00000000 /* PORT5 PAD MODE CTRL */
106 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
107 0x10 0x00000080 /* POWER_ON_STRAP */
108 0x7c 0x0000007e /* PORT0_STATUS */
109 0x94 0x00000200 /* PORT6_STATUS */
110 >;
111 };
112 };
113
114 &pcie {
115 status = "okay";
116
117 wifi@0,0 {
118 compatible = "pci168c,0046";
119 reg = <0 0 0 0 0>;
120
121 nvmem-cells = <&macaddr_info_8 (-1)>, <&precal_art_5000>;
122 nvmem-cell-names = "mac-address", "pre-calibration";
123 };
124 };
125
126 &spi {
127 status = "okay";
128
129 flash@0 {
130 compatible = "jedec,spi-nor";
131 reg = <0>;
132 spi-max-frequency = <25000000>;
133 m25p,fast-read;
134
135 mtdparts: partitions {
136 compatible = "fixed-partitions";
137 #address-cells = <1>;
138 #size-cells = <1>;
139
140 partition@0 {
141 label = "factory-uboot";
142 reg = <0x000000 0x020000>;
143 read-only;
144 };
145
146 partition@20000 {
147 label = "u-boot";
148 reg = <0x020000 0x020000>;
149 read-only;
150 };
151
152 partition@40000 {
153 label = "partition-table";
154 reg = <0x040000 0x010000>;
155 read-only;
156 };
157
158 partition@50000 {
159 label = "art";
160 reg = <0x050000 0x010000>;
161 read-only;
162
163 nvmem-layout {
164 compatible = "fixed-layout";
165 #address-cells = <1>;
166 #size-cells = <1>;
167
168 cal_art_1000: cal@1000 {
169 reg = <0x1000 0x440>;
170 };
171
172 precal_art_5000: precal@5000 {
173 reg = <0x5000 0x2f20>;
174 };
175 };
176 };
177
178 partition@60000 {
179 label = "info";
180 reg = <0x060000 0x020000>;
181 read-only;
182
183 nvmem-layout {
184 compatible = "fixed-layout";
185 #address-cells = <1>;
186 #size-cells = <1>;
187
188 macaddr_info_8: macaddr@8 {
189 compatible = "mac-base";
190 reg = <0x8 0x6>;
191 #nvmem-cell-cells = <1>;
192 };
193 };
194 };
195
196 partition@80000 {
197 label = "user-config";
198 reg = <0x080000 0x040000>;
199 read-only;
200 };
201
202 partition@c0000 {
203 compatible = "denx,uimage";
204 label = "firmware";
205 reg = <0x0c0000 0xf00000>;
206 };
207
208 partition@fc0000 {
209 label = "log";
210 reg = <0xfc0000 0x020000>;
211 read-only;
212 };
213
214 partition@fe0000 {
215 label = "certificate";
216 reg = <0xfe0000 0x010000>;
217 read-only;
218 };
219
220 partition@ff0000 {
221 label = "default-config";
222 reg = <0xff0000 0x010000>;
223 read-only;
224 };
225 };
226 };
227 };
228
229 &usb_phy0 {
230 status = "okay";
231 };
232
233 &usb0 {
234 status = "okay";
235 };
236
237 &wmac {
238 /* TODO: missing support in ath9k */
239 status = "disabled";
240
241 nvmem-cells = <&cal_art_1000>, <&macaddr_info_8 0>;
242 nvmem-cell-names = "calibration", "mac-address";
243 };