ramips: mt7621: convert Linksys devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_wavlink_wl-wn53xax.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_status_red;
11 led-failsafe = &led_status_red;
12 led-running = &led_status_blue;
13 led-upgrade = &led_status_red;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 reset {
20 label = "Reset Button";
21 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
22 linux,code = <KEY_RESTART>;
23 };
24
25 touch { /* RH6015C touch sensor -> GPIO 14 */
26 label = "Touch Button";
27 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
28 linux,code = <BTN_0>;
29 };
30
31 turbo {
32 label = "Turbo Button";
33 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
34 linux,code = <BTN_1>;
35 };
36
37 wps {
38 label = "WPS Button";
39 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
40 linux,code = <KEY_WPS_BUTTON>;
41 };
42 };
43
44 leds {
45 compatible = "gpio-leds";
46
47 led_status_blue: status_blue {
48 label = "blue:power";
49 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
50 };
51
52 led_status_red: status_red {
53 label = "red:power";
54 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
55 };
56
57 wifi2g {
58 label = "blue:wifi2g";
59 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
60 linux,default-trigger = "phy0tpt";
61 };
62 };
63 };
64
65 &i2c {
66 status = "okay";
67 };
68
69 &spi0 {
70 status = "okay";
71
72 flash@0 {
73 compatible = "jedec,spi-nor";
74 reg = <0>;
75 spi-max-frequency = <40000000>;
76
77 partitions {
78 compatible = "fixed-partitions";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 partition@0 {
83 label = "u-boot";
84 reg = <0x0 0x30000>;
85 read-only;
86 };
87
88 partition@30000 {
89 label = "config";
90 reg = <0x30000 0x10000>;
91 read-only;
92 };
93
94 factory: partition@40000 {
95 label = "factory";
96 reg = <0x40000 0x10000>;
97 read-only;
98
99 nvmem-layout {
100 compatible = "fixed-layout";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 eeprom_factory_0: eeprom@0 {
105 reg = <0x0 0x400>;
106 };
107
108 eeprom_factory_8000: eeprom@8000 {
109 reg = <0x8000 0x4da8>;
110 };
111
112 macaddr_factory_e000: macaddr@e000 {
113 reg = <0xe000 0x6>;
114 };
115
116 macaddr_factory_e006: macaddr@e006 {
117 reg = <0xe006 0x6>;
118 };
119 };
120 };
121
122 partition@50000 {
123 compatible = "denx,uimage";
124 label = "firmware";
125 reg = <0x50000 0xeb0000>;
126 };
127
128 partition@f00000 {
129 label = "vendor";
130 reg = <0xf00000 0x100000>;
131 read-only;
132 };
133 };
134 };
135 };
136
137 &pcie {
138 status = "okay";
139 };
140
141 &pcie0 {
142 wifi0: mt76@0,0 {
143 compatible = "mediatek,mt76";
144 reg = <0x0000 0 0 0 0>;
145 nvmem-cells = <&eeprom_factory_0>;
146 nvmem-cell-names = "eeprom";
147 };
148 };
149
150 &pcie1 {
151 wifi1: mt76@0,0 {
152 compatible = "mediatek,mt76";
153 reg = <0x0000 0 0 0 0>;
154 nvmem-cells = <&eeprom_factory_8000>;
155 nvmem-cell-names = "eeprom";
156 };
157 };
158
159 &ethernet {
160 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
161 };
162
163 &gmac0 {
164 nvmem-cells = <&macaddr_factory_e000>;
165 nvmem-cell-names = "mac-address";
166 };
167
168 &switch0 {
169 ports {
170 port0: port@0 {
171 status = "okay";
172 };
173
174 port1: port@1 {
175 status = "okay";
176 };
177
178 port2: port@2 {
179 status = "okay";
180 };
181
182 port3: port@3 {
183 status = "okay";
184 };
185
186 port@4 {
187 status = "okay";
188 label = "wan";
189 nvmem-cells = <&macaddr_factory_e006>;
190 nvmem-cell-names = "mac-address";
191 };
192 };
193 };
194
195 &state_default {
196 gpio {
197 groups = "rgmii2", "jtag", "wdt";
198 function = "gpio";
199 };
200 };
201
202 &uartlite2 {
203 status = "okay";
204 };