ramips: convert MT7610 and MT7612 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_afoundry_ew1200.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "afoundry,ew1200", "mediatek,mt7621-soc";
8 model = "EW1200";
9
10 aliases {
11 led-boot = &led_run;
12 led-failsafe = &led_run;
13 led-running = &led_run;
14 led-upgrade = &led_run;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "reset";
22 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25 };
26
27 leds {
28 compatible = "gpio-leds";
29
30 led_run: run {
31 label = "green:run";
32 gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
33 };
34
35 usb {
36 label = "green:usb";
37 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
38 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
39 linux,default-trigger = "usbport";
40 };
41 };
42 };
43
44 &sdhci {
45 status = "okay";
46 };
47
48 &spi0 {
49 status = "okay";
50
51 flash@0 {
52 compatible = "jedec,spi-nor";
53 reg = <0>;
54 spi-max-frequency = <10000000>;
55
56 partitions {
57 compatible = "fixed-partitions";
58 #address-cells = <1>;
59 #size-cells = <1>;
60
61 partition@0 {
62 label = "u-boot";
63 reg = <0x0 0x30000>;
64 read-only;
65 };
66
67 partition@30000 {
68 label = "u-boot-env";
69 reg = <0x30000 0x10000>;
70 read-only;
71 };
72
73 factory: partition@40000 {
74 compatible = "nvmem-cells";
75 label = "factory";
76 reg = <0x40000 0x10000>;
77 #address-cells = <1>;
78 #size-cells = <1>;
79 read-only;
80
81 eeprom_factory_0: eeprom@0 {
82 reg = <0x0 0x400>;
83 };
84
85 eeprom_factory_8000: eeprom@8000 {
86 reg = <0x8000 0x200>;
87 };
88
89 macaddr_factory_e000: macaddr@e000 {
90 reg = <0xe000 0x6>;
91 };
92 };
93
94 partition@50000 {
95 compatible = "denx,uimage";
96 label = "firmware";
97 reg = <0x50000 0xfb0000>;
98 };
99 };
100 };
101 };
102
103 &pcie {
104 status = "okay";
105 };
106
107 &pcie0 {
108 wifi@0,0 {
109 compatible = "mediatek,mt76";
110 reg = <0x0000 0 0 0 0>;
111 nvmem-cells = <&eeprom_factory_8000>;
112 nvmem-cell-names = "eeprom";
113 ieee80211-freq-limit = <5000000 6000000>;
114
115 led {
116 led-sources = <2>;
117 led-active-low;
118 };
119 };
120 };
121
122 &pcie1 {
123 wifi@0,0 {
124 compatible = "mediatek,mt76";
125 reg = <0x0000 0 0 0 0>;
126 nvmem-cells = <&eeprom_factory_0>;
127 nvmem-cell-names = "eeprom";
128 ieee80211-freq-limit = <2400000 2500000>;
129
130 led {
131 led-sources = <0>;
132 led-active-low;
133 };
134 };
135 };
136
137 &gmac0 {
138 nvmem-cells = <&macaddr_factory_e000>;
139 nvmem-cell-names = "mac-address";
140 };
141
142 &gmac1 {
143 status = "okay";
144 label = "wan";
145 phy-handle = <&ethphy4>;
146
147 nvmem-cells = <&macaddr_factory_e000>;
148 nvmem-cell-names = "mac-address";
149 mac-address-increment = <1>;
150 };
151
152 &mdio {
153 ethphy4: ethernet-phy@4 {
154 reg = <4>;
155 };
156 };
157
158 &switch0 {
159 ports {
160 port@0 {
161 status = "okay";
162 label = "lan1";
163 };
164
165 port@1 {
166 status = "okay";
167 label = "lan2";
168 };
169
170 port@2 {
171 status = "okay";
172 label = "lan3";
173 };
174
175 port@3 {
176 status = "okay";
177 label = "lan4";
178 };
179 };
180 };
181
182 &state_default {
183 gpio {
184 groups = "i2c", "uart3", "wdt";
185 function = "gpio";
186 };
187 };