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