ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
[openwrt/openwrt.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 color = <LED_COLOR_ID_GREEN>;
46 function = LED_FUNCTION_LAN;
47 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
48 };
49
50 lan2 {
51 color = <LED_COLOR_ID_GREEN>;
52 function = LED_FUNCTION_LAN;
53 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
54 };
55
56 lan3 {
57 color = <LED_COLOR_ID_GREEN>;
58 function = LED_FUNCTION_LAN;
59 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
60 };
61
62 led_power: power {
63 color = <LED_COLOR_ID_GREEN>;
64 function = LED_FUNCTION_POWER;
65 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
66 };
67
68 wan_green {
69 color = <LED_COLOR_ID_GREEN>;
70 function = LED_FUNCTION_WAN;
71 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
72 };
73
74 led_wan_red: wan_red {
75 color = <LED_COLOR_ID_RED>;
76 function = LED_FUNCTION_WAN;
77 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
78 };
79 };
80 };
81
82 &spi0 {
83 status = "okay";
84
85 flash@0 {
86 compatible = "jedec,spi-nor";
87 reg = <0>;
88 spi-max-frequency = <50000000>;
89 m25p,fast-read;
90
91 partitions {
92 compatible = "fixed-partitions";
93 #address-cells = <1>;
94 #size-cells = <1>;
95
96 partition@0 {
97 label = "u-boot";
98 reg = <0x0 0x30000>;
99 read-only;
100 };
101
102 partition@30000 {
103 label = "u-boot-env";
104 reg = <0x30000 0x10000>;
105 };
106
107 partition@40000 {
108 label = "boot-config";
109 reg = <0x40000 0x10000>;
110 read-only;
111 };
112
113 partition@50000 {
114 label = "factory";
115 reg = <0x50000 0x10000>;
116 read-only;
117
118 nvmem-layout {
119 compatible = "fixed-layout";
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 eeprom: eeprom@0 {
124 reg = <0x0 0xe00>;
125 };
126
127 macaddr: macaddr@4 {
128 compatible = "mac-base";
129 reg = <0x4 0x6>;
130 #nvmem-cell-cells = <1>;
131 };
132 };
133 };
134
135 partition@60000 {
136 label = "permanent_config";
137 reg = <0x60000 0x80000>;
138 read-only;
139 };
140
141 partition@e0000 {
142 compatible = "denx,fit";
143 label = "firmware";
144 reg = <0xe0000 0xf20000>;
145 };
146 };
147 };
148 };
149
150 &pcie {
151 status = "okay";
152 };
153
154 &pcie1 {
155 wifi0: wifi@0,0 {
156 compatible = "mediatek,mt76";
157 reg = <0x0000 0 0 0 0>;
158
159 nvmem-cells = <&eeprom>;
160 nvmem-cell-names = "eeprom";
161 mediatek,disable-radar-background;
162 };
163 };
164
165 &gmac0 {
166 nvmem-cells = <&macaddr 2>;
167 nvmem-cell-names = "mac-address";
168 };
169
170 &gmac1 {
171 status = "okay";
172 label = "wan";
173 phy-handle = <&ethphy4>;
174
175 nvmem-cells = <&macaddr 3>;
176 nvmem-cell-names = "mac-address";
177 };
178
179 &ethphy4 {
180 /delete-property/ interrupts;
181 };
182
183 &switch0 {
184 ports {
185 port@0 {
186 status = "okay";
187 label = "lan1";
188 };
189
190 port@1 {
191 status = "okay";
192 label = "lan2";
193 };
194
195 port@2 {
196 status = "okay";
197 label = "lan3";
198 };
199 };
200 };
201
202 &state_default {
203 gpio {
204 groups = "i2c", "jtag", "uart3", "wdt";
205 function = "gpio";
206 };
207 };