ef00d1807beb179df89e8695689bdbbc5d709123
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9558_librerouter_librerouter-v1.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 "qca955x.dtsi"
8
9 / {
10         compatible = "librerouter,librerouter-v1", "qca,qca9558";
11         model = "LibreRouter v1";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200n8";
15         };
16
17         aliases {
18                 led-boot = &led_system;
19                 led-failsafe = &led_system;
20                 led-running = &led_system;
21                 led-upgrade = &led_system;
22         };
23
24         leds {
25                 compatible = "gpio-leds";
26
27                 led_system: system {
28                         label = "librerouter-v1:green:system";
29                         gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
30                         default-state = "on";
31                 };
32
33                 wifi_green {
34                         label = "librerouter-v1:green:wlan2g";
35                         gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
36                         linux,default-trigger = "phy0tpt";
37                 };
38
39                 status_blue {
40                         label = "librerouter-v1:blue:status";
41                         gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
42                 };
43         };
44
45         keys {
46                 compatible = "gpio-keys";
47
48                 reset {
49                         label = "Reset";
50                         linux,code = <KEY_RESTART>;
51                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
52                         debounce-interval = <60>;
53                 };
54         };
55
56         watchdog {
57                 compatible = "linux,wdt-gpio";
58                 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
59                 hw_algo = "toggle";
60                 hw_margin_ms = <1000>;
61                 always-running;
62         };
63 };
64
65 &pcie0 {
66         status = "okay";
67
68         wifi@0,0 {
69                 compatible = "pci168c,0033";
70                 reg = <0x0000 0 0 0 0>;
71         };
72 };
73
74 &pcie1 {
75         status = "okay";
76
77         wifi@0,0 {
78                 compatible = "pci168c,0033";
79                 reg = <0x0000 0 0 0 0>;
80         };
81 };
82
83 &uart {
84         status = "okay";
85 };
86
87 &gpio {
88         status = "okay";
89 };
90
91 &usb_phy0 {
92         status = "okay";
93 };
94
95 &usb0 {
96         #address-cells = <1>;
97         #size-cells = <0>;
98         status = "okay";
99 };
100
101 &usb_phy1 {
102         status = "okay";
103 };
104
105 &usb1 {
106         #address-cells = <1>;
107         #size-cells = <0>;
108         status = "okay";
109 };
110
111 &spi {
112         status = "okay";
113
114         num-cs = <1>;
115
116         flash@0 {
117                 compatible = "jedec,spi-nor";
118                 reg = <0>;
119                 spi-max-frequency = <25000000>;
120
121                 partitions {
122                         compatible = "fixed-partitions";
123                         #address-cells = <1>;
124                         #size-cells = <1>;
125
126                         partition@0 {
127                                 label = "u-boot";
128                                 reg = <0x000000 0x040000>;
129                                 read-only;
130                         };
131
132                         partition@40000 {
133                                 label = "u-boot-env";
134                                 reg = <0x040000 0x010000>;
135                         };
136
137                         partition@50000 {
138                                 compatible = "denx,uimage";
139                                 label = "firmware";
140                                 reg = <0x050000 0x7c0000>;
141                         };
142
143                         partition@810000 {
144                                 label = "fw2";
145                                 reg = <0x810000 0x7d0000>;
146                         };
147
148                         partition@fd0000 {
149                                 label = "res";
150                                 reg = <0xfd0000 0x20000>;
151                         };
152
153                         art: partition@ff0000 {
154                                 label = "art";
155                                 reg = <0xff0000 0x010000>;
156                                 read-only;
157                         };
158                 };
159         };
160 };
161
162 &mdio0 {
163         status = "okay";
164
165         phy0: ethernet-phy@0 {
166                 reg = <0>;
167                 qca,ar8327-initvals = <
168                         0x04 0x87600000 /* PORT0: RGMII, MAC0/6 exchage, tx_delay 01, rx_delay 10 */
169                         0x0c 0x00000080 /* PORT6: SGMII */
170                         0x10 0x81000080 /* POWER_ON_STRAP: LED open drain, SerDes auto-neg disabled */
171                         0x50 0xcf37cf37 /* LED_CTRL0 */
172                         0x54 0xcf37cf37 /* LED_CTRL1 */
173                         0x58 0xcf37cf37 /* LED_CTRL2 */
174                         0x5c 0x0        /* LED_CTRL3 */
175                         0x7c 0x0000007e /* PORT0_STATUS */
176                         0x94 0x0000007e /* PORT6 STATUS */
177                 >;
178         };
179 };
180
181 &eth0 {
182         status = "okay";
183
184         pll-data = <0xa6000000 0x00000101 0x00001616>;
185         mtd-mac-address = <&art 0x0>;
186
187         phy-handle = <&phy0>;
188 };
189
190 &eth1 {
191         status = "okay";
192
193         phy-mode = "sgmii";
194         pll-data = <0x03000101 0x00000101 0x00001616>;
195         mtd-mac-address = <&art 0x6>;
196
197         fixed-link {
198                 speed = <1000>;
199                 full-duplex;
200         };
201 };
202
203 &wmac {
204         status = "okay";
205
206         mtd-cal-data = <&art 0x1000>;
207         mtd-mac-address = <&art 0xc>;
208 };