ramips: mt7621: convert Linksys devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_raisecom_msg1500-x-00.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 = "raisecom,msg1500-x-00", "mediatek,mt7621-soc";
10 model = "RAISECOM MSG1500 X.00";
11
12 aliases {
13 led-boot = &led_usb;
14 led-failsafe = &led_usb;
15 led-upgrade = &led_usb;
16 label-mac-device = &gmac0;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 wlan2g {
23 label = "blue:wlan2g";
24 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
25 linux,default-trigger = "phy0radio";
26 };
27
28 wlan5g {
29 label = "blue:wlan5g";
30 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
31 linux,default-trigger = "phy1radio";
32 };
33
34 led_usb: usb {
35 label = "blue:usb";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 trigger-sources = <&ehci_port2>;
38 linux,default-trigger = "usbport";
39 };
40 };
41
42 keys {
43 compatible = "gpio-keys";
44
45 reset {
46 label = "reset";
47 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_RESTART>;
49 };
50
51 wps {
52 label = "wps";
53 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_WPS_BUTTON>;
55 };
56
57 wifi {
58 label = "wifi";
59 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
60 linux,code = <KEY_RFKILL>;
61 };
62 };
63 };
64
65 &nand {
66 status = "okay";
67
68 partitions {
69 compatible = "fixed-partitions";
70 #address-cells = <1>;
71 #size-cells = <1>;
72
73 partition@0 {
74 label = "Bootloader";
75 reg = <0x0 0x80000>;
76 read-only;
77 };
78
79 partition@80000 {
80 label = "Config";
81 reg = <0x80000 0x80000>;
82 read-only;
83
84 nvmem-layout {
85 compatible = "fixed-layout";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 macaddr_config_8014: macaddr@8014 {
90 compatible = "mac-base";
91 reg = <0x8014 0x11>;
92 #nvmem-cell-cells = <1>;
93 };
94
95 macaddr_config_8036: macaddr@8036 {
96 compatible = "mac-base";
97 reg = <0x8036 0x11>;
98 #nvmem-cell-cells = <1>;
99 };
100 };
101 };
102
103 factory: partition@100000 {
104 label = "Factory";
105 reg = <0x100000 0x40000>;
106 read-only;
107
108 nvmem-layout {
109 compatible = "fixed-layout";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 eeprom_factory_0: eeprom@0 {
114 reg = <0x0 0x4da8>;
115 };
116
117 macaddr_factory_4: macaddr@4 {
118 reg = <0x4 0x6>;
119 };
120 };
121 };
122
123 partition@140000 {
124 label = "kernel";
125 reg = <0x140000 0x400000>;
126 };
127
128 partition@540000 {
129 label = "ubi";
130 reg = <0x540000 0x7a40000>;
131 };
132 };
133 };
134
135 &pcie {
136 status = "okay";
137 };
138
139 &pcie0 {
140 wifi@0,0 {
141 compatible = "mediatek,mt76";
142 reg = <0x0000 0 0 0 0>;
143 /* 5 GHz (phy1) does not take the address from calibration data,
144 but setting it manually here works */
145 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>;
146 nvmem-cell-names = "eeprom", "mac-address";
147 };
148 };
149
150 &gmac0 {
151 nvmem-cells = <&macaddr_config_8014 0>;
152 nvmem-cell-names = "mac-address";
153 };
154
155 &gmac1 {
156 status = "okay";
157 label = "wan";
158 phy-handle = <&ethphy4>;
159
160 nvmem-cells = <&macaddr_config_8036 0>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &mdio {
165 ethphy4: ethernet-phy@4 {
166 reg = <4>;
167 };
168 };
169
170 &switch0 {
171 ports {
172 port@0 {
173 status = "okay";
174 label = "lan4";
175 };
176
177 port@1 {
178 status = "okay";
179 label = "lan3";
180 };
181
182 port@2 {
183 status = "okay";
184 label = "lan2";
185 };
186
187 port@3 {
188 status = "okay";
189 label = "lan1";
190 };
191 };
192 };
193
194 &state_default {
195 gpio {
196 groups = "i2c", "jtag", "uart3", "wdt";
197 function = "gpio";
198 };
199 };