ath79: add support for Teltonika RUT300
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9531_teltonika_rut300.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 #include "qca953x.dtsi"
7
8 / {
9 compatible = "teltonika,rut300", "teltonika,rut30x", "qca,qca9531";
10 model = "TELTONIKA RUT300";
11
12 aliases {
13 label-mac-device = &eth1;
14 led-boot = &led_wan;
15 led-failsafe = &led_wan;
16 led-running = &led_wan;
17 led-upgrade = &led_wan;
18 serial0 = &uart;
19 };
20
21 leds {
22 compatible = "gpio-leds";
23 pinctrl-names = "default";
24 pinctrl-0 = <&pmx_leds_switch>, <&jtag_disable_pins>;
25
26 led_wan: wan {
27 label = "yellow:wan";
28 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
29 };
30
31 lan1 {
32 label = "yellow:lan1";
33 gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
34 };
35
36 lan2 {
37 label = "yellow:lan2";
38 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
39 };
40
41 lan3 {
42 label = "yellow:lan3";
43 gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
44 };
45
46 lan4 {
47 label = "yellow:lan4";
48 gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
49 };
50 };
51
52 keys {
53 compatible = "gpio-keys";
54
55 reset {
56 label = "reset";
57 linux,code = <KEY_RESTART>;
58 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
59 };
60 };
61 };
62
63 &spi {
64 status = "okay";
65 num-cs = <1>;
66
67 flash@0 {
68 compatible = "jedec,spi-nor";
69 reg = <0>;
70 spi-max-frequency = <25000000>;
71
72 partitions {
73 compatible = "fixed-partitions";
74 #address-cells = <1>;
75 #size-cells = <1>;
76
77 partition@0 {
78 label = "u-boot";
79 reg = <0x000000 0x020000>;
80 read-only;
81 };
82
83 config: partition@20000 {
84 label = "config";
85 reg = <0x020000 0x010000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "art";
91 reg = <0x030000 0x010000>;
92 read-only;
93 };
94
95 partition@40000 {
96 compatible = "denx,uimage";
97 label = "firmware";
98 reg = <0x040000 0xf30000>;
99 };
100
101 partition@f70000 {
102 label = "event-log";
103 reg = <0xf70000 0x090000>;
104 };
105 };
106 };
107 };
108
109 &usb0 {
110 #address-cells = <1>;
111 #size-cells = <0>;
112 status = "okay";
113
114 hub_port0: port@1 {
115 reg = <1>;
116 #trigger-source-cells = <0>;
117 };
118 };
119
120 &usb_phy {
121 status = "okay";
122 };
123
124 &uart {
125 status = "okay";
126 };
127
128 &config {
129 compatible = "nvmem-cells";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 macaddr_config_0: macaddr@0 {
134 reg = <0x0 0x6>;
135 };
136 };
137
138 &eth0 {
139 status = "okay";
140 phy-handle = <&swphy0>;
141
142 nvmem-cells = <&macaddr_config_0>;
143 nvmem-cell-names = "mac-address";
144 mac-address-increment = <1>;
145 };
146
147 &eth1 {
148 phy-handle = <&swphy4>;
149 nvmem-cells = <&macaddr_config_0>;
150 nvmem-cell-names = "mac-address";
151
152 gmac-config {
153 device = <&gmac>;
154 switch-phy-swap = <1>;
155 };
156 };
157
158 &pinmux {
159 pmx_leds_switch: leds_switch {
160 // switch port LEDs on GPIO 0~4
161 pinctrl-single,bits = <0x0 0x00000000 0xffffffff>,
162 <0x4 0x00000000 0x000000ff>;
163 };
164 };