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