Rebased from upstream / out of band repository.
[librecmc/librecmc.git] / target / linux / ath79 / dts / ar9344_pcs_cr5000.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar9344.dtsi"
8
9 / {
10         model = "PowerCloud Systems CR5000";
11         compatible = "pcs,cr5000", "qca,ar9344";
12
13         aliases {
14                 serial0 = &uart;
15                 led-boot = &status;
16                 led-failsafe = &status;
17                 led-running = &status;
18                 led-upgrade = &status;
19         };
20
21         keys {
22                 compatible = "gpio-keys-polled";
23                 poll-interval = <20>;
24
25                 pinctrl-names = "default";
26                 pinctrl-0 = <&jtag_disable_pins>;
27
28                 reset {
29                         label = "Reset button";
30                         linux,code = <KEY_RESTART>;
31                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
32                         debounce-interval = <60>;
33                 };
34
35                 wps {
36                         label = "WPS button";
37                         linux,code = <KEY_WPS_BUTTON>;
38                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
39                         debounce-interval = <60>;
40                 };
41         };
42
43         leds {
44                 compatible = "gpio-leds";
45
46                 status: power {
47                         label = "pcs:amber:power";
48                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>,
49                                 <&gpio 4 GPIO_ACTIVE_LOW>;
50                         default-state = "on";
51                 };
52
53                 wlan2g {
54                         label = "pcs:blue:wlan";
55                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
56                         linux,default-trigger = "phy0tpt";
57                 };
58
59                 wps_white {
60                         label = "pcs:white:wps";
61                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
62                 };
63         };
64 };
65
66 &ref {
67         clock-frequency = <25000000>;
68 };
69
70 &uart {
71         status = "okay";
72 };
73
74 &gpio {
75         status = "okay";
76 };
77
78 &spi {
79         num-cs = <1>;
80
81         status = "okay";
82
83         flash@0 {
84                 compatible = "jedec,spi-nor";
85                 reg = <0>;
86                 spi-max-frequency = <25000000>;
87
88                 partitions {
89                         compatible = "fixed-partitions";
90                         #address-cells = <1>;
91                         #size-cells = <1>;
92
93                         uboot: partition@0 {
94                                 label = "u-boot";
95                                 reg = <0x000000 0x040000>;
96                                 read-only;
97                         };
98
99                         partition@40000 {
100                                 label = "u-boot-env";
101                                 reg = <0x040000 0x010000>;
102                                 read-only;
103                         };
104
105                         partition@50000 {
106                                 compatible = "denx,uimage";
107                                 label = "firmware";
108                                 reg = <0x050000 0x07a0000>;
109                         };
110
111                         art: partition@7f0000 {
112                                 label = "art";
113                                 reg = <0x7f0000 0x010000>;
114                                 read-only;
115                         };
116                 };
117         };
118 };
119
120 &usb {
121         status = "okay";
122         #address-cells = <1>;
123         #size-cells = <0>;
124
125         hub_port1: port@1 {
126                 reg = <1>;
127                 #trigger-source-cells = <0>;
128         };
129 };
130
131 &usb_phy {
132         status = "okay";
133 };
134
135 &pcie {
136         status = "okay";
137
138         ath9k: wifi@0,0 {
139                 compatible = "pci168c,0030";
140                 reg = <0x0000 0 0 0 0>;
141                 mtd-mac-address = <&art 0x5002>;
142                 #gpio-cells = <2>;
143                 gpio-controller;
144         };
145 };
146
147 &mdio0 {
148         status = "okay";
149
150         phy-mask = <0>;
151
152         phy0: ethernet-phy@0 {
153                 reg = <0>;
154                 phy-mode = "rgmii";
155                 qca,ar8327-initvals = <
156                         0x04 0x07600000 /* PORT0 PAD MODE CTRL */
157                         0x10 0x81000080 /* POWER_ON_STRAP */
158                         0x50 0xcc35cc35 /* LED_CTRL0 */
159                         0x54 0xca35ca35 /* LED_CTRL1 */
160                         0x58 0xc935c935 /* LED_CTRL2 */
161                         0x5c 0x03ffff00 /* LED_CTRL3 */
162                         0x7c 0x0000007e /* PORT0_STATUS */
163                 >;
164         };
165 };
166
167 &eth0 {
168         #address-cells = <1>;
169         #size-cells = <0>;
170         status = "okay";
171
172         /* default for ar934x, except for 1000M */
173         pll-data = <0x06000000 0x00000101 0x00001616>;
174
175         mtd-mac-address = <&art 0x0>;
176
177         phy-mode = "rgmii";
178         phy-handle = <&phy0>;
179
180
181         aliases {
182                 ag0 = &eth1;
183         };
184
185         port@0 {
186                 compatible = "swconfig,port";
187                 reg = <0>;
188                 swconfig,segment = "lan";
189                 swconfig,portmap = <1 1>;
190         };
191
192         port@1 {
193                 compatible = "swconfig,port";
194                 reg = <1>;
195                 swconfig,segment = "lan";
196                 swconfig,portmap = <2 2>;
197         };
198
199         port@2 {
200                 compatible = "swconfig,port";
201                 reg = <2>;
202                 swconfig,segment = "lan";
203                 swconfig,portmap = <3 3>;
204         };
205
206         port@3 {
207                 compatible = "swconfig,port";
208                 reg = <3>;
209                 swconfig,segment = "lan";
210                 swconfig,portmap = <4 4>;
211         };
212
213         port@4 {
214                 compatible = "swconfig,port";
215                 reg = <4>;
216                 swconfig,segment = "wan";
217                 swconfig,portmap = <5 5>;
218         };
219 };
220
221 &wmac {
222         status = "okay";
223
224         mtd-cal-data = <&art 0x1000>;
225         mtd-mac-address = <&art 0x1002>;
226 };