ath79: use gpios for switch management in WZR-HP-G300NH variants
[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 status = "okay";
111 };
112
113 &usb_phy {
114 status = "okay";
115 };
116
117 &uart {
118 status = "okay";
119 };
120
121 &config {
122 compatible = "nvmem-cells";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 macaddr_config_0: macaddr@0 {
127 reg = <0x0 0x6>;
128 };
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 };