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