ramips: add TP-LINK TL-WR902AC v4
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_zbtlink_zbt-wg1602.dtsi
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "zbtlink,zbt-wg1602", "mediatek,mt7621-soc";
8
9 aliases {
10 led-boot = &led_sm;
11 led-failsafe = &led_sm;
12 led-running = &led_sm;
13 led-upgrade = &led_sm;
14 label-mac-device = &gmac0;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29 };
30
31 leds {
32 compatible = "gpio-leds";
33
34 led_sm: sm {
35 label = "green:sm";
36 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
37 };
38
39 4g1 {
40 label = "green:4g1";
41 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
42 };
43
44 4g2 {
45 label = "green:4g2";
46 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
47 };
48 };
49
50 watchdog {
51 compatible = "linux,wdt-gpio";
52 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
53 hw_algo = "toggle";
54 /* hw_margin_ms is actually ~120s but driver limits it to 60s */
55 hw_margin_ms = <60000>;
56 always-running;
57 };
58
59 gpio-export {
60 compatible = "gpio-export";
61 #size-cells = <0>;
62
63 4g1-pwr {
64 gpio-export,name = "4g1-pwr";
65 gpio-export,output = <1>;
66 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
67 };
68
69 4g2-pwr {
70 gpio-export,name = "4g2-pwr";
71 gpio-export,output = <1>;
72 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
73 };
74
75 ext-usb {
76 gpio-export,name = "ext-usb";
77 gpio-export,output = <1>;
78 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
79 };
80 };
81 };
82
83 &sdhci {
84 status = "okay";
85 };
86
87 &spi0 {
88 status = "okay";
89
90 flash@0 {
91 compatible = "jedec,spi-nor";
92 reg = <0>;
93 spi-max-frequency = <10000000>;
94
95 partitions {
96 compatible = "fixed-partitions";
97 #address-cells = <1>;
98 #size-cells = <1>;
99
100 partition@0 {
101 label = "u-boot";
102 reg = <0x0 0x30000>;
103 read-only;
104 };
105
106 partition@30000 {
107 label = "u-boot-env";
108 reg = <0x30000 0x10000>;
109 read-only;
110 };
111
112 factory: partition@40000 {
113 label = "factory";
114 reg = <0x40000 0x10000>;
115 read-only;
116
117 nvmem-layout {
118 compatible = "fixed-layout";
119 #address-cells = <1>;
120 #size-cells = <1>;
121
122 eeprom_factory_0: eeprom@0 {
123 reg = <0x0 0x400>;
124 };
125
126 eeprom_factory_8000: eeprom@8000 {
127 reg = <0x8000 0x200>;
128 };
129
130 macaddr_factory_e000: macaddr@e000 {
131 reg = <0xe000 0x6>;
132 };
133
134 macaddr_factory_e006: macaddr@e006 {
135 reg = <0xe006 0x6>;
136 };
137 };
138 };
139
140 firmware: partition@50000 {
141 compatible = "denx,uimage";
142 label = "firmware";
143 };
144 };
145 };
146 };
147
148 &pcie {
149 status = "okay";
150 };
151
152 &pcie0 {
153 wifi0: wifi@0,0 {
154 compatible = "pci14c3,7603";
155 reg = <0x0000 0 0 0 0>;
156 nvmem-cells = <&eeprom_factory_0>;
157 nvmem-cell-names = "eeprom";
158 };
159 };
160
161 &pcie1 {
162 wifi1: wifi@0,0 {
163 compatible = "pci14c3,7662";
164 reg = <0x0000 0 0 0 0>;
165 nvmem-cells = <&eeprom_factory_8000>;
166 nvmem-cell-names = "eeprom";
167 ieee80211-freq-limit = <5000000 6000000>;
168
169 led {
170 led-sources = <2>;
171 };
172 };
173 };
174
175 &gmac0 {
176 nvmem-cells = <&macaddr_factory_e000>;
177 nvmem-cell-names = "mac-address";
178 };
179
180 &gmac1 {
181 status = "okay";
182 label = "wan";
183 phy-handle = <&ethphy4>;
184
185 nvmem-cells = <&macaddr_factory_e006>;
186 nvmem-cell-names = "mac-address";
187 };
188
189 &mdio {
190 ethphy4: ethernet-phy@4 {
191 reg = <4>;
192 };
193 };
194
195 &switch0 {
196 ports {
197 port@0 {
198 status = "okay";
199 label = "lan1";
200 };
201
202 port@1 {
203 status = "okay";
204 label = "lan2";
205 };
206
207 port@2 {
208 status = "okay";
209 label = "lan3";
210 };
211
212 port@3 {
213 status = "okay";
214 label = "lan4";
215 };
216 };
217 };
218
219 &state_default {
220 gpio {
221 groups = "i2c", "uart2", "wdt";
222 function = "gpio";
223 };
224 };