ramips: add support for read/write uboot env to Asus RX-AX53U
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_asus_rt-ax53u.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-ax53u", "mediatek,mt7621-soc";
11 model = "ASUS RT-AX53U";
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: led-0 {
30 color = <LED_COLOR_ID_BLUE>;
31 function = LED_FUNCTION_POWER;
32 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
33 };
34 };
35
36 keys {
37 compatible = "gpio-keys";
38
39 key-restart {
40 label = "reset";
41 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
42 linux,code = <KEY_RESTART>;
43 };
44
45 key-wps {
46 label = "wps";
47 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_WPS_BUTTON>;
49 };
50 };
51 };
52
53 &nand {
54 status = "okay";
55
56 partitions {
57 compatible = "fixed-partitions";
58 #address-cells = <1>;
59 #size-cells = <1>;
60
61 partition@0 {
62 label = "u-boot";
63 reg = <0x0 0x80000>;
64 read-only;
65 };
66
67 /*
68 * u-boot gets split here while keeping u-boot read-only,
69 * which allows safe usage of fw_setenv
70 */
71 partition@80000 {
72 label = "u-boot-env";
73 reg = <0x80000 0x60000>;
74 };
75
76 partition@e0000 {
77 label = "nvram";
78 reg = <0xe0000 0x100000>;
79 read-only;
80 };
81
82 factory: partition@1e0000 {
83 label = "factory";
84 reg = <0x1e0000 0x100000>;
85 read-only;
86
87 compatible = "nvmem-cells";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 macaddr_factory_4: macaddr@4 {
92 reg = <0x4 0x6>;
93 };
94 };
95
96 factory2: partition@2e0000 {
97 label = "factory2";
98 reg = <0x2e0000 0x100000>;
99 read-only;
100 };
101
102 partition@3e0000 {
103 label = "kernel";
104 reg = <0x3e0000 0x400000>;
105 };
106
107 partition@7e0000 {
108 label = "ubi";
109 reg = <0x7e0000 0x2e00000>;
110 };
111
112 partition@35e0000 {
113 label = "firmware2";
114 reg = <0x35e0000 0x3200000>;
115 };
116
117 /* Last 8M possibly store the bad block table */
118 };
119 };
120
121 &pcie {
122 status = "okay";
123 };
124
125 &pcie1 {
126 wifi@0,0 {
127 compatible = "mediatek,mt76";
128 reg = <0x0000 0 0 0 0>;
129 mediatek,mtd-eeprom = <&factory 0x0000>;
130 };
131 };
132
133 &gmac0 {
134 nvmem-cells = <&macaddr_factory_4>;
135 nvmem-cell-names = "mac-address";
136 };
137
138 &switch0 {
139 ports {
140 port@0 {
141 status = "okay";
142 label = "wan";
143 };
144
145 port@1 {
146 status = "okay";
147 label = "lan1";
148 };
149
150 port@2 {
151 status = "okay";
152 label = "lan2";
153 };
154
155 port@3 {
156 status = "okay";
157 label = "lan3";
158 };
159 };
160 };
161
162 &state_default {
163 gpio {
164 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
165 function = "gpio";
166 };
167 };
168