1ef1f7fb31f08e6ef8c139d042266e8f0893a1d1
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_alfa-network_ax1800rm.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 = "alfa-network,ax1800rm", "mediatek,mt7621-soc";
11 model = "ALFA Network AX1800RM";
12
13 aliases {
14 label-mac-device = &wifi0;
15 led-boot = &led_power;
16 led-failsafe = &led_wan_red;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33
34 wps {
35 label = "wps";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_WPS_BUTTON>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 lan1 {
45 label = "green:lan1";
46 color = <LED_COLOR_ID_GREEN>;
47 function = LED_FUNCTION_LAN;
48 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
49 };
50
51 lan2 {
52 label = "green:lan2";
53 color = <LED_COLOR_ID_GREEN>;
54 function = LED_FUNCTION_LAN;
55 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
56 };
57
58 lan3 {
59 label = "green:lan3";
60 color = <LED_COLOR_ID_GREEN>;
61 function = LED_FUNCTION_LAN;
62 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
63 };
64
65 led_power: power {
66 label = "green:power";
67 color = <LED_COLOR_ID_GREEN>;
68 function = LED_FUNCTION_POWER;
69 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
70 };
71
72 wan_green {
73 label = "green:wan";
74 color = <LED_COLOR_ID_GREEN>;
75 function = LED_FUNCTION_WAN;
76 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
77 };
78
79 led_wan_red: wan_red {
80 label = "red:wan";
81 color = <LED_COLOR_ID_RED>;
82 function = LED_FUNCTION_WAN;
83 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
84 };
85 };
86 };
87
88 &spi0 {
89 status = "okay";
90
91 flash@0 {
92 compatible = "jedec,spi-nor";
93 reg = <0>;
94 spi-max-frequency = <50000000>;
95 m25p,fast-read;
96
97 partitions {
98 compatible = "fixed-partitions";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 partition@0 {
103 label = "u-boot";
104 reg = <0x0 0x30000>;
105 read-only;
106 };
107
108 partition@30000 {
109 label = "u-boot-env";
110 reg = <0x30000 0x10000>;
111 };
112
113 partition@40000 {
114 label = "boot-config";
115 reg = <0x40000 0x10000>;
116 read-only;
117 };
118
119 partition@50000 {
120 compatible = "nvmem-cells";
121 label = "factory";
122 reg = <0x50000 0x10000>;
123 read-only;
124
125 nvmem-layout {
126 compatible = "fixed-layout";
127 #address-cells = <1>;
128 #size-cells = <1>;
129
130 eeprom: eeprom@0 {
131 reg = <0x0 0xe00>;
132 };
133
134 macaddr: macaddr@4 {
135 compatible = "mac-base";
136 reg = <0x4 0x6>;
137 #nvmem-cell-cells = <1>;
138 };
139 };
140 };
141
142 partition@60000 {
143 label = "permanent_config";
144 reg = <0x60000 0x80000>;
145 read-only;
146 };
147
148 partition@e0000 {
149 compatible = "denx,fit";
150 label = "firmware";
151 reg = <0xe0000 0xf20000>;
152 };
153 };
154 };
155 };
156
157 &pcie {
158 status = "okay";
159 };
160
161 &pcie1 {
162 wifi0: wifi@0,0 {
163 compatible = "mediatek,mt76";
164 reg = <0x0000 0 0 0 0>;
165
166 nvmem-cells = <&eeprom>;
167 nvmem-cell-names = "eeprom";
168 mediatek,disable-radar-background;
169 };
170 };
171
172 &gmac0 {
173 nvmem-cells = <&macaddr 2>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &gmac1 {
178 status = "okay";
179 label = "wan";
180 phy-handle = <&ethphy4>;
181
182 nvmem-cells = <&macaddr 3>;
183 nvmem-cell-names = "mac-address";
184 };
185
186 &mdio {
187 ethphy4: ethernet-phy@4 {
188 reg = <4>;
189 };
190 };
191
192 &switch0 {
193 ports {
194 port@0 {
195 status = "okay";
196 label = "lan1";
197 };
198
199 port@1 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@2 {
205 status = "okay";
206 label = "lan3";
207 };
208 };
209 };
210
211 &state_default {
212 gpio {
213 groups = "i2c", "jtag", "uart3", "wdt";
214 function = "gpio";
215 };
216 };