ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9557_dongwon_dw02-412h.dtsi
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 #include <dt-bindings/leds/common.h>
8
9 / {
10 aliases {
11 led-boot = &led_wan;
12 led-failsafe = &led_wan;
13 led-upgrade = &led_wan;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 wps {
20 label = "WPS button";
21 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
22 linux,code = <KEY_WPS_BUTTON>;
23 };
24
25 reset {
26 label = "Reset button";
27 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30 };
31
32 leds {
33 compatible = "gpio-leds";
34
35 led_wan: wan {
36 function = LED_FUNCTION_WAN;
37 color = <LED_COLOR_ID_GREEN>;
38 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
39 };
40
41 wlan {
42 function = LED_FUNCTION_WLAN;
43 color = <LED_COLOR_ID_GREEN>;
44 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
45 };
46 };
47 };
48
49 &spi {
50 status = "okay";
51
52 flash@0 {
53 compatible = "jedec,spi-nor";
54 reg = <0>;
55 spi-max-frequency = <50000000>;
56
57 partitions {
58 compatible = "fixed-partitions";
59 #address-cells = <1>;
60 #size-cells = <1>;
61
62 partition@0 {
63 label = "u-boot";
64 reg = <0x000000 0x040000>;
65 read-only;
66 };
67
68 partition@40000 {
69 label = "u-boot-env";
70 reg = <0x040000 0x010000>;
71 };
72
73 partition@50000 {
74 label = "log";
75 reg = <0x050000 0x010000>;
76 read-only;
77 };
78
79 partition@60000 {
80 label = "recoverk";
81 reg = <0x060000 0x0e0000>;
82 read-only;
83 };
84
85 partition@140000 {
86 label = "recoverr";
87 reg = <0x140000 0x090000>;
88 read-only;
89 };
90
91 partition@1d0000 {
92 label = "nvram";
93 reg = <0x1d0000 0x010000>;
94 read-only;
95 };
96
97 partition@1e0000 {
98 label = "nvbackup";
99 reg = <0x1e0000 0x010000>;
100 read-only;
101 };
102
103 partition@1f0000 {
104 label = "art";
105 reg = <0x1f0000 0x010000>;
106 read-only;
107
108 nvmem-layout {
109 compatible = "fixed-layout";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 macaddr_art_0: macaddr@0 {
114 compatible = "mac-base";
115 reg = <0x0 0x6>;
116 #nvmem-cell-cells = <1>;
117 };
118
119 cal_art_1000: cal@1000 {
120 reg = <0x1000 0x440>;
121 };
122
123 cal_art_5000: cal@5000 {
124 reg = <0x5000 0x844>;
125 };
126 };
127 };
128 };
129 };
130 };
131
132 &nand {
133 status = "okay";
134
135 partitions {
136 compatible = "fixed-partitions";
137 #address-cells = <1>;
138 #size-cells = <1>;
139
140 partition@0 {
141 label = "current";
142 reg = <0x0 0x1000000>;
143 read-only;
144 };
145
146 partition@1000000 {
147 label = "kernel";
148 reg = <0x1000000 0x800000>;
149 };
150
151 ubi: partition@1800000 {
152 label = "ubi";
153 };
154 };
155 };
156
157 &pcie0 {
158 status = "okay";
159
160 wifi@0,0 {
161 compatible = "qcom,ath10k";
162 reg = <0 0 0 0 0>;
163
164 nvmem-cells = <&macaddr_art_0 4>, <&cal_art_5000>;
165 nvmem-cell-names = "mac-address", "calibration";
166 };
167 };
168
169 &wmac {
170 status = "okay";
171
172 nvmem-cells = <&macaddr_art_0 3>, <&cal_art_1000>;
173 nvmem-cell-names = "mac-address", "calibration";
174 };
175
176 &usb_phy0 {
177 status = "okay";
178 };
179
180 &usb0 {
181 status = "okay";
182 };
183
184 &mdio0 {
185 status = "okay";
186
187 phy0: ethernet-phy@0 {
188 reg = <0>;
189
190 qca,ar8327-initvals = <
191 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
192 0x50 0xcf37cf37 /* LED Control Register 0 */
193 0x54 0x00000000 /* LED Control Register 1 */
194 0x58 0x00000000 /* LED Control Register 2 */
195 0x5c 0x0030c300 /* LED Control Register 3 */
196 0x7c 0x0000007e /* PORT0_STATUS */
197 >;
198 };
199 };
200
201 &eth0 {
202 status = "okay";
203
204 nvmem-cells = <&macaddr_art_0 1>;
205 nvmem-cell-names = "mac-address";
206 phy-handle = <&phy0>;
207 pll-data = <0xa6000000 0x00000101 0x00001616>;
208
209 gmac-config {
210 device = <&gmac>;
211 rgmii-enabled = <1>;
212 };
213 };