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