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