754 lines
14 KiB
Plaintext

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2024 StonedEdge and GinKage
*
*/
/dts-v1/;
#include "rk3588s-radxa-cm5.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
/ {
model = "RetrOLED CM5";
compatible = "retroled,cm5", "radxa,cm5", "rockchip,rk3588";
/delete-node/ chosen;
vcc12v_dcin: vcc12v-dcin {
compatible = "regulator-fixed";
regulator-name = "vcc12v_dcin";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <12000000>;
regulator-max-microvolt = <12000000>;
};
vcc5v0_sys: vcc5v0-sys {
compatible = "regulator-fixed";
regulator-name = "vcc5v0_sys";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&vcc12v_dcin>;
};
vcc_1v1_nldo_s3: vcc-1v1-nldo-s3 {
compatible = "regulator-fixed";
regulator-name = "vcc_1v1_nldo_s3";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
vin-supply = <&vcc5v0_sys>;
};
hdmi0_sound: hdmi0-sound {
status = "okay";
compatible = "rockchip,hdmi";
rockchip,mclk-fs = <128>;
rockchip,card-name = "rockchip-hdmi0";
rockchip,cpu = <&i2s5_8ch>;
rockchip,codec = <&hdmi0>;
rockchip,jack-det;
};
dp0_sound: dp0-sound {
status = "okay";
compatible = "rockchip,hdmi";
rockchip,card-name= "rockchip-hdmi1";
rockchip,mclk-fs = <512>;
rockchip,cpu = <&spdif_tx2>;
rockchip,codec = <&dp0 1>;
rockchip,jack-det;
};
vcc3v3_sys: vcc3v3-sys {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_sys";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
vin-supply = <&vcc12v_dcin>;
};
vcc3v3_pcie2x1l0: vcc3v3-pcie2x1l0 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie2x1l0";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
enable-active-high;
regulator-boot-on;
regulator-always-on;
gpios = <&gpio1 RK_PD3 GPIO_ACTIVE_HIGH>;
startup-delay-us = <50000>;
vin-supply = <&vcc5v0_sys>;
};
wifi_disable: wifi-diable-gpio-regulator {
compatible = "regulator-fixed";
regulator-name = "wifi_disable";
enable-active-high;
gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
regulator-always-on;
};
bt_wake: bt-wake-gpio-regulator {
compatible = "regulator-fixed";
regulator-name = "bt_wake";
enable-active-high;
gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
regulator-always-on;
};
fan0: pwm-fan {
compatible = "pwm-fan";
#cooling-cells = <2>;
cooling-levels = <15 55 95 135 175 215 255>;
pwms = <&pwm11 0 40000 0>;
};
wm8960_mclk: wm8960-mclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
};
wm8960_sound: wm8960-sound {
status = "okay";
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,name = "wm8960-soundcard";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Speaker", "Speaker",
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Speaker", "SPK_LP",
"Speaker", "SPK_LN",
"LINPUT1", "Mic Jack",
"LINPUT3", "Mic Jack",
"RINPUT1", "Mic Jack",
"RINPUT2", "Mic Jack";
pinctrl-0 = <&hp_det>;
pinctrl-names = "default";
simple-audio-card,hp-det-gpio = <&gpio1 RK_PB2 GPIO_ACTIVE_LOW>;
simple-audio-card,hp-pin-name = "Headphone Jack";
sac_cpu: simple-audio-card,cpu {
sound-dai = <&i2s1_8ch>;
};
sac_codec: simple-audio-card,codec {
sound-dai = <&wm8960>;
clocks = <&wm8960_mclk>;
clock-names = "mclk";
};
};
lcd_3v3: lcd-3v3 {
compatible = "regulator-fixed";
regulator-name = "lcd_3v3";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
vin-supply = <&vcc3v3_sys>;
};
bq24292i_charger: charger {
compatible = "gpio-charger";
charger-type = "usb-sdp";
gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_LOW>;
charge-status-gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&bq24292i_gpio>;
};
gpio_keys: gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&volume_keys>;
key-vol-down {
label = "volume down";
linux,code = <KEY_VOLUMEDOWN>;
gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_LOW>;
};
key-vol-up {
label = "volume up";
linux,code = <KEY_VOLUMEUP>;
gpios = <&gpio1 RK_PB1 GPIO_ACTIVE_LOW>;
};
key-power {
label = "lid";
linux,code = <SW_LID>;
linux,input-type = <EV_SW>;
gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
};
};
gpio_poweroff: gpio-poweroff {
compatible = "gpio-poweroff";
pinctrl-names = "default";
pinctrl-0 = <&poweroff_gpio>;
gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
};
};
&i2c6 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c6m3_xfer>;
hym8563: hym8563@51 {
compatible = "haoyu,hym8563";
reg = <0x51>;
#clock-cells = <0>;
clock-frequency = <32768>;
clock-output-names = "hym8563";
pinctrl-names = "default";
pinctrl-0 = <&rtc_int>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
};
};
&usbdp_phy0 {
status = "okay";
rockchip,dp-lane-mux = <0 1 3 2>;
};
&dp0 {
// force-hpd;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&dp0_hpd>;
hpd-gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
};
&dp0_in_vp2 {
status = "okay";
};
&route_dp0 {
status = "okay";
connect = <&vp2_out_dp0>;
};
&i2c7 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c7m2_xfer>;
#address-cells = <1>;
#size-cells = <0>;
wm8960: wm8960@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
#sound-dai-cells = <0>;
AVDD-supply = <&vcc5v0_sys>;
DVDD-supply = <&vcc_3v3_s3>;
};
battery: battery@36 {
compatible = "maxim,max17055";
reg = <0x36>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PC4 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&fuel_gauge>;
power-supplies = <&bq24292i_charger>;
maxim,rsns-microohm = <10000>;
maxim,over-heat-temp = <800>;
maxim,dead-volt = <3100>;
maxim,over-volt = <4300>;
};
};
&i2c8 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c8m2_xfer>;
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
gt9886: gt9886@5d {
status = "okay";
compatible = "goodix,gt9886";
reg = <0x5d>;
pinctrl-names = "default";
pinctrl-0 = <&gtx8_gpio>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
goodix,irq-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
goodix,reset-gpio = <&gpio1 RK_PB4 GPIO_ACTIVE_HIGH>;
goodix,irq-flags = <2>; /* 1:trigger rising, 2:trigger falling;*/
goodix,panel-max-x = <1080>;
goodix,panel-max-y = <1920>;
goodix,panel-max-w = <255>;
};
};
&i2s1_8ch {
status = "okay";
rockchip,playback-channels = <2>;
rockchip,capture-channels = <2>;
rockchip,i2s-tx-route = <1 0 2 3>;
rockchip,i2s-rx-route = <0 1 2 3>;
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&i2s1m0_sclk
&i2s1m0_lrck
&i2s1m0_sdi0
&i2s1m0_sdo1>;
};
&pwm11 {
status = "okay";
pinctrl-0 = <&pwm11m3_pins>;
};
&threshold {
temperature = <50000>;
};
&soc_thermal {
sustainable-power = <5000>; /* milliwatts */
polling-delay = <1000>;
polling-delay-passive = <2000>;
trips {
trip0: trip-point@0 {
temperature = <55000>;
hysteresis = <5000>;
type = "active";
};
trip1: trip-point@1 {
temperature = <60000>;
hysteresis = <5000>;
type = "active";
};
trip2: trip-point@2 {
temperature = <65000>;
hysteresis = <5000>;
type = "active";
};
trip3: trip-point@3 {
temperature = <70000>;
hysteresis = <5000>;
type = "active";
};
trip4: trip-point@4 {
temperature = <75000>;
hysteresis = <5000>;
type = "active";
};
pcritical: trip-point@5 {
temperature = <80000>;
hysteresis = <5000>;
type = "active";
};
};
cooling-maps {
map0 {
trip = <&trip0>;
cooling-device = <&fan0 0 1>;
contribution = <1024>;
};
map1 {
trip = <&trip1>;
cooling-device = <&fan0 1 2>;
contribution = <1024>;
};
map2 {
trip = <&trip2>;
cooling-device = <&fan0 2 3>;
contribution = <1024>;
};
map3 {
trip = <&trip3>;
cooling-device = <&fan0 3 4>;
contribution = <1024>;
};
map4 {
trip = <&trip4>;
cooling-device = <&fan0 4 5>;
contribution = <1024>;
};
map5 {
trip = <&pcritical>;
cooling-device = <&fan0 5 6>;
contribution = <1024>;
};
};
};
&sdhci {
status = "okay";
};
&hdmi0 {
status = "okay";
};
&hdmi0_in_vp0 {
status = "okay";
};
&route_hdmi0 {
status = "okay";
};
&spdif_tx2 {
status = "okay";
};
&i2s5_8ch {
status = "okay";
};
&vop {
status = "okay";
vop-supply = <&vdd_log_s0>;
};
&vop_mmu {
status = "okay";
};
&vp0 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER0 | 1 << ROCKCHIP_VOP2_ESMART0)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER0>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART0>;
};
&vp1 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER1 | 1 << ROCKCHIP_VOP2_ESMART1)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER1>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART1>;
};
&vp2 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER2 | 1 << ROCKCHIP_VOP2_ESMART2)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER2>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART2>;
};
&vp3 {
rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER3 | 1 << ROCKCHIP_VOP2_ESMART3)>;
rockchip,primary-plane = <ROCKCHIP_VOP2_CLUSTER3>;
cursor-win-id = <ROCKCHIP_VOP2_ESMART3>;
};
&display_subsystem {
clocks = <&hdptxphy_hdmi0>;
clock-names = "hdmi0_phy_pll";
};
&hdptxphy_hdmi0 {
status = "okay";
};
&dsi1 {
status = "okay";
//rockchip,lane-rate = <550>;
#address-cells = <1>;
#size-cells = <0>;
dsi1_panel: panel@0 {
status = "okay";
compatible = "raydium,rm67199";
reg = <0>;
vdd-supply = <&lcd_3v3>;
power-supply = <&lcd_3v3>;
reset-gpios = <&gpio1 RK_PB0 GPIO_ACTIVE_LOW>;
rotation = <270>;
pinctrl-names = "default";
pinctrl-0 = <&dsi1_lcd_rst_gpio>;
dsi-lanes = <4>;
video-mode = <2>; /* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
width-mm = <68>;
height-mm = <121>;
disp_timings0: display-timings {
native-mode = <&dsi1_timing0>;
dsi1_timing0: timing0 {
clock-frequency = <133710720>;
hactive = <1080>;
vactive = <1920>;
hfront-porch = <26>;
hsync-len = <2>;
hback-porch = <36>;
vfront-porch = <8>;
vsync-len = <4>;
vback-porch = <16>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
panel_in_dsi1: endpoint {
remote-endpoint = <&dsi1_out_panel>;
};
};
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@1 {
reg = <1>;
dsi1_out_panel: endpoint {
remote-endpoint = <&panel_in_dsi1>;
};
};
};
};
&mipi_dcphy1 {
status = "okay";
};
&route_dsi1 {
status = "okay";
connect = <&vp3_out_dsi1>;
};
&dsi1_in_vp2 {
status = "disabled";
};
&dsi1_in_vp3 {
status = "okay";
};
&pinctrl {
headphone {
hp_det: hp-det {
rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
hym8563 {
rtc_int: rtc-int {
rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
dsi1-lcd {
dsi1_lcd_rst_gpio: dsi1-lcd-rst-gpio {
rockchip,pins =
//<1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>,
<1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
gtx8 {
gtx8_gpio: gtx8-gpio {
rockchip,pins =
<1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>,
<1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
bq24292i {
bq24292i_gpio: bq24292i-gpio {
rockchip,pins =
<0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>,
<1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
dp {
dp0_hpd: dp0-hpd {
rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
gpio-key {
volume_keys: volume-keys {
rockchip,pins =
<4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
<1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>,
<1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
poweroff {
poweroff_gpio: poweroff-gpio {
rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
gauge {
fuel_gauge: fuel-gauge {
rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};
&pcie2x1l2 {
reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
vpcie3v3-supply = <&vcc3v3_pcie2x1l0>;
status = "okay";
};
&combphy0_ps {
status = "okay";
};
&combphy2_psu {
status = "okay";
};
&u2phy0 {
status = "okay";
};
&u2phy2 {
status = "okay";
};
&u2phy3 {
status = "okay";
};
&u2phy0_otg {
// rockchip,typec-vbus-det;
/delete-property/ rockchip,usbctrl-grf;
status = "okay";
phy-supply = <&vcc5v0_sys>;
};
&u2phy2_host {
status = "okay";
phy-supply = <&vcc5v0_sys>;
};
&u2phy3_host {
status = "okay";
phy-supply = <&vcc5v0_sys>;
};
&usb_host0_ehci {
status = "okay";
};
&usb_host0_ohci {
status = "okay";
};
&usb_host1_ehci {
status = "okay";
};
&usb_host1_ohci {
status = "okay";
};
&usbdp_phy0_dp {
status = "okay";
};
&usbdp_phy0_u3 {
status = "okay";
};
&usbdrd3_0 {
status = "okay";
};
&usbdrd_dwc3_0 {
dr_mode = "host";
status = "okay";
extcon = <&u2phy2>;
};
&usbhost3_0 {
status = "okay";
};
&usbhost_dwc3_0 {
status = "okay";
};
&sdmmc {
max-frequency = <200000000>;
no-sdio;
no-mmc;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
sd-uhs-sdr104;
vmmc-supply = <&vcc_3v3_s3>;
vqmmc-supply = <&vccio_sd_s0>;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_det>;
status = "okay";
};
&rockchip_suspend {
compatible = "rockchip,pm-rk3588";
status = "okay";
rockchip,sleep-debug-en = <1>;
rockchip,sleep-mode-config = <
(0
| RKPM_SLP_ARMOFF_DDRPD
)
>;
rockchip,wakeup-config = <
(0
| RKPM_GPIO_WKUP_EN
)
>;
};
&vdpu {
status = "okay";
};
&vdpu_mmu {
status = "okay";
};
&vepu {
status = "okay";
};
&rknpu {
status = "disabled";
};
&rknpu_mmu {
status = "disabled";
};