ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_zbtlink_zbt-wg1608.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "zbtlink,zbt-wg1608", "mediatek,mt7621-soc";
11
12 aliases {
13 led-boot = &led_internet;
14 led-failsafe = &led_internet;
15 led-running = &led_internet;
16 led-upgrade = &led_internet;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 led_internet: internet {
38 label = "green:internet";
39 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
40 };
41
42 wwan {
43 label = "green:wwan";
44 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "usbport";
46 trigger-sources = <&hub_port2>;
47 };
48
49 wifi5g {
50 label = "green:wifi5g";
51 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
52 linux,default-trigger = "phy1tpt";
53 };
54 };
55 };
56
57 &sdhci {
58 status = "okay";
59 };
60
61 &spi0 {
62 status = "okay";
63
64 flash0: flash@0 {
65 compatible = "jedec,spi-nor";
66 reg = <0>;
67 spi-max-frequency = <50000000>;
68
69 partitions {
70 compatible = "fixed-partitions";
71 #address-cells = <1>;
72 #size-cells = <1>;
73
74 partition@0 {
75 label = "u-boot";
76 reg = <0x0 0x30000>;
77 read-only;
78 };
79
80 partition@30000 {
81 label = "u-boot-env";
82 reg = <0x30000 0x10000>;
83 read-only;
84 };
85
86 factory: partition@40000 {
87 compatible = "nvmem-cells";
88 label = "factory";
89 reg = <0x40000 0x10000>;
90 #address-cells = <1>;
91 #size-cells = <1>;
92 read-only;
93
94 eeprom_factory_0: eeprom@0 {
95 reg = <0x0 0x400>;
96 };
97
98 eeprom_factory_8000: eeprom@8000 {
99 reg = <0x8000 0x4da8>;
100 };
101
102 macaddr_factory_e000: macaddr@e000 {
103 reg = <0xe000 0x6>;
104 };
105
106 macaddr_factory_e006: macaddr@e006 {
107 reg = <0xe006 0x6>;
108 };
109
110 };
111
112 firmware: partition@50000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 };
116 };
117 };
118 };
119
120 &pcie {
121 status = "okay";
122 };
123
124 &pcie0 {
125 wifi@0,0 {
126 compatible = "mediatek,mt76";
127 reg = <0x0000 0 0 0 0>;
128 nvmem-cells = <&eeprom_factory_0>;
129 nvmem-cell-names = "eeprom";
130 };
131 };
132
133 &pcie1 {
134 wifi@0,0 {
135 compatible = "mediatek,mt76";
136 reg = <0x0000 0 0 0 0>;
137 nvmem-cells = <&eeprom_factory_8000>;
138 nvmem-cell-names = "eeprom";
139 ieee80211-freq-limit = <5000000 6000000>;
140 };
141 };
142
143 &gmac0 {
144 nvmem-cells = <&macaddr_factory_e000>;
145 nvmem-cell-names = "mac-address";
146 };
147
148 &gmac1 {
149 status = "okay";
150 label = "wan";
151 phy-handle = <&ethphy4>;
152
153 nvmem-cells = <&macaddr_factory_e006>;
154 nvmem-cell-names = "mac-address";
155 };
156
157 &mdio {
158 ethphy4: ethernet-phy@4 {
159 reg = <4>;
160 };
161 };
162
163 &switch0 {
164 ports {
165 port@0 {
166 status = "okay";
167 label = "lan1";
168 };
169
170 port@1 {
171 status = "okay";
172 label = "lan2";
173 };
174
175 port@2 {
176 status = "okay";
177 label = "lan3";
178 };
179
180 port@3 {
181 status = "okay";
182 label = "lan4";
183 };
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "wdt", "uart2", "jtag";
190 function = "gpio";
191 };
192 };
193
194 &xhci_ehci_port1 {
195 #address-cells = <1>;
196 #size-cells = <0>;
197
198 hub_port2: port@2 {
199 reg = <2>;
200 #trigger-source-cells = <0>;
201 };
202
203 port@4 {
204 reg = <4>;
205 #trigger-source-cells = <0>;
206 };
207 };
208