ramips: use NVMEM cells with mt76 EEPROM for Netgear R6220 & WNDR3700 v5
[openwrt/staging/hauke.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 compatible = "nvmem-cells";
85
86 nvmem-layout {
87 compatible = "fixed-layout";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 macaddr_config_8014: macaddr@8014 {
92 compatible = "mac-base";
93 reg = <0x8014 0x11>;
94 #nvmem-cell-cells = <1>;
95 };
96
97 macaddr_config_8036: macaddr@8036 {
98 compatible = "mac-base";
99 reg = <0x8036 0x11>;
100 #nvmem-cell-cells = <1>;
101 };
102 };
103 };
104
105 factory: partition@100000 {
106 label = "Factory";
107 reg = <0x100000 0x40000>;
108 read-only;
109
110 compatible = "nvmem-cells";
111 #address-cells = <1>;
112 #size-cells = <1>;
113
114 macaddr_factory_4: macaddr@4 {
115 reg = <0x4 0x6>;
116 };
117 };
118
119 partition@140000 {
120 label = "kernel";
121 reg = <0x140000 0x400000>;
122 };
123
124 partition@540000 {
125 label = "ubi";
126 reg = <0x540000 0x7a40000>;
127 };
128 };
129 };
130
131 &pcie {
132 status = "okay";
133 };
134
135 &pcie0 {
136 wifi@0,0 {
137 compatible = "mediatek,mt76";
138 reg = <0x0000 0 0 0 0>;
139 mediatek,mtd-eeprom = <&factory 0x0>;
140 /* 5 GHz (phy1) does not take the address from calibration data,
141 but setting it manually here works */
142 nvmem-cells = <&macaddr_factory_4>;
143 nvmem-cell-names = "mac-address";
144 };
145 };
146
147 &gmac0 {
148 nvmem-cells = <&macaddr_config_8014 0>;
149 nvmem-cell-names = "mac-address";
150 };
151
152 &gmac1 {
153 status = "okay";
154 label = "wan";
155 phy-handle = <&ethphy4>;
156
157 nvmem-cells = <&macaddr_config_8036 0>;
158 nvmem-cell-names = "mac-address";
159 };
160
161 &mdio {
162 ethphy4: ethernet-phy@4 {
163 reg = <4>;
164 };
165 };
166
167 &switch0 {
168 ports {
169 port@0 {
170 status = "okay";
171 label = "lan4";
172 };
173
174 port@1 {
175 status = "okay";
176 label = "lan3";
177 };
178
179 port@2 {
180 status = "okay";
181 label = "lan2";
182 };
183
184 port@3 {
185 status = "okay";
186 label = "lan1";
187 };
188 };
189 };
190
191 &state_default {
192 gpio {
193 groups = "i2c", "jtag", "uart3", "wdt";
194 function = "gpio";
195 };
196 };