ec9d2398cdd6cedaf963ac1e2df9e9ea3ae6f98f
[openwrt/staging/hauke.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 factory: partition@40000 {
114 compatible = "nvmem-cells";
115 label = "factory";
116 reg = <0x40000 0x10000>;
117 #address-cells = <1>;
118 #size-cells = <1>;
119 read-only;
120
121 eeprom_factory_0: eeprom@0 {
122 reg = <0x0 0x400>;
123 };
124
125 eeprom_factory_8000: eeprom@8000 {
126 reg = <0x8000 0x200>;
127 };
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 firmware: partition@50000 {
139 compatible = "denx,uimage";
140 label = "firmware";
141 };
142 };
143 };
144 };
145
146 &pcie {
147 status = "okay";
148 };
149
150 &pcie0 {
151 wifi0: wifi@0,0 {
152 compatible = "pci14c3,7603";
153 reg = <0x0000 0 0 0 0>;
154 nvmem-cells = <&eeprom_factory_0>;
155 nvmem-cell-names = "eeprom";
156 };
157 };
158
159 &pcie1 {
160 wifi1: wifi@0,0 {
161 compatible = "pci14c3,7662";
162 reg = <0x0000 0 0 0 0>;
163 nvmem-cells = <&eeprom_factory_8000>;
164 nvmem-cell-names = "eeprom";
165 ieee80211-freq-limit = <5000000 6000000>;
166
167 led {
168 led-sources = <2>;
169 };
170 };
171 };
172
173 &gmac0 {
174 nvmem-cells = <&macaddr_factory_e000>;
175 nvmem-cell-names = "mac-address";
176 };
177
178 &gmac1 {
179 status = "okay";
180 label = "wan";
181 phy-handle = <&ethphy4>;
182
183 nvmem-cells = <&macaddr_factory_e006>;
184 nvmem-cell-names = "mac-address";
185 };
186
187 &mdio {
188 ethphy4: ethernet-phy@4 {
189 reg = <4>;
190 };
191 };
192
193 &switch0 {
194 ports {
195 port@0 {
196 status = "okay";
197 label = "lan1";
198 };
199
200 port@1 {
201 status = "okay";
202 label = "lan2";
203 };
204
205 port@2 {
206 status = "okay";
207 label = "lan3";
208 };
209
210 port@3 {
211 status = "okay";
212 label = "lan4";
213 };
214 };
215 };
216
217 &state_default {
218 gpio {
219 groups = "i2c", "uart2", "wdt";
220 function = "gpio";
221 };
222 };