ramips: add support for Zbtlink ZBT-WG1602
[openwrt/staging/hauke.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
118 firmware: partition@50000 {
119 compatible = "denx,uimage";
120 label = "firmware";
121 };
122 };
123 };
124 };
125
126 &pcie {
127 status = "okay";
128 };
129
130 &pcie0 {
131 wifi0: wifi@0,0 {
132 compatible = "pci14c3,7603";
133 reg = <0x0000 0 0 0 0>;
134 mediatek,mtd-eeprom = <&factory 0x0000>;
135 };
136 };
137
138 &pcie1 {
139 wifi1: wifi@0,0 {
140 compatible = "pci14c3,7662";
141 reg = <0x0000 0 0 0 0>;
142 mediatek,mtd-eeprom = <&factory 0x8000>;
143 ieee80211-freq-limit = <5000000 6000000>;
144
145 led {
146 led-sources = <2>;
147 };
148 };
149 };
150
151 &gmac0 {
152 nvmem-cells = <&macaddr_factory_e000>;
153 nvmem-cell-names = "mac-address";
154 };
155
156 &switch0 {
157 ports {
158 port@0 {
159 status = "okay";
160 label = "lan1";
161 };
162
163 port@1 {
164 status = "okay";
165 label = "lan2";
166 };
167
168 port@2 {
169 status = "okay";
170 label = "lan3";
171 };
172
173 port@3 {
174 status = "okay";
175 label = "lan4";
176 };
177
178 port@4 {
179 status = "okay";
180 label = "wan";
181 nvmem-cells = <&macaddr_factory_e006>;
182 nvmem-cell-names = "mac-address";
183 };
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "i2c", "rgmii2", "uart2", "wdt";
190 function = "gpio";
191 };
192 };
193
194 &factory {
195 compatible = "nvmem-cells";
196 #address-cells = <1>;
197 #size-cells = <1>;
198
199 macaddr_factory_e000: macaddr@e000 {
200 reg = <0xe000 0x6>;
201 };
202
203 macaddr_factory_e006: macaddr@e006 {
204 reg = <0xe006 0x6>;
205 };
206 };