mediatek: switch to fitblk for JDCloud RE-CP-03
[openwrt/openwrt.git] / target / linux / mediatek / dts / mt7986a-jdcloud-re-cp-03.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /*
3 * Copyright (C) 2023 Tianling Shen <cnsztl@immortalwrt.org>
4 */
5
6 /dts-v1/;
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/leds/common.h>
10
11 #include "mt7986a.dtsi"
12
13 / {
14 model = "JDCloud RE-CP-03";
15 compatible = "jdcloud,re-cp-03", "mediatek,mt7986a";
16
17 aliases {
18 led-boot = &red_led;
19 led-failsafe = &red_led;
20 led-running = &green_led;
21 led-upgrade = &green_led;
22 serial0 = &uart0;
23 };
24
25 chosen {
26 bootargs-override = "root=/dev/fit0 rootwait";
27 stdout-path = "serial0:115200n8";
28 rootdisk = <&emmc_rootdisk>;
29 };
30
31 memory@40000000 {
32 reg = <0 0x40000000 0 0x40000000>;
33 };
34
35 gpio-keys {
36 compatible = "gpio-keys";
37
38 button-joylink {
39 label = "joylink";
40 linux,code = <BTN_0>;
41 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
42 };
43
44 button-reset {
45 label = "reset";
46 linux,code = <KEY_RESTART>;
47 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
48 };
49 };
50
51 gpio-leds {
52 compatible = "gpio-leds";
53
54 led-0 {
55 color = <LED_COLOR_ID_BLUE>;
56 function = LED_FUNCTION_STATUS;
57 gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
58 };
59
60 red_led: led-1 {
61 color = <LED_COLOR_ID_RED>;
62 function = LED_FUNCTION_STATUS;
63 gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
64 };
65
66 green_led: led-2 {
67 color = <LED_COLOR_ID_GREEN>;
68 function = LED_FUNCTION_STATUS;
69 gpios = <&pio 12 GPIO_ACTIVE_LOW>;
70 };
71 };
72
73 reg_1p8v: regulator-1p8v {
74 compatible = "regulator-fixed";
75 regulator-name = "fixed-1.8V";
76 regulator-min-microvolt = <1800000>;
77 regulator-max-microvolt = <1800000>;
78 regulator-boot-on;
79 regulator-always-on;
80 };
81
82 reg_3p3v: regulator-3p3v {
83 compatible = "regulator-fixed";
84 regulator-name = "fixed-3.3V";
85 regulator-min-microvolt = <3300000>;
86 regulator-max-microvolt = <3300000>;
87 regulator-boot-on;
88 regulator-always-on;
89 };
90 };
91
92 &crypto {
93 status = "okay";
94 };
95
96 &eth {
97 status = "okay";
98
99 gmac0: mac@0 {
100 compatible = "mediatek,eth-mac";
101 reg = <0>;
102 phy-mode = "2500base-x";
103
104 fixed-link {
105 speed = <2500>;
106 full-duplex;
107 pause;
108 };
109 };
110
111 gmac1: mac@1 {
112 compatible = "mediatek,eth-mac";
113 reg = <1>;
114 phy-mode = "2500base-x";
115 phy-handle = <&phy6>;
116 };
117
118 mdio: mdio-bus {
119 #address-cells = <1>;
120 #size-cells = <0>;
121 };
122 };
123
124 &mdio {
125 phy6: phy@6 {
126 compatible = "ethernet-phy-ieee802.3-c45";
127 reg = <6>;
128
129 reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
130 reset-assert-us = <10000>;
131 reset-deassert-us = <50000>;
132 realtek,aldps-enable;
133 };
134
135 switch: switch@1f {
136 compatible = "mediatek,mt7531";
137 reg = <31>;
138 reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
139 interrupt-controller;
140 #interrupt-cells = <1>;
141 interrupt-parent = <&pio>;
142 interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
143 };
144 };
145
146 &mmc0 {
147 bus-width = <8>;
148 cap-mmc-highspeed;
149 hs400-ds-delay = <0x14014>;
150 max-frequency = <200000000>;
151 mmc-hs200-1_8v;
152 mmc-hs400-1_8v;
153 no-sd;
154 no-sdio;
155 non-removable;
156 pinctrl-names = "default", "state_uhs";
157 pinctrl-0 = <&mmc0_pins_default>;
158 pinctrl-1 = <&mmc0_pins_uhs>;
159 vmmc-supply = <&reg_3p3v>;
160 vqmmc-supply = <&reg_1p8v>;
161 status = "okay";
162
163 card@0 {
164 compatible = "mmc-card";
165 reg = <0>;
166
167 block {
168 compatible = "block-device";
169 partitions {
170 emmc_rootdisk: block-partition-production {
171 partname = "production";
172 };
173 };
174 };
175 };
176 };
177
178 &pio {
179 mmc0_pins_default: mmc0-pins-default {
180 mux {
181 function = "emmc";
182 groups = "emmc_51";
183 };
184 conf-cmd-dat {
185 pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
186 "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
187 "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
188 input-enable;
189 drive-strength = <4>;
190 mediatek,pull-up-adv = <1>;
191 };
192 conf-clk {
193 pins = "EMMC_CK";
194 drive-strength = <6>;
195 mediatek,pull-down-adv = <2>;
196 };
197 conf-ds {
198 pins = "EMMC_DSL";
199 mediatek,pull-down-adv = <2>;
200 };
201 conf-rst {
202 pins = "EMMC_RSTB";
203 drive-strength = <4>;
204 mediatek,pull-up-adv = <1>;
205 };
206 };
207
208 mmc0_pins_uhs: mmc0-uhs-pins {
209 mux {
210 function = "emmc";
211 groups = "emmc_51";
212 };
213 conf-cmd-dat {
214 pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
215 "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
216 "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
217 input-enable;
218 drive-strength = <4>;
219 mediatek,pull-up-adv = <1>;
220 };
221 conf-clk {
222 pins = "EMMC_CK";
223 drive-strength = <6>;
224 mediatek,pull-down-adv = <2>;
225 };
226 conf-ds {
227 pins = "EMMC_DSL";
228 mediatek,pull-down-adv = <2>;
229 };
230 conf-rst {
231 pins = "EMMC_RSTB";
232 drive-strength = <4>;
233 mediatek,pull-up-adv = <1>;
234 };
235 };
236
237 wf_2g_5g_pins: wf-2g-5g-pins {
238 mux {
239 function = "wifi";
240 groups = "wf_2g", "wf_5g";
241 };
242 conf {
243 pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
244 "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
245 "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
246 "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
247 "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
248 "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
249 "WF1_TOP_CLK", "WF1_TOP_DATA";
250 drive-strength = <4>;
251 };
252 };
253 };
254
255 &switch {
256 ports {
257 #address-cells = <1>;
258 #size-cells = <0>;
259
260 port@1 {
261 reg = <1>;
262 label = "lan1";
263 };
264
265 port@2 {
266 reg = <2>;
267 label = "lan2";
268 };
269
270 port@3 {
271 reg = <3>;
272 label = "lan3";
273 };
274
275 port@4 {
276 reg = <4>;
277 label = "lan4";
278 };
279
280 port@6 {
281 reg = <6>;
282 ethernet = <&gmac0>;
283 phy-mode = "2500base-x";
284
285 fixed-link {
286 speed = <2500>;
287 full-duplex;
288 pause;
289 };
290 };
291 };
292 };
293
294 &trng {
295 status = "okay";
296 };
297
298 &uart0 {
299 status = "okay";
300 };
301
302 &watchdog {
303 status = "okay";
304 };
305
306 &wifi {
307 pinctrl-names = "default";
308 pinctrl-0 = <&wf_2g_5g_pins>;
309 status = "okay";
310 };