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