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}; 234