From 707b15fd1f264d4a012d97415a3be20f21d69613 Mon Sep 17 00:00:00 2001 From: Jianfeng Liu Date: Thu, 12 Dec 2024 04:33:49 +0800 Subject: [PATCH] H6xk boards: toggle to mainline kernel instead of vendor (#7559) --- config/boards/hinlink-h66k.csc | 2 +- config/boards/hinlink-h68k.csc | 2 +- config/boards/hinlink-hnas.csc | 2 +- .../dt/rk3568-hinlink-h68k.dts | 37 ++- .../dt/rk3568-hinlink-hnas.dts | 228 ++++++++++++++++++ 5 files changed, 246 insertions(+), 25 deletions(-) create mode 100644 patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-hnas.dts diff --git a/config/boards/hinlink-h66k.csc b/config/boards/hinlink-h66k.csc index 94ebf1b65f24..c5d4a434e492 100644 --- a/config/boards/hinlink-h66k.csc +++ b/config/boards/hinlink-h66k.csc @@ -3,7 +3,7 @@ BOARD_NAME="Hinlink H66K" BOARDFAMILY="rk35xx" BOARD_MAINTAINER="" BOOTCONFIG="radxa-e25-rk3568_defconfig" -KERNEL_TARGET="vendor" +KERNEL_TARGET="edge" FULL_DESKTOP="yes" BOOT_LOGO="desktop" BOOT_FDT_FILE="rockchip/rk3568-hinlink-h66k.dtb" diff --git a/config/boards/hinlink-h68k.csc b/config/boards/hinlink-h68k.csc index 8c874cc224c8..cb736550899c 100644 --- a/config/boards/hinlink-h68k.csc +++ b/config/boards/hinlink-h68k.csc @@ -3,7 +3,7 @@ BOARD_NAME="Hinlink H68K" BOARDFAMILY="rk35xx" BOARD_MAINTAINER="" BOOTCONFIG="radxa-e25-rk3568_defconfig" -KERNEL_TARGET="vendor" +KERNEL_TARGET="edge" FULL_DESKTOP="yes" BOOT_LOGO="desktop" BOOT_FDT_FILE="rockchip/rk3568-hinlink-h68k.dtb" diff --git a/config/boards/hinlink-hnas.csc b/config/boards/hinlink-hnas.csc index 5daae3e398b7..d80fe27c3d00 100644 --- a/config/boards/hinlink-hnas.csc +++ b/config/boards/hinlink-hnas.csc @@ -3,7 +3,7 @@ BOARD_NAME="Hinlink HNAS" BOARDFAMILY="rk35xx" BOARD_MAINTAINER="" BOOTCONFIG="radxa-e25-rk3568_defconfig" -KERNEL_TARGET="vendor" +KERNEL_TARGET="edge" FULL_DESKTOP="yes" BOOT_LOGO="desktop" BOOT_FDT_FILE="rockchip/rk3568-hinlink-hnas.dtb" diff --git a/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-h68k.dts b/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-h68k.dts index 7eed082c4edf..ce9707faa840 100644 --- a/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-h68k.dts +++ b/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-h68k.dts @@ -85,6 +85,20 @@ regulator-max-microvolt = <12000000>; }; + rfkill-bt { + compatible = "rfkill-gpio"; + label = "rfkill-m2-bt"; + radio-type = "bluetooth"; + shutdown-gpios = <&gpio3 RK_PA0 GPIO_ACTIVE_HIGH>; + }; + + rfkill-wifi { + compatible = "rfkill-gpio"; + label = "rfkill-pcie-wlan"; + radio-type = "wlan"; + shutdown-gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; + }; + vcc5v0_sys: vcc5v0-sys-regulator { compatible = "regulator-fixed"; regulator-name = "vcc5v0_sys"; @@ -111,23 +125,6 @@ vin-supply = <&vcc5v0_sys>; }; - /* wifi power - for H68K-MAX & H69K-MAX - */ - vcc3v3_pcie2: vcc3v3-pcie2-regulator { - compatible = "regulator-fixed"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-name = "vcc3v3_pcie2"; - regulator-boot-on; - - gpio = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>; - - pinctrl-names = "default"; - pinctrl-0 = <&vcc3v3_pcie2_en>; - vin-supply = <&vcc3v3_sys>; - }; - /* eth 2.5g power for H66K H69K */ @@ -655,7 +652,7 @@ &pcie2x1 { reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&vcc3v3_pcie2>; + vpcie3v3-supply = <&vcc3v3_sys>; status = "okay"; }; @@ -749,10 +746,6 @@ }; pcie { - vcc3v3_pcie2_en: vcc3v3_pcie2_en { - rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; - }; - vcc3v3_pcie3_en: vcc3v3_pcie3_en { rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; }; diff --git a/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-hnas.dts b/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-hnas.dts new file mode 100644 index 000000000000..9d966a851240 --- /dev/null +++ b/patch/kernel/archive/rockchip64-6.12/dt/rk3568-hinlink-hnas.dts @@ -0,0 +1,228 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (c) 2022 AmadeusGhost +// Copyright (c) 2022 Flippy +// Copyright (c) 2023 amazingfate + +/dts-v1/; + +#include "rk3568-hinlink-h68k.dts" + +/ { + model = "HINLINK HNAS"; + compatible = "hinlink,hnas", "rockchip,rk3568"; + + fan0: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-levels = <8 39 70 100 131 162 193 224 255>; + pwms = <&pwm0 0 10000 0>; + }; + + hdd_leds { + led_hdd1: led-hdd1 { + pinctrl-names = "default"; + pinctrl-0 = <&led_hdd1_pin>; + label = "led:hdd1"; + gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>; + }; + + led_hdd2: led-hdd2 { + pinctrl-names = "default"; + pinctrl-0 = <&led_hdd2_pin>; + label = "led:hdd2"; + gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; + }; + + led_hdd3: led-hdd3 { + pinctrl-names = "default"; + pinctrl-0 = <&led_hdd3_pin>; + label = "led:hdd3"; + gpios = <&gpio3 RK_PB2 GPIO_ACTIVE_HIGH>; + }; + + led_hdd4: led-hdd4 { + pinctrl-names = "default"; + pinctrl-0 = <&led_hdd4_pin>; + label = "led:hdd4"; + gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>; + }; + }; + + sata_pm_power: sata-pm-power { + compatible = "regulator-fixed"; + regulator-name = "sata_pm_power"; + regulator-enable-ramp-delay = <1000000>; + regulator-always-on; + regulator-boot-on; + + enable-active-high; + gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&sata_pm_power_en>; + vin-supply = <&vcc3v3_sys>; + }; + + sata_pm_reset: sata-pm-reset { + compatible = "regulator-fixed"; + regulator-name = "sata_pm_reset"; + regulator-enable-ramp-delay = <1000000>; + regulator-always-on; + regulator-boot-on; + + enable-active-high; + gpio = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&sata_pm_reset_en>; + vin-supply = <&vcc3v3_sys>; + }; + + sata_hdd_power: sata-hdd-power { + compatible = "regulator-fixed"; + regulator-name = "sata_hdd_power"; + regulator-enable-ramp-delay = <1000000>; + regulator-always-on; + regulator-boot-on; + + enable-active-high; + gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&sata_hdd_power_en>; + vin-supply = <&vcc5v0_sys>; + }; +}; + +&gmac0 { + status = "disabled"; +}; + +&gmac1 { + status = "disabled"; +}; + +&pinctrl { + hdd-leds { + led_hdd1_pin: led-hdd1-pin { + rockchip,pins = <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + led_hdd2_pin: led-hdd2-pin { + rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + led_hdd3_pin: led-hdd3-pin { + rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + led_hdd4_pin: led-hdd4-pin { + rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + sata-pm { + sata_pm_power_en: sata-pm-power-en { + rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + sata_pm_reset_en: sata-pm-reset-en { + rockchip,pins = <4 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + sata_hdd_power_en: sata-hdd-power-en { + rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; +}; + +&pwm0 { + status = "okay"; +}; + +&cpu_thermal { + trips { + trip0: trip-point@0 { + temperature = <45000>; + hysteresis = <5000>; + type = "active"; + }; + trip1: trip-point@1 { + temperature = <50000>; + hysteresis = <5000>; + type = "active"; + }; + trip2: trip-point@2 { + temperature = <55000>; + hysteresis = <5000>; + type = "active"; + }; + trip3: trip-point@3 { + temperature = <60000>; + hysteresis = <5000>; + type = "active"; + }; + trip4: trip-point@4 { + temperature = <65000>; + hysteresis = <5000>; + type = "active"; + }; + trip5: trip-point@5 { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + trip6: trip-point@6 { + temperature = <75000>; + hysteresis = <5000>; + type = "active"; + }; + trip7: trip-point@7 { + 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 = <&trip5>; + cooling-device = <&fan0 5 6>; + contribution = <1024>; + }; + map6 { + trip = <&trip6>; + cooling-device = <&fan0 6 7>; + contribution = <1024>; + }; + map7 { + trip = <&trip7>; + cooling-device = <&fan0 7 8>; + contribution = <1024>; + }; + }; +};