ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_raisecom_msg1500-x-00.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 = "raisecom,msg1500-x-00", "mediatek,mt7621-soc";
10 model = "RAISECOM MSG1500 X.00";
11
12 aliases {
13 led-boot = &led_usb;
14 led-failsafe = &led_usb;
15 led-upgrade = &led_usb;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 wlan2g {
22 label = "blue:wlan2g";
23 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
24 linux,default-trigger = "phy0radio";
25 };
26
27 wlan5g {
28 label = "blue:wlan5g";
29 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
30 linux,default-trigger = "phy1radio";
31 };
32
33 led_usb: usb {
34 label = "blue:usb";
35 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
36 trigger-sources = <&ehci_port2>;
37 linux,default-trigger = "usbport";
38 };
39 };
40
41 keys {
42 compatible = "gpio-keys";
43
44 reset {
45 label = "reset";
46 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
47 linux,code = <KEY_RESTART>;
48 };
49
50 wps {
51 label = "wps";
52 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_WPS_BUTTON>;
54 };
55
56 wifi {
57 label = "wifi";
58 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_RFKILL>;
60 };
61 };
62 };
63
64 &nand {
65 status = "okay";
66
67 partitions {
68 compatible = "fixed-partitions";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 partition@0 {
73 label = "Bootloader";
74 reg = <0x0 0x80000>;
75 read-only;
76 };
77
78 partition@80000 {
79 label = "Config";
80 reg = <0x80000 0x80000>;
81 read-only;
82 };
83
84 factory: partition@100000 {
85 label = "Factory";
86 reg = <0x100000 0x40000>;
87 read-only;
88 };
89
90 partition@140000 {
91 label = "kernel";
92 reg = <0x140000 0x400000>;
93 };
94
95 partition@540000 {
96 label = "ubi";
97 reg = <0x540000 0x7a40000>;
98 };
99 };
100 };
101
102 &pcie {
103 status = "okay";
104 };
105
106 &pcie0 {
107 wifi@0,0 {
108 compatible = "mediatek,mt76";
109 reg = <0x0000 0 0 0 0>;
110 mediatek,mtd-eeprom = <&factory 0x0>;
111 /* 5 GHz (phy1) does not take the address from calibration data,
112 but setting it manually here works */
113 nvmem-cells = <&macaddr_factory_4>;
114 nvmem-cell-names = "mac-address";
115 };
116 };
117
118 &gmac1 {
119 status = "okay";
120 label = "wan";
121 phy-handle = <&ethphy4>;
122 };
123
124 &mdio {
125 ethphy4: ethernet-phy@4 {
126 reg = <4>;
127 };
128 };
129
130 &switch0 {
131 ports {
132 port@0 {
133 status = "okay";
134 label = "lan4";
135 };
136
137 port@1 {
138 status = "okay";
139 label = "lan3";
140 };
141
142 port@2 {
143 status = "okay";
144 label = "lan2";
145 };
146
147 port@3 {
148 status = "okay";
149 label = "lan1";
150 };
151 };
152 };
153
154 &state_default {
155 gpio {
156 groups = "i2c", "jtag", "uart3", "wdt";
157 function = "gpio";
158 };
159 };
160
161 &factory {
162 compatible = "nvmem-cells";
163 #address-cells = <1>;
164 #size-cells = <1>;
165
166 macaddr_factory_4: macaddr@4 {
167 reg = <0x4 0x6>;
168 };
169 };