ramips: add support for ASUS RT-AX54
[openwrt/staging/aparcar.git] / target / linux / ramips / dts / mt7621_asus_rt-ax54.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "asus,rt-ax54", "mediatek,mt7621-soc";
11 model = "ASUS RT-AX54";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 bootargs-override = "console=ttyS0,115200";
24 };
25
26 leds {
27 compatible = "gpio-leds";
28
29 led_power: power {
30 label = "blue:power";
31 color = <LED_COLOR_ID_BLUE>;
32 function = LED_FUNCTION_POWER;
33 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
34 };
35
36 };
37
38 keys {
39 compatible = "gpio-keys";
40
41 key-restart {
42 label = "reset";
43 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
44 linux,code = <KEY_RESTART>;
45 };
46
47 key-wps {
48 label = "wps";
49 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_WPS_BUTTON>;
51 };
52 };
53 };
54
55 &nand {
56 status = "okay";
57
58 mediatek,nmbm;
59 mediatek,bmt-max-ratio = <1>;
60 mediatek,bmt-max-reserved-blocks = <64>;
61 mediatek,bmt-remap-range = <0x000000 0x7e0000>;
62
63 partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "u-boot";
70 reg = <0x0 0x80000>;
71 read-only;
72 };
73
74 /*
75 * u-boot gets split here while keeping u-boot read-only,
76 * which allows safe usage of fw_setenv
77 */
78 partition@80000 {
79 label = "u-boot-env";
80 reg = <0x80000 0x60000>;
81 };
82
83 partition@e0000 {
84 label = "nvram";
85 reg = <0xe0000 0x100000>;
86 read-only;
87 };
88
89 factory: partition@1e0000 {
90 label = "factory";
91 reg = <0x1e0000 0x100000>;
92 read-only;
93
94 compatible = "nvmem-cells";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 macaddr_factory_4: macaddr@4 {
99 reg = <0x4 0x6>;
100 };
101 };
102
103 factory2: partition@2e0000 {
104 label = "factory2";
105 reg = <0x2e0000 0x100000>;
106 read-only;
107 };
108
109 partition@3e0000 {
110 label = "kernel";
111 reg = <0x3e0000 0x400000>;
112 };
113
114 partition@7e0000 {
115 label = "ubi";
116 reg = <0x7e0000 0x7020000>;
117 };
118
119 /* Last 8M are reserved for NMBM management (bad blocks) */
120 };
121 };
122
123 &pcie {
124 status = "okay";
125 };
126
127 &pcie1 {
128 wifi@0,0 {
129 compatible = "mediatek,mt76";
130 reg = <0x0000 0 0 0 0>;
131 mediatek,mtd-eeprom = <&factory 0x0000>;
132 mediatek,disable-radar-background;
133 };
134 };
135
136 &gmac0 {
137 nvmem-cells = <&macaddr_factory_4>;
138 nvmem-cell-names = "mac-address";
139 };
140
141 &gmac1 {
142 status = "okay";
143 label = "wan";
144 phy-handle = <&ethphy4>;
145
146 nvmem-cells = <&macaddr_factory_4>;
147 nvmem-cell-names = "mac-address";
148 };
149
150 &mdio {
151 ethphy4: ethernet-phy@4 {
152 reg = <4>;
153 };
154 };
155
156 &switch0 {
157 ports {
158 port@0 {
159 status = "okay";
160 label = "lan4";
161 };
162
163 port@1 {
164 status = "okay";
165 label = "lan3";
166 };
167
168 port@2 {
169 status = "okay";
170 label = "lan2";
171 };
172
173 port@3 {
174 status = "okay";
175 label = "lan1";
176 };
177 };
178 };
179
180 &state_default {
181 gpio {
182 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
183 function = "gpio";
184 };
185 };
186