4954d35537fb086ea76f0021f0b9cc0f23c0aa14
[openwrt/staging/jow.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 nvmem-layout {
89 compatible = "fixed-layout";
90 #address-cells = <1>;
91 #size-cells = <1>;
92
93 macaddr_config_0: macaddr@0 {
94 reg = <0x0 0x6>;
95 };
96 };
97 };
98
99 partition@30000 {
100 label = "art";
101 reg = <0x030000 0x010000>;
102 read-only;
103 };
104
105 partition@40000 {
106 compatible = "denx,uimage";
107 label = "firmware";
108 reg = <0x040000 0xf30000>;
109 };
110
111 partition@f70000 {
112 label = "event-log";
113 reg = <0xf70000 0x090000>;
114 };
115 };
116 };
117 };
118
119 &usb0 {
120 status = "okay";
121 };
122
123 &usb_phy {
124 status = "okay";
125 };
126
127 &uart {
128 status = "okay";
129 };
130
131 &eth0 {
132 status = "okay";
133 phy-handle = <&swphy0>;
134
135 nvmem-cells = <&macaddr_config_0>;
136 nvmem-cell-names = "mac-address";
137 mac-address-increment = <1>;
138 };
139
140 &eth1 {
141 phy-handle = <&swphy4>;
142 nvmem-cells = <&macaddr_config_0>;
143 nvmem-cell-names = "mac-address";
144
145 gmac-config {
146 device = <&gmac>;
147 switch-phy-swap = <1>;
148 };
149 };
150
151 &pinmux {
152 pmx_leds_switch: leds_switch {
153 // switch port LEDs on GPIO 0~4
154 pinctrl-single,bits = <0x0 0x00000000 0xffffffff>,
155 <0x4 0x00000000 0x000000ff>;
156 };
157 };