| 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 |
&pcie_rc0 { |
| 156 |
status = "okay"; |
| 157 |
}; |
| 158 |
|
| 159 |
&pcie_rc1 { |
| 160 |
status = "okay"; |
| 161 |
}; |
| 162 |
|
| 163 |
&pcie_rc2 { |
| 164 |
status = "okay"; |
| 165 |
}; |
| 166 |
|
| 167 |
&pinctrl { |
| 168 |
emmc_cfg: sdhci-emmc-cfg { |
| 169 |
sdhci-emmc-wp-pins { |
| 170 |
pinmux = <PINMUX(PIN_EMMC_WP, 0)>; |
| 171 |
bias-disable; |
| 172 |
drive-strength-microamp = <26800>; |
| 173 |
input-schmitt-disable; |
| 174 |
}; |
| 175 |
|
| 176 |
sdhci-emmc-cd-pins { |
| 177 |
pinmux = <PINMUX(PIN_EMMC_CD, 0)>; |
| 178 |
bias-pull-up; |
| 179 |
drive-strength-microamp = <26800>; |
| 180 |
input-schmitt-enable; |
| 181 |
}; |
| 182 |
|
| 183 |
sdhci-emmc-rst-pwr-pins { |
| 184 |
pinmux = <PINMUX(PIN_EMMC_RST, 0)>, |
| 185 |
<PINMUX(PIN_EMMC_PWR_EN, 0)>; |
| 186 |
bias-disable; |
| 187 |
drive-strength-microamp = <26800>; |
| 188 |
input-schmitt-disable; |
| 189 |
}; |
| 190 |
}; |
| 191 |
|
| 192 |
i2c1_cfg: i2c1-cfg { |
| 193 |
i2c1-pins { |
| 194 |
pinmux = <PINMUX(PIN_IIC1_SDA, 0)>, |
| 195 |
<PINMUX(PIN_IIC1_SCL, 0)>; |
| 196 |
bias-pull-up; |
| 197 |
drive-strength-microamp = <26800>; |
| 198 |
input-schmitt-enable; |
| 199 |
}; |
| 200 |
}; |
| 201 |
|
| 202 |
sd_cfg: sdhci-sd-cfg { |
| 203 |
sdhci-sd-cd-wp-pins { |
| 204 |
pinmux = <PINMUX(PIN_SDIO_CD, 0)>, |
| 205 |
<PINMUX(PIN_SDIO_WP, 0)>; |
| 206 |
bias-pull-up; |
| 207 |
drive-strength-microamp = <26800>; |
| 208 |
input-schmitt-enable; |
| 209 |
}; |
| 210 |
|
| 211 |
sdhci-sd-rst-pwr-pins { |
| 212 |
pinmux = <PINMUX(PIN_SDIO_RST, 0)>, |
| 213 |
<PINMUX(PIN_SDIO_PWR_EN, 0)>; |
| 214 |
bias-disable; |
| 215 |
drive-strength-microamp = <26800>; |
| 216 |
input-schmitt-disable; |
| 217 |
}; |
| 218 |
}; |
| 219 |
|
| 220 |
uart0_cfg: uart0-cfg { |
| 221 |
uart0-rx-pins { |
| 222 |
pinmux = <PINMUX(PIN_UART0_TX, 0)>, |
| 223 |
<PINMUX(PIN_UART0_RX, 0)>; |
| 224 |
bias-pull-up; |
| 225 |
drive-strength-microamp = <26800>; |
| 226 |
input-schmitt-enable; |
| 227 |
}; |
| 228 |
}; |
| 229 |
}; |
| 230 |
|
| 231 |
&sd { |
| 232 |
pinctrl-0 = <&sd_cfg>; |
| 233 |
pinctrl-names = "default"; |
| 234 |
bus-width = <4>; |
| 235 |
no-sdio; |
| 236 |
no-mmc; |
| 237 |
wp-inverted; |
| 238 |
status = "okay"; |
| 239 |
}; |
| 240 |
|
| 241 |
&spifmc1 { |
| 242 |
status = "okay"; |
| 243 |
|
| 244 |
flash@0 { |
| 245 |
compatible = "jedec,spi-nor"; |
| 246 |
reg = <0>; |
| 247 |
spi-max-frequency = <50000000>; |
| 248 |
spi-tx-bus-width = <1>; |
| 249 |
spi-rx-bus-width = <1>; |
| 250 |
}; |
| 251 |
}; |
| 252 |
|
| 253 |
&uart0 { |
| 254 |
pinctrl-0 = <&uart0_cfg>; |
| 255 |
pinctrl-names = "default"; |
| 256 |
status = "okay"; |
| 257 |
}; |