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