ramips: mt7621: add support for Zbtlink ZBT-WG1608
[openwrt/staging/dangole.git] / target / linux / ramips / dts / mt7621_zbtlink_zbt-wg1608.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "zbtlink,zbt-wg1608", "mediatek,mt7621-soc";
11
12 aliases {
13 led-boot = &led_internet;
14 led-failsafe = &led_internet;
15 led-running = &led_internet;
16 led-upgrade = &led_internet;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 led_internet: internet {
38 label = "green:internet";
39 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
40 };
41
42 wwan {
43 label = "green:wwan";
44 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "usbport";
46 trigger-sources = <&hub_port2>;
47 };
48
49 wifi5g {
50 label = "green:wifi5g";
51 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
52 linux,default-trigger = "phy1tpt";
53 };
54
55 lan1 {
56 color = <LED_COLOR_ID_GREEN>;
57 function = LED_FUNCTION_LAN;
58 function-enumerator = <1>;
59 gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
60 };
61
62 lan2 {
63 color = <LED_COLOR_ID_GREEN>;
64 function = LED_FUNCTION_LAN;
65 function-enumerator = <2>;
66 gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
67 };
68
69 lan3 {
70 color = <LED_COLOR_ID_GREEN>;
71 function = LED_FUNCTION_LAN;
72 function-enumerator = <3>;
73 gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
74 };
75
76 lan4 {
77 color = <LED_COLOR_ID_GREEN>;
78 function = LED_FUNCTION_LAN;
79 function-enumerator = <4>;
80 gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
81 };
82
83 wan {
84 color = <LED_COLOR_ID_GREEN>;
85 function = LED_FUNCTION_WAN;
86 gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
87 };
88 };
89 };
90
91 &sdhci {
92 status = "okay";
93 };
94
95 &spi0 {
96 status = "okay";
97
98 flash@0 {
99 compatible = "jedec,spi-nor";
100 reg = <0>;
101 spi-max-frequency = <50000000>;
102
103 partitions {
104 compatible = "fixed-partitions";
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 partition@0 {
109 label = "u-boot";
110 reg = <0x0 0x30000>;
111 read-only;
112 };
113
114 partition@30000 {
115 label = "u-boot-env";
116 reg = <0x30000 0x10000>;
117 read-only;
118 };
119
120 factory: partition@40000 {
121 label = "factory";
122 reg = <0x40000 0x10000>;
123 read-only;
124
125 compatible = "nvmem-cells";
126 #address-cells = <1>;
127 #size-cells = <1>;
128
129 macaddr_factory_e000: macaddr@e000 {
130 reg = <0xe000 0x6>;
131 };
132
133 macaddr_factory_e006: macaddr@e006 {
134 reg = <0xe006 0x6>;
135 };
136
137 };
138
139 firmware: partition@50000 {
140 compatible = "denx,uimage";
141 label = "firmware";
142 };
143 };
144 };
145 };
146
147 &pcie {
148 status = "okay";
149 };
150
151 &pcie0 {
152 wifi@0,0 {
153 compatible = "mediatek,mt76";
154 reg = <0x0000 0 0 0 0>;
155 mediatek,mtd-eeprom = <&factory 0x0000>;
156 };
157 };
158
159 &pcie1 {
160 wifi@0,0 {
161 compatible = "mediatek,mt76";
162 reg = <0x0000 0 0 0 0>;
163 mediatek,mtd-eeprom = <&factory 0x8000>;
164 ieee80211-freq-limit = <5000000 6000000>;
165 };
166 };
167
168 &gmac0 {
169 nvmem-cells = <&macaddr_factory_e000>;
170 nvmem-cell-names = "mac-address";
171 };
172
173 &switch0 {
174 gpio-controller;
175 #gpio-cells = <2>;
176
177 ports {
178 port@0 {
179 status = "okay";
180 label = "lan1";
181 };
182
183 port@1 {
184 status = "okay";
185 label = "lan2";
186 };
187
188 port@2 {
189 status = "okay";
190 label = "lan3";
191 };
192
193 port@3 {
194 status = "okay";
195 label = "lan4";
196 };
197
198 port@4 {
199 status = "okay";
200 label = "wan";
201 nvmem-cells = <&macaddr_factory_e006>;
202 nvmem-cell-names = "mac-address";
203 };
204 };
205 };
206
207 &state_default {
208 gpio {
209 groups = "wdt", "uart2", "jtag";
210 function = "gpio";
211 };
212 };
213
214 &xhci_ehci_port1 {
215 #address-cells = <1>;
216 #size-cells = <0>;
217
218 hub_port2: port@2 {
219 reg = <2>;
220 #trigger-source-cells = <0>;
221 };
222
223 port@4 {
224 reg = <4>;
225 #trigger-source-cells = <0>;
226 };
227 };
228