ramips: mt7621: convert Linksys devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_linksys_ea7xxx.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
8 / {
9 aliases {
10 led-boot = &led_power;
11 led-failsafe = &led_power;
12 led-running = &led_power;
13 led-upgrade = &led_power;
14 };
15
16 chosen {
17 bootargs = "console=ttyS0,115200";
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 wps {
24 label = "wps";
25 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_WPS_BUTTON>;
27 };
28
29 reset {
30 label = "reset";
31 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_RESTART>;
33 };
34 };
35
36 leds {
37 compatible = "gpio-leds";
38
39 wan_green {
40 label = "green:wan";
41 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
42 };
43
44 lan1_green {
45 label = "green:lan1";
46 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
47 };
48
49 lan2_green {
50 label = "green:lan2";
51 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
52 };
53
54 lan3_green {
55 label = "green:lan3";
56 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
57 };
58
59 lan4_green {
60 label = "green:lan4";
61 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
62 };
63
64 led_power: power {
65 label = "white:power";
66 gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
67 };
68
69 wps {
70 label = "green:wps";
71 gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
72 };
73 };
74 };
75
76 &nand {
77 status = "okay";
78
79 mediatek,bbt;
80 mediatek,bmt-remap-range =
81 <0x180000 0x580000>,
82 <0x2980000 0x2d80000>;
83
84 partitions {
85 compatible = "fixed-partitions";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 partition@0 {
90 label = "boot";
91 reg = <0x0 0x80000>;
92 read-only;
93 };
94
95 partition@80000 {
96 label = "u_env";
97 reg = <0x80000 0x40000>;
98 };
99
100 factory: partition@c0000 {
101 label = "factory";
102 reg = <0xc0000 0x40000>;
103 read-only;
104
105 nvmem-layout {
106 compatible = "fixed-layout";
107 #address-cells = <1>;
108 #size-cells = <1>;
109
110 eeprom_factory_0: eeprom@0 {
111 reg = <0x0 0x4da8>;
112 };
113
114 eeprom_factory_8000: eeprom@8000 {
115 reg = <0x8000 0x4da8>;
116 };
117 };
118 };
119
120 partition@100000 {
121 label = "s_env";
122 reg = <0x100000 0x40000>;
123 };
124
125 partition@140000 {
126 label = "devinfo";
127 reg = <0x140000 0x40000>;
128 read-only;
129 };
130
131 partition@180000 {
132 label = "kernel";
133 reg = <0x180000 0x400000>;
134 };
135
136 partition@580000 {
137 label = "ubi";
138 reg = <0x580000 0x2400000>;
139 };
140
141 partition@2980000 {
142 label = "alt_kernel";
143 reg = <0x2980000 0x400000>;
144 read-only;
145 };
146
147 partition@2d80000 {
148 label = "alt_rootfs";
149 reg = <0x2d80000 0x2400000>;
150 read-only;
151 };
152
153 partition@5180000 {
154 label = "sysdiag";
155 reg = <0x5180000 0x100000>;
156 read-only;
157 };
158
159 partition@5280000 {
160 label = "syscfg";
161 reg = <0x5280000 0x2d00000>;
162 read-only;
163 };
164 };
165 };
166
167 &state_default {
168 gpio {
169 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
170 function = "gpio";
171 };
172 };
173
174 &pcie {
175 status = "okay";
176 };
177
178 &pcie0 {
179 mt76@0,0 {
180 compatible = "mediatek,mt76";
181 reg = <0x0000 0 0 0 0>;
182 nvmem-cells = <&eeprom_factory_0>;
183 nvmem-cell-names = "eeprom";
184 };
185 };
186
187 &pcie1 {
188 mt76@0,0 {
189 compatible = "mediatek,mt76";
190 reg = <0x0000 0 0 0 0>;
191 nvmem-cells = <&eeprom_factory_8000>;
192 nvmem-cell-names = "eeprom";
193 };
194 };
195
196 &gmac1 {
197 status = "okay";
198 label = "wan";
199 phy-handle = <&ethphy0>;
200 };
201
202 &mdio {
203 ethphy0: ethernet-phy@0 {
204 reg = <0>;
205 };
206 };
207
208 &switch0 {
209 ports {
210 port@1 {
211 status = "okay";
212 label = "lan1";
213 };
214
215 port@2 {
216 status = "okay";
217 label = "lan2";
218 };
219
220 port@3 {
221 status = "okay";
222 label = "lan3";
223 };
224
225 port@4 {
226 status = "okay";
227 label = "lan4";
228 };
229 };
230 };