xref: /freebsd/sys/contrib/device-tree/src/riscv/sophgo/sg2042-evb-v2.dts (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0 OR MIT
2*833e5d42SEmmanuel Vadot/*
3*833e5d42SEmmanuel Vadot * Copyright (C) 2025 Sophgo Technology Inc. All rights reserved.
4*833e5d42SEmmanuel Vadot */
5*833e5d42SEmmanuel Vadot
6*833e5d42SEmmanuel Vadot#include "sg2042.dtsi"
7*833e5d42SEmmanuel Vadot
8*833e5d42SEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
9*833e5d42SEmmanuel Vadot#include <dt-bindings/input/input.h>
10*833e5d42SEmmanuel Vadot
11*833e5d42SEmmanuel Vadot/ {
12*833e5d42SEmmanuel Vadot	model = "Sophgo SG2042 EVB V2.0";
13*833e5d42SEmmanuel Vadot	compatible = "sophgo,sg2042-evb-v2", "sophgo,sg2042";
14*833e5d42SEmmanuel Vadot
15*833e5d42SEmmanuel Vadot	chosen {
16*833e5d42SEmmanuel Vadot		stdout-path = "serial0";
17*833e5d42SEmmanuel Vadot	};
18*833e5d42SEmmanuel Vadot
19*833e5d42SEmmanuel Vadot	pwmfan: pwm-fan {
20*833e5d42SEmmanuel Vadot		compatible = "pwm-fan";
21*833e5d42SEmmanuel Vadot		cooling-levels = <103 128 179 230 255>;
22*833e5d42SEmmanuel Vadot		pwms = <&pwm 0 40000 0>;
23*833e5d42SEmmanuel Vadot		#cooling-cells = <2>;
24*833e5d42SEmmanuel Vadot	};
25*833e5d42SEmmanuel Vadot
26*833e5d42SEmmanuel Vadot	thermal-zones {
27*833e5d42SEmmanuel Vadot		soc-thermal {
28*833e5d42SEmmanuel Vadot			polling-delay-passive = <1000>;
29*833e5d42SEmmanuel Vadot			polling-delay = <1000>;
30*833e5d42SEmmanuel Vadot			thermal-sensors = <&mcu 0>;
31*833e5d42SEmmanuel Vadot
32*833e5d42SEmmanuel Vadot			trips {
33*833e5d42SEmmanuel Vadot				soc_active1: soc-active1 {
34*833e5d42SEmmanuel Vadot					temperature = <30000>;
35*833e5d42SEmmanuel Vadot					hysteresis = <8000>;
36*833e5d42SEmmanuel Vadot					type = "active";
37*833e5d42SEmmanuel Vadot				};
38*833e5d42SEmmanuel Vadot
39*833e5d42SEmmanuel Vadot				soc_active2: soc-active2 {
40*833e5d42SEmmanuel Vadot					temperature = <58000>;
41*833e5d42SEmmanuel Vadot					hysteresis = <12000>;
42*833e5d42SEmmanuel Vadot					type = "active";
43*833e5d42SEmmanuel Vadot				};
44*833e5d42SEmmanuel Vadot
45*833e5d42SEmmanuel Vadot				soc_active3: soc-active3 {
46*833e5d42SEmmanuel Vadot					temperature = <70000>;
47*833e5d42SEmmanuel Vadot					hysteresis = <10000>;
48*833e5d42SEmmanuel Vadot					type = "active";
49*833e5d42SEmmanuel Vadot				};
50*833e5d42SEmmanuel Vadot
51*833e5d42SEmmanuel Vadot				soc_hot: soc-hot {
52*833e5d42SEmmanuel Vadot					temperature = <80000>;
53*833e5d42SEmmanuel Vadot					hysteresis = <5000>;
54*833e5d42SEmmanuel Vadot					type = "hot";
55*833e5d42SEmmanuel Vadot				};
56*833e5d42SEmmanuel Vadot			};
57*833e5d42SEmmanuel Vadot
58*833e5d42SEmmanuel Vadot			cooling-maps {
59*833e5d42SEmmanuel Vadot				map0 {
60*833e5d42SEmmanuel Vadot					trip = <&soc_active1>;
61*833e5d42SEmmanuel Vadot					cooling-device = <&pwmfan 0 1>;
62*833e5d42SEmmanuel Vadot				};
63*833e5d42SEmmanuel Vadot
64*833e5d42SEmmanuel Vadot				map1 {
65*833e5d42SEmmanuel Vadot					trip = <&soc_active2>;
66*833e5d42SEmmanuel Vadot					cooling-device = <&pwmfan 1 2>;
67*833e5d42SEmmanuel Vadot				};
68*833e5d42SEmmanuel Vadot
69*833e5d42SEmmanuel Vadot				map2 {
70*833e5d42SEmmanuel Vadot					trip = <&soc_active3>;
71*833e5d42SEmmanuel Vadot					cooling-device = <&pwmfan 2 3>;
72*833e5d42SEmmanuel Vadot				};
73*833e5d42SEmmanuel Vadot
74*833e5d42SEmmanuel Vadot				map3 {
75*833e5d42SEmmanuel Vadot					trip = <&soc_hot>;
76*833e5d42SEmmanuel Vadot					cooling-device = <&pwmfan 3 4>;
77*833e5d42SEmmanuel Vadot				};
78*833e5d42SEmmanuel Vadot			};
79*833e5d42SEmmanuel Vadot		};
80*833e5d42SEmmanuel Vadot
81*833e5d42SEmmanuel Vadot		board-thermal {
82*833e5d42SEmmanuel Vadot			polling-delay-passive = <1000>;
83*833e5d42SEmmanuel Vadot			polling-delay = <1000>;
84*833e5d42SEmmanuel Vadot			thermal-sensors = <&mcu 1>;
85*833e5d42SEmmanuel Vadot
86*833e5d42SEmmanuel Vadot			trips {
87*833e5d42SEmmanuel Vadot				board_active: board-active {
88*833e5d42SEmmanuel Vadot					temperature = <75000>;
89*833e5d42SEmmanuel Vadot					hysteresis = <8000>;
90*833e5d42SEmmanuel Vadot					type = "active";
91*833e5d42SEmmanuel Vadot				};
92*833e5d42SEmmanuel Vadot			};
93*833e5d42SEmmanuel Vadot
94*833e5d42SEmmanuel Vadot			cooling-maps {
95*833e5d42SEmmanuel Vadot				map4 {
96*833e5d42SEmmanuel Vadot					trip = <&board_active>;
97*833e5d42SEmmanuel Vadot					cooling-device = <&pwmfan 3 4>;
98*833e5d42SEmmanuel Vadot				};
99*833e5d42SEmmanuel Vadot			};
100*833e5d42SEmmanuel Vadot		};
101*833e5d42SEmmanuel Vadot	};
102*833e5d42SEmmanuel Vadot};
103*833e5d42SEmmanuel Vadot
104*833e5d42SEmmanuel Vadot&cgi_main {
105*833e5d42SEmmanuel Vadot	clock-frequency = <25000000>;
106*833e5d42SEmmanuel Vadot};
107*833e5d42SEmmanuel Vadot
108*833e5d42SEmmanuel Vadot&cgi_dpll0 {
109*833e5d42SEmmanuel Vadot	clock-frequency = <25000000>;
110*833e5d42SEmmanuel Vadot};
111*833e5d42SEmmanuel Vadot
112*833e5d42SEmmanuel Vadot&cgi_dpll1 {
113*833e5d42SEmmanuel Vadot	clock-frequency = <25000000>;
114*833e5d42SEmmanuel Vadot};
115*833e5d42SEmmanuel Vadot
116*833e5d42SEmmanuel Vadot&emmc {
117*833e5d42SEmmanuel Vadot	pinctrl-0 = <&emmc_cfg>;
118*833e5d42SEmmanuel Vadot	pinctrl-names = "default";
119*833e5d42SEmmanuel Vadot	bus-width = <4>;
120*833e5d42SEmmanuel Vadot	no-sdio;
121*833e5d42SEmmanuel Vadot	no-sd;
122*833e5d42SEmmanuel Vadot	non-removable;
123*833e5d42SEmmanuel Vadot	wp-inverted;
124*833e5d42SEmmanuel Vadot	status = "okay";
125*833e5d42SEmmanuel Vadot};
126*833e5d42SEmmanuel Vadot
127*833e5d42SEmmanuel Vadot&i2c1 {
128*833e5d42SEmmanuel Vadot	pinctrl-0 = <&i2c1_cfg>;
129*833e5d42SEmmanuel Vadot	pinctrl-names = "default";
130*833e5d42SEmmanuel Vadot	status = "okay";
131*833e5d42SEmmanuel Vadot
132*833e5d42SEmmanuel Vadot	mcu: syscon@17 {
133*833e5d42SEmmanuel Vadot		compatible = "sophgo,sg2042-hwmon-mcu";
134*833e5d42SEmmanuel Vadot		reg = <0x17>;
135*833e5d42SEmmanuel Vadot		#thermal-sensor-cells = <1>;
136*833e5d42SEmmanuel Vadot	};
137*833e5d42SEmmanuel Vadot};
138*833e5d42SEmmanuel Vadot
139*833e5d42SEmmanuel Vadot&gmac0 {
140*833e5d42SEmmanuel Vadot	phy-handle = <&phy0>;
141*833e5d42SEmmanuel Vadot	phy-mode = "rgmii-id";
142*833e5d42SEmmanuel Vadot	status = "okay";
143*833e5d42SEmmanuel Vadot
144*833e5d42SEmmanuel Vadot	mdio {
145*833e5d42SEmmanuel Vadot		phy0: phy@0 {
146*833e5d42SEmmanuel Vadot			compatible = "ethernet-phy-ieee802.3-c22";
147*833e5d42SEmmanuel Vadot			reg = <0>;
148*833e5d42SEmmanuel Vadot			reset-gpios = <&port0a 27 GPIO_ACTIVE_LOW>;
149*833e5d42SEmmanuel Vadot			reset-assert-us = <100000>;
150*833e5d42SEmmanuel Vadot			reset-deassert-us = <100000>;
151*833e5d42SEmmanuel Vadot		};
152*833e5d42SEmmanuel Vadot	};
153*833e5d42SEmmanuel Vadot};
154*833e5d42SEmmanuel Vadot
155*833e5d42SEmmanuel Vadot&pinctrl {
156*833e5d42SEmmanuel Vadot	emmc_cfg: sdhci-emmc-cfg {
157*833e5d42SEmmanuel Vadot		sdhci-emmc-wp-pins {
158*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_EMMC_WP, 0)>;
159*833e5d42SEmmanuel Vadot			bias-disable;
160*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
161*833e5d42SEmmanuel Vadot			input-schmitt-disable;
162*833e5d42SEmmanuel Vadot		};
163*833e5d42SEmmanuel Vadot
164*833e5d42SEmmanuel Vadot		sdhci-emmc-cd-pins {
165*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_EMMC_CD, 0)>;
166*833e5d42SEmmanuel Vadot			bias-pull-up;
167*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
168*833e5d42SEmmanuel Vadot			input-schmitt-enable;
169*833e5d42SEmmanuel Vadot		};
170*833e5d42SEmmanuel Vadot
171*833e5d42SEmmanuel Vadot		sdhci-emmc-rst-pwr-pins {
172*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_EMMC_RST, 0)>,
173*833e5d42SEmmanuel Vadot				 <PINMUX(PIN_EMMC_PWR_EN, 0)>;
174*833e5d42SEmmanuel Vadot			bias-disable;
175*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
176*833e5d42SEmmanuel Vadot			input-schmitt-disable;
177*833e5d42SEmmanuel Vadot		};
178*833e5d42SEmmanuel Vadot	};
179*833e5d42SEmmanuel Vadot
180*833e5d42SEmmanuel Vadot	i2c1_cfg: i2c1-cfg {
181*833e5d42SEmmanuel Vadot		i2c1-pins {
182*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_IIC1_SDA, 0)>,
183*833e5d42SEmmanuel Vadot				 <PINMUX(PIN_IIC1_SCL, 0)>;
184*833e5d42SEmmanuel Vadot			bias-pull-up;
185*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
186*833e5d42SEmmanuel Vadot			input-schmitt-enable;
187*833e5d42SEmmanuel Vadot		};
188*833e5d42SEmmanuel Vadot	};
189*833e5d42SEmmanuel Vadot
190*833e5d42SEmmanuel Vadot	sd_cfg: sdhci-sd-cfg {
191*833e5d42SEmmanuel Vadot		sdhci-sd-cd-wp-pins {
192*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_SDIO_CD, 0)>,
193*833e5d42SEmmanuel Vadot				 <PINMUX(PIN_SDIO_WP, 0)>;
194*833e5d42SEmmanuel Vadot			bias-pull-up;
195*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
196*833e5d42SEmmanuel Vadot			input-schmitt-enable;
197*833e5d42SEmmanuel Vadot		};
198*833e5d42SEmmanuel Vadot
199*833e5d42SEmmanuel Vadot		sdhci-sd-rst-pwr-pins {
200*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_SDIO_RST, 0)>,
201*833e5d42SEmmanuel Vadot				 <PINMUX(PIN_SDIO_PWR_EN, 0)>;
202*833e5d42SEmmanuel Vadot			bias-disable;
203*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
204*833e5d42SEmmanuel Vadot			input-schmitt-disable;
205*833e5d42SEmmanuel Vadot		};
206*833e5d42SEmmanuel Vadot	};
207*833e5d42SEmmanuel Vadot
208*833e5d42SEmmanuel Vadot	uart0_cfg: uart0-cfg {
209*833e5d42SEmmanuel Vadot		uart0-rx-pins {
210*833e5d42SEmmanuel Vadot			pinmux = <PINMUX(PIN_UART0_TX, 0)>,
211*833e5d42SEmmanuel Vadot				 <PINMUX(PIN_UART0_RX, 0)>;
212*833e5d42SEmmanuel Vadot			bias-pull-up;
213*833e5d42SEmmanuel Vadot			drive-strength-microamp = <26800>;
214*833e5d42SEmmanuel Vadot			input-schmitt-enable;
215*833e5d42SEmmanuel Vadot		};
216*833e5d42SEmmanuel Vadot	};
217*833e5d42SEmmanuel Vadot};
218*833e5d42SEmmanuel Vadot
219*833e5d42SEmmanuel Vadot&sd {
220*833e5d42SEmmanuel Vadot	pinctrl-0 = <&sd_cfg>;
221*833e5d42SEmmanuel Vadot	pinctrl-names = "default";
222*833e5d42SEmmanuel Vadot	bus-width = <4>;
223*833e5d42SEmmanuel Vadot	no-sdio;
224*833e5d42SEmmanuel Vadot	no-mmc;
225*833e5d42SEmmanuel Vadot	wp-inverted;
226*833e5d42SEmmanuel Vadot	status = "okay";
227*833e5d42SEmmanuel Vadot};
228*833e5d42SEmmanuel Vadot
229*833e5d42SEmmanuel Vadot&uart0 {
230*833e5d42SEmmanuel Vadot	pinctrl-0 = <&uart0_cfg>;
231*833e5d42SEmmanuel Vadot	pinctrl-names = "default";
232*833e5d42SEmmanuel Vadot	status = "okay";
233*833e5d42SEmmanuel Vadot};
234