Skip to content

Commit 404d3d0

Browse files
committed
UPSTREAM: riscv: dts: sophgo: add Sophgo SG2042_EVB_V2.0 board device tree
Sophgo SG2042_EVB_V2.0 [1] is a prototype development board based on SG2042 Currently supports serial port, sdcard/emmc, pwm, fan speed control. Link: https://github.com/sophgo/sophgo-hardware/tree/master/SG2042/SG2042-x4-EVB [1] Signed-off-by: Han Gao <[email protected]> Reviewed-by: Nutty Liu <[email protected]> Reviewed-by: Chen Wang <[email protected]> Link: https://lore.kernel.org/r/c1b6ccdc69af0c1457fc1486a6bc8a1e83671537.1751700954.git.rabenda.cn@gmail.com Signed-off-by: Inochi Amaoto <[email protected]> Signed-off-by: Chen Wang <[email protected]> Signed-off-by: Chen Wang <[email protected]> (cherry picked from commit 6ea2a06) Signed-off-by: Han Gao <[email protected]>
1 parent f5a57cd commit 404d3d0

File tree

2 files changed

+234
-0
lines changed

2 files changed

+234
-0
lines changed

arch/riscv/boot/dts/sophgo/Makefile

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

0 commit comments

Comments
 (0)