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