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