63ab424b881c4a67bbddbf0673285eb654dbb2a5
[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 = &wan;
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 label = "factory";
109 reg = <0x40000 0x10000>;
110 read-only;
111 };
112
113 partition@50000 {
114 compatible = "denx,uimage";
115 label = "firmware";
116 reg = <0x50000 0xfb0000>;
117 };
118 };
119 };
120 };
121
122 &pcie {
123 status = "okay";
124 };
125
126 &pcie0 {
127 wifi@0,0 {
128 compatible = "mediatek,mt76";
129 reg = <0x0000 0 0 0 0>;
130 mediatek,mtd-eeprom = <&factory 0x8000>;
131 };
132 };
133
134 &pcie1 {
135 wifi@0,0 {
136 compatible = "mediatek,mt76";
137 reg = <0x0000 0 0 0 0>;
138 mediatek,mtd-eeprom = <&factory 0x0000>;
139 };
140 };
141
142 &gmac0 {
143 nvmem-cells = <&macaddr_factory_8004>;
144 nvmem-cell-names = "mac-address";
145 };
146
147 &switch0 {
148 ports {
149 port@0 {
150 status = "okay";
151 label = "lan4";
152 };
153
154 port@1 {
155 status = "okay";
156 label = "lan3";
157 };
158
159 port@2 {
160 status = "okay";
161 label = "lan2";
162 };
163
164 port@3 {
165 status = "okay";
166 label = "lan1";
167 };
168
169 wan: port@4 {
170 status = "okay";
171 label = "wan";
172 nvmem-cells = <&macaddr_factory_4>;
173 nvmem-cell-names = "mac-address";
174 };
175 };
176 };
177
178 &state_default {
179 gpio {
180 groups = "uart3", "uart2", "jtag", "wdt";
181 function = "gpio";
182 };
183 };
184
185 &factory {
186 compatible = "nvmem-cells";
187 #address-cells = <1>;
188 #size-cells = <1>;
189
190 macaddr_factory_4: macaddr@4 {
191 reg = <0x4 0x6>;
192 };
193
194 macaddr_factory_8004: macaddr@8004 {
195 reg = <0x8004 0x6>;
196 };
197 };