ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_m1800.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 = "cudy,m1800", "mediatek,mt7621-soc";
10 model = "Cudy M1800";
11
12 aliases {
13 led-boot = &led_internet_white;
14 led-failsafe = &led_internet_white;
15 led-running = &led_internet_white;
16 led-upgrade = &led_internet_white;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_internet_white: internet-white {
44 label = "white:internet";
45 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
46 };
47
48 internet-red {
49 label = "red:internet";
50 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
51 };
52 };
53 };
54
55 &gmac0 {
56 nvmem-cells = <&macaddr_bdinfo_de00 1>;
57 nvmem-cell-names = "mac-address";
58 };
59
60 &gmac1 {
61 status = "okay";
62 label = "lan";
63 phy-handle = <&ethphy4>;
64
65 nvmem-cells = <&macaddr_bdinfo_de00 0>;
66 nvmem-cell-names = "mac-address";
67 };
68
69 &ethphy4 {
70 /delete-property/ interrupts;
71 };
72
73 &pcie {
74 status = "okay";
75 };
76
77 &pcie0 {
78 wifi@0,0 {
79 compatible = "mediatek,mt76";
80 reg = <0x0000 0 0 0 0>;
81 nvmem-cells = <&eeprom_factory_0>;
82 nvmem-cell-names = "eeprom";
83 mediatek,disable-radar-background;
84 };
85 };
86
87 &spi0 {
88 status = "okay";
89
90 flash@0 {
91 compatible = "jedec,spi-nor";
92 reg = <0>;
93 spi-max-frequency = <50000000>;
94 m25p,fast-read;
95 broken-flash-reset;
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 read-only;
112 };
113
114 partition@40000 {
115 label = "factory";
116 reg = <0x40000 0x10000>;
117 read-only;
118
119 nvmem-layout {
120 compatible = "fixed-layout";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 eeprom_factory_0: eeprom@0 {
125 reg = <0x0 0xe00>;
126 };
127 };
128 };
129
130 partition@50000 {
131 compatible = "denx,uimage";
132 label = "firmware";
133 reg = <0x50000 0xfb0000>;
134 };
135
136 partition@1000000 {
137 label = "app";
138 reg = <0x1000000 0xfd0000>;
139 read-only;
140 };
141
142 partition@1fd0000 {
143 label = "debug";
144 reg = <0x1fd0000 0x10000>;
145 read-only;
146 };
147
148 partition@1fe0000 {
149 label = "backup";
150 reg = <0x1fe0000 0x10000>;
151 read-only;
152 };
153
154 partition@1ff0000 {
155 label = "bdinfo";
156 reg = <0x1ff0000 0x10000>;
157 read-only;
158
159 nvmem-layout {
160 compatible = "fixed-layout";
161 #address-cells = <1>;
162 #size-cells = <1>;
163
164 macaddr_bdinfo_de00: macaddr@de00 {
165 compatible = "mac-base";
166 reg = <0xde00 0x6>;
167 #nvmem-cell-cells = <1>;
168 };
169 };
170 };
171 };
172 };
173 };
174
175 &state_default {
176 gpio {
177 groups = "jtag", "uart3";
178 function = "gpio";
179 };
180 };
181
182 &switch0 {
183 ports {
184 port@3 {
185 status = "okay";
186 label = "wan";
187 };
188 };
189 };