From 02593d2a6c93e47bda3a01b3062c147901c4f304 Mon Sep 17 00:00:00 2001 From: SuperKali Date: Tue, 10 Sep 2024 18:04:09 +0000 Subject: [PATCH] =?UTF-8?q?Review=20and=20refactor=20DTS=20code=20for=20Yo?= =?UTF-8?q?uyeetoo=20R1=20V3:=20-=20Reworked=20FAN=20code=20for=20improved?= =?UTF-8?q?=20support;=20now=20correctly=20operates=20when=20the=20tempera?= =?UTF-8?q?ture=20reaches=2055=C2=B0C.=20-=20Fixed=20CAN=20pinctrl=20inter?= =?UTF-8?q?face;=20pin=20assignment=20aligned=20with=20the=20schematic.=20?= =?UTF-8?q?-=20Added=20PHY=20supply=20reference=20to=20Ethernet=20configur?= =?UTF-8?q?ation.=20-=20Removed=20redundant=20code,=20including=20xgpio=20?= =?UTF-8?q?on=20pinctrl.=20-=20Renamed=20`gpio-key`=20to=20`gpio`=20for=20?= =?UTF-8?q?clearer=20reference.=20-=20Moved=20LCD=20backlight=20PWM=20cont?= =?UTF-8?q?rols=20to=20the=20appropriate=20function.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dts/rockchip/rk3588s-youyeetoo-r1.dts | 61 +++++----- .../boot/dts/rockchip/rk3588s-yyt-common.dtsi | 106 ++++++++++++++---- 2 files changed, 115 insertions(+), 52 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-youyeetoo-r1.dts b/arch/arm64/boot/dts/rockchip/rk3588s-youyeetoo-r1.dts index 71202c064d588..b5667f3ca5603 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-youyeetoo-r1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-youyeetoo-r1.dts @@ -52,7 +52,6 @@ backlight: backlight { compatible = "pwm-backlight"; - pwms = <&pwm12 0 25000 0>; brightness-levels = < 0 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 @@ -86,13 +85,12 @@ 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 - >; + >; default-brightness-level = <200>; - }; + }; - backlight1: backlight1 { + backlight1: backlight1 { compatible = "pwm-backlight"; - pwms = <&pwm11 0 25000 0>; brightness-levels = < 0 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 @@ -128,7 +126,7 @@ 248 249 250 251 252 253 254 255 >; default-brightness-level = <200>; - }; + }; /* BLUETOOTH */ wireless_bluetooth: wireless-bluetooth { @@ -149,28 +147,13 @@ }; /* FAN */ - fan: gpio-fan { - compatible = "gpio-fan"; - gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>; /* Using GPIO0_C7 */ - #cooling-cells = <2>; - cooling-levels = <0 50 100 150 200 255>; - gpio-fan,speed-map = < - 0 0 - 1 50 - 2 100 - 3 150 - 4 200 - 5 255 - >; - rockchip,temp-trips = < - 50000 1 - 55000 2 - 60000 3 - 65000 4 - 70000 5 - >; - status = "okay"; - }; + fan0: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-levels = <100 160 190 200 215 235 255>; + pwms = <&pwm6 0 40000 0>; + fan-supply = <&vcc12v_dcin>; + }; }; /* AUDIO */ @@ -182,8 +165,16 @@ &i2s0_sdo0>; }; +/* PWM */ +&pwm6{ + pinctrl-0 = <&pwm6m0_pins>; + pinctrl-names = "active"; + status = "okay"; +}; + &pwm7{ pinctrl-0 = <&pwm7m0_pins>; + pinctrl-names = "active"; status = "okay"; }; @@ -197,4 +188,18 @@ status = "okay"; pinctrl-names = "active"; pinctrl-0 = <&pwm12m1_pins>; +}; + +/* LCD BACKLIGHT */ + +&backlight { + pwms = <&pwm12 0 25000 0>; + status = "okay"; + power-supply = <&vcc5v0_sys>; +}; + +&backlight1 { + pwms = <&pwm11 0 25000 0>; + status = "disabled"; + power-supply = <&vcc5v0_sys>; }; \ No newline at end of file diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-yyt-common.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-yyt-common.dtsi index 2325d9709c8d3..18f36391f30c0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-yyt-common.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s-yyt-common.dtsi @@ -160,7 +160,7 @@ leds: gpio-leds { compatible = "gpio-leds"; pinctrl-names = "default"; - pinctrl-0 =<&leds_gpio>; + pinctrl-0 = <&leds_gpio>; status = "okay"; led@1 { @@ -505,10 +505,86 @@ }; /* VARIOUS */ +/* FAN CONTROL */ +&threshold { + temperature = <60000>; +}; + +&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 = <1000>; + 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>; + }; + }; +}; + +/* CAN */ &can2 { pinctrl-names = "default"; - pinctrl-0 = <&can2m1_pins>; + pinctrl-0 = <&can2m0_pins>; status = "okay"; }; @@ -728,6 +804,7 @@ tx_delay = <0x43>; phy-handle = <&rgmii_phy1>; + phy-supply = <&vcc_3v3_s3>; }; @@ -814,7 +891,7 @@ &uart5 { status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&uart5m1_xfer >; + pinctrl-0 = <&uart5m1_xfer>; }; &pinctrl { @@ -867,29 +944,10 @@ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>; }; }; - /* GPIO KEYS */ - gpio-key { - key1_pin: key1-pin { - rockchip,pins = <1 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>; - }; + /* GPIO */ + gpio { leds_gpio: leds-gpio { rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; }; }; - - xgpio { - gpio_4g:gpio-4g{ - rockchip,pins = - <0 23 RK_FUNC_GPIO &pcfg_pull_up>; - //<3 26 RK_FUNC_GPIO &pcfg_pull_up>, - //<3 27 RK_FUNC_GPIO &pcfg_pull_up>, - //<0 21 RK_FUNC_GPIO &pcfg_pull_up>, - //<0 29 RK_FUNC_GPIO &pcfg_pull_up>, - //<4 6 RK_FUNC_GPIO &pcfg_pull_up>, - //<4 7 RK_FUNC_GPIO &pcfg_pull_up>, - //<0 8 RK_FUNC_GPIO &pcfg_pull_up>; - //<4 10 RK_FUNC_GPIO &pcfg_pull_none>, - //<4 13 RK_FUNC_GPIO &pcfg_pull_up>; - }; - }; }; \ No newline at end of file