ath79: use gpios for switch management in WZR-HP-G300NH variants
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9533_tplink_tl-wr842n-v3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca953x.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "tplink,tl-wr842n-v3", "qca,qca9533";
10 model = "TP-Link TL-WR842N v3";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 label-mac-device = &eth1;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_power: power {
24 label = "green:power";
25 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
26 default-state = "on";
27 };
28
29 wifi {
30 label = "green:wlan";
31 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
32 linux,default-trigger = "phy0tpt";
33 };
34
35 qss {
36 label = "green:qss";
37 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
38 };
39
40 wan_green {
41 label = "green:wan";
42 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
43 };
44
45 wan_red {
46 label = "red:wan";
47 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
48 };
49
50 lan1 {
51 label = "green:lan1";
52 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
53 };
54
55 lan2 {
56 label = "green:lan2";
57 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
58 };
59
60 lan3 {
61 label = "green:lan3";
62 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
63 };
64
65 lan4 {
66 label = "green:lan4";
67 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
68 };
69
70 usb {
71 label = "green:usb";
72 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
73 linux,default-trigger = "usbport";
74 trigger-sources = <&hub_port0>;
75 };
76 };
77
78 keys {
79 compatible = "gpio-keys";
80
81 reset {
82 label = "Reset button";
83 linux,code = <KEY_RESTART>;
84 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
85 debounce-interval = <60>;
86 };
87
88 rfkill {
89 label = "RFKILL button";
90 linux,code = <KEY_RFKILL>;
91 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
92 debounce-interval = <60>;
93 };
94 };
95 };
96
97 &usb0 {
98 status = "okay";
99 };
100
101 &usb_phy {
102 status = "okay";
103 };
104
105 &spi {
106 status = "okay";
107
108 flash@0 {
109 compatible = "jedec,spi-nor";
110 reg = <0>;
111 spi-max-frequency = <25000000>;
112
113 partitions {
114 compatible = "fixed-partitions";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 uboot: partition@0 {
119 label = "u-boot";
120 reg = <0x000000 0x020000>;
121 read-only;
122 };
123
124 partition@20000 {
125 compatible = "tplink,firmware";
126 label = "firmware";
127 reg = <0x020000 0xfd0000>;
128 };
129
130 art: partition@ff0000 {
131 label = "art";
132 reg = <0xff0000 0x010000>;
133 read-only;
134 };
135 };
136 };
137 };
138
139 &eth0 {
140 status = "okay";
141
142 phy-handle = <&swphy4>;
143
144 nvmem-cells = <&macaddr_uboot_1fc00>;
145 nvmem-cell-names = "mac-address";
146 mac-address-increment = <1>;
147 };
148
149 &eth1 {
150 nvmem-cells = <&macaddr_uboot_1fc00>;
151 nvmem-cell-names = "mac-address";
152 };
153
154 &wmac {
155 status = "okay";
156
157 mtd-cal-data = <&art 0x1000>;
158 nvmem-cells = <&macaddr_uboot_1fc00>;
159 nvmem-cell-names = "mac-address";
160 };
161
162 &uboot {
163 compatible = "nvmem-cells";
164 #address-cells = <1>;
165 #size-cells = <1>;
166
167 macaddr_uboot_1fc00: macaddr@1fc00 {
168 reg = <0x1fc00 0x6>;
169 };
170 };