ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / mt7621_jcg_q20.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 = "jcg,q20", "mediatek,mt7621-soc";
10 model = "JCG Q20";
11
12 aliases {
13 led-boot = &led_status_red;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_blue;
16 led-upgrade = &led_status_blue;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_red: status_red {
28 label = "red:status";
29 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
30 };
31
32 led_status_blue: status_blue {
33 label = "blue:status";
34 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
35 };
36 };
37
38 keys {
39 compatible = "gpio-keys";
40
41 reset {
42 label = "reset";
43 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
44 linux,code = <KEY_RESTART>;
45 };
46
47 wps {
48 label = "wps";
49 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_WPS_BUTTON>;
51 };
52 };
53
54 ubi-concat {
55 compatible = "mtd-concat";
56 devices = <&ubiconcat0 &ubiconcat1>;
57
58 partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "ubi";
65 reg = <0x0 0x5900000>;
66 };
67 };
68 };
69 };
70
71 &nand {
72 status = "okay";
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "Bootloader";
81 reg = <0x0 0x80000>;
82 read-only;
83 };
84
85 partition@80000 {
86 label = "Config";
87 reg = <0x80000 0x80000>;
88 };
89
90 factory: partition@100000 {
91 label = "Factory";
92 reg = <0x100000 0x80000>;
93 read-only;
94 };
95
96 partition@180000 {
97 label = "kernel";
98 reg = <0x180000 0x400000>;
99 };
100
101 ubiconcat0: partition@580000 {
102 label = "ubiconcat0";
103 reg = <0x580000 0x1c00000>;
104 };
105
106 partition@2180000 {
107 label = "firmware_backup";
108 reg = <0x2180000 0x2000000>;
109 };
110
111 partition@4180000 {
112 label = "rootfs_data_back";
113 reg = <0x4180000 0x80000>;
114 read-only;
115 };
116
117 partition@4200000 {
118 label = "nvram_config";
119 reg = <0x4200000 0x80000>;
120 read-only;
121 };
122
123 ubiconcat1: partition@4280000 {
124 label = "ubiconcat1";
125 reg = <0x4280000 0x3d00000>;
126 };
127
128 /*
129 * last 512 KiB are for the bad block table
130 */
131 };
132 };
133
134 &pcie {
135 status = "okay";
136 };
137
138 &pcie1 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 mediatek,mtd-eeprom = <&factory 0x0>;
143 };
144 };
145
146 &gmac0 {
147 nvmem-cells = <&macaddr_factory_3fff4>;
148 nvmem-cell-names = "mac-address";
149 };
150
151 &gmac1 {
152 status = "okay";
153 label = "wan";
154 phy-handle = <&ethphy0>;
155
156 nvmem-cells = <&macaddr_factory_3fffa>;
157 nvmem-cell-names = "mac-address";
158 };
159
160 &mdio {
161 ethphy0: ethernet-phy@0 {
162 reg = <0>;
163 };
164 };
165
166 &switch0 {
167 ports {
168 port@1 {
169 status = "okay";
170 label = "lan1";
171 };
172
173 port@4 {
174 status = "okay";
175 label = "lan2";
176 };
177 };
178 };
179
180 &state_default {
181 gpio {
182 groups = "jtag", "wdt";
183 function = "gpio";
184 };
185 };
186
187 &factory {
188 compatible = "nvmem-cells";
189 #address-cells = <1>;
190 #size-cells = <1>;
191
192 macaddr_factory_3fff4: macaddr@3fff4 {
193 reg = <0x3fff4 0x6>;
194 };
195
196 macaddr_factory_3fffa: macaddr@3fffa {
197 reg = <0x3fffa 0x6>;
198 };
199 };