From eb7268a581695e617d3ecad742e35288ddb0a545 Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Sat, 16 May 2026 05:04:50 +0000 Subject: [PATCH 1/2] fleet+patches: add ampere (CoolPi GenBook) minimal baseline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds fleet/ampere.yaml manifest and 3 scope-tagged patches in patches/board/coolpi-genbook/ for the linux-ampere-fourier kernel. Baseline: mainline v7.0-rc3. Patch set is the verified-working minimum after a 2026-05-16 bisect campaign: 0001 pwm15 pinctrl entries (rk3588 SoC dtsi) 0002 pwm-fan + thermal cooling cells (genbook dts) 0003 RK806 system-power-controller (cm5 module dtsi) NOT included (intentionally): - misc_patches/genbook/kernel/0010 family — suspend/resume + wakeup WIP, leave out until Markus closes the thread - 8 cherry-picks (Shawn Lin pcie3 phy, Cristian Ciocaltea clk+dw-dp, Sebastian Reichel hdmirx, Pedro Alves) plus the DTS commits (lid switch, USB-C PD, speaker) — one or more of these black-screens ampere; offender not yet bisected The linux-rk3588-marfrit branch tip (f8f3ad9, 18 commits ahead of v7.0-rc3) produced a display regression on ampere (connector/dpms/SDDM all positive software-side, panel actually blank). Decomposing patch 0010 into 5 atomic sub-commits and reverting all 5 (= test-arch-plus-pcie3 branch on git.reauktion.de/marfrit/linux-rk3588-marfrit) did NOT fix the regression, ruling out 0010. The ampere-minimal branch (v7.0-rc3 + only the 3 patches above) boots clean with display on ampere — confirming the offender is one of the 14 patches left out here. ampere-minimal branch on git.reauktion.de/marfrit/linux-rk3588-marfrit @ 0ce6ef5d48f2 is the working baseline. Generated-by: Claude Opus 4.7 --- fleet/ampere.yaml | 83 +++++++++++++++++++ ...hip-rk3588-Add-pwm15-pinctrl-entries.patch | 59 +++++++++++++ ...ip-rk3588-coolpi-cm5-genbook-Add-pwm.patch | 81 ++++++++++++++++++ ...ip-rk3588-coolpi-cm5-fix-power-off-b.patch | 40 +++++++++ 4 files changed, 263 insertions(+) create mode 100644 fleet/ampere.yaml create mode 100644 patches/board/coolpi-genbook/0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch create mode 100644 patches/board/coolpi-genbook/0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm.patch create mode 100644 patches/board/coolpi-genbook/0003-arm64-dts-rockchip-rk3588-coolpi-cm5-fix-power-off-b.patch diff --git a/fleet/ampere.yaml b/fleet/ampere.yaml new file mode 100644 index 0000000..7050096 --- /dev/null +++ b/fleet/ampere.yaml @@ -0,0 +1,83 @@ +# kernel-agent manifest for ampere (CoolPi GenBook / Rockchip RK3588) +# +# Status: minimal baseline established 2026-05-16 after the +# linux-rk3588-marfrit tip @ f8f3ad9 baseline produced a black-screen +# regression on ampere (display blank, software-state OK). Bisect +# narrowed the working baseline to mainline v7.0-rc3 + 3 settled +# patches: pwm15 pinctrl + pwm-fan thermal + RK806 system-power-controller. +# +# The suspend/resume + wakeup series (sleep fixes / patch 0010 family in +# misc_patches) is WORK-IN-PROGRESS and intentionally NOT included here +# until upstream-ready. +# +# Other linux-rk3588-marfrit commits (lid switch, USB-C PD, speaker, +# 8 cherry-picks from Shawn Lin / Cristian Ciocaltea / Sebastian Reichel +# / Pedro Alves) are also DEFERRED — one or more of them caused the +# black-screen regression and the offender hasn't been identified yet. + +host: ampere +arch: arm64 +soc: rockchip/rk3588 +board: coolpi-cm5-genbook +distro: archlinux-arm + +baseline: + tree: torvalds/linux + url: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git + ref: v7.0-rc3 + upstream_compat: linux-7.0 + +# Scope-tagged patch includes. Each entry resolves to +# patches//.../.patch in marfrit/kernel-agent. +# +# pwm15 patch is technically SoC-level (rk3588-extra-pinctrl.dtsi) but +# kept under board/coolpi-genbook/ for now because the only consumer in +# the fleet is ampere (boltzmann is rk3588 too but UEFI/edk2 boot, no +# pwm15 user). Move to patches/soc/rockchip/rk3588/ once a second +# consumer shows up. +includes: + - board/coolpi-genbook/0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch + - board/coolpi-genbook/0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm.patch + - board/coolpi-genbook/0003-arm64-dts-rockchip-rk3588-coolpi-cm5-fix-power-off-b.patch + +# Explicitly NOT included (decision logged): +# - misc_patches/genbook/kernel/0010 (sleep fixes / WIP — re-evaluate +# once Markus closes the suspend/resume thread) +# - lid switch / USB-C PD / speaker / Shawn Lin pcie3 phy series / +# Collabora clk/dts/dw-dp fixes / Sebastian Reichel hdmirx +# (all currently suspect for black-screen regression; re-bisect +# individually before re-adding) + +config: + source: /proc/config.gz on running ampere kernel (7.0.0-rc3-ARCH+) + strategy: snapshot, fold to baseline, accept-new with rationale on diff + +package: + name: linux-ampere-fourier + versioning: "${baseline_ref}.kafr${pkgrel}" # e.g. 7.0rc3.kafr1 + install_mode: alongside # coexists with arch_mainline label in /boot/firmware + conflicts: [] + provides: [] + kernel_suffix: -ampere-fourier # /boot/firmware/Image-7.0.0-rc3-ampere-fourier + bootloader: extlinux # /boot/firmware/extlinux/extlinux.conf + +verify: + bar1_ssh_heartbeat: required + bar2_pkg_version: required + bar3_dtb_match: + - pwm15 pinctrl entries present in rk3588-extra-pinctrl.dtsi + - pwm-fan node bound to pwm15 with cooling-cells in coolpi-cm5-genbook.dts + - rockchip,system-power-controller property on rk806 in coolpi-cm5.dtsi + bar4_per_patch_probe: + - display: SDDM greeter visible on eDP panel (visual, manual) + - power-off: `shutdown -h now` actually cuts RK806 rails (visual: backlight off + fan stops) + - pwm-fan: thermal_zone trip_points reachable, fan spins at high load + bar5_burn_in: skip # laptop, runtime not constant + +build_host: + primary: ampere # native build; native verifies toolchain identity with ARCH+ + fallback: boltzmann # rk3588 LXD host, larger CPU pool + # No distcc per feedback_kernel_agent_no_distcc.md (2026-05-09). + +backup: + pre_install: hertz:/sparfuxdata/kernel-agent-backups/ampere/${replaced_version}/ diff --git a/patches/board/coolpi-genbook/0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch b/patches/board/coolpi-genbook/0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch new file mode 100644 index 0000000..20fbc51 --- /dev/null +++ b/patches/board/coolpi-genbook/0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch @@ -0,0 +1,59 @@ +From 49b8b79c8359b5f49461eea0b51dc82fea1e816b Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Thu, 16 Apr 2026 23:52:53 +0200 +Subject: [PATCH 1/3] arm64: dts: rockchip: rk3588: Add pwm15 pinctrl entries + +Add pinctrl entries for all four mux options of the RK3588 pwm15 +controller (m0-m3) to rk3588-extra-pinctrl.dtsi, marked with +/omit-if-no-ref/ so they are only compiled in when referenced. + +Generated-by: Claude Sonnet 4.6 +Signed-off-by: Markus Fritsche +--- + .../dts/rockchip/rk3588-extra-pinctrl.dtsi | 30 +++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi +index fb48ddc04bcb..a4fec1538858 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi +@@ -342,6 +342,36 @@ pwm7m3_pins: pwm7m3-pins { + }; + }; + ++ pwm15 { ++ /omit-if-no-ref/ ++ pwm15m0_pins: pwm15m0-pins { ++ rockchip,pins = ++ /* pwm15_ir_m0 */ ++ <3 RK_PC3 11 &pcfg_pull_none>; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm15m1_pins: pwm15m1-pins { ++ rockchip,pins = ++ /* pwm15_ir_m1 */ ++ <4 RK_PB3 11 &pcfg_pull_none>; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm15m2_pins: pwm15m2-pins { ++ rockchip,pins = ++ /* pwm15_ir_m2 */ ++ <1 RK_PC6 11 &pcfg_pull_none>; ++ }; ++ ++ /omit-if-no-ref/ ++ pwm15m3_pins: pwm15m3-pins { ++ rockchip,pins = ++ /* pwm15_ir_m3 */ ++ <1 RK_PD7 11 &pcfg_pull_none>; ++ }; ++ }; ++ + sdio { + /omit-if-no-ref/ + sdiom0_pins: sdiom0-pins { +-- +2.54.0 + diff --git a/patches/board/coolpi-genbook/0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm.patch b/patches/board/coolpi-genbook/0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm.patch new file mode 100644 index 0000000..99d0b6f --- /dev/null +++ b/patches/board/coolpi-genbook/0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm.patch @@ -0,0 +1,81 @@ +From ed8fd7da66575a255c34d70b1ded0eb917ae0a80 Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Thu, 16 Apr 2026 23:52:53 +0200 +Subject: [PATCH 2/3] arm64: dts: rockchip: rk3588-coolpi-cm5-genbook: Add + pwm-fan with thermal cooling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The CoolPi CM5 GenBook has a PWM-controlled fan connected to pwm15 +(mux m3, GPIO1_D7). Add a pwm-fan node driven at 20 kHz (50000 ns +period) with six cooling levels, and wire it into the package thermal +zone with two trip points at 55 °C and 65 °C. + +Generated-by: Claude Sonnet 4.6 +Signed-off-by: Markus Fritsche +--- + .../rockchip/rk3588-coolpi-cm5-genbook.dts | 43 +++++++++++++++++++ + 1 file changed, 43 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +index 738637ecaf55..9819ac482855 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +@@ -23,6 +23,13 @@ backlight: backlight { + pwms = <&pwm6 0 25000 0>; + }; + ++ fan: pwm-fan { ++ compatible = "pwm-fan"; ++ #cooling-cells = <2>; ++ pwms = <&pwm15 0 50000 0>; ++ cooling-levels = <1 50 100 150 200 254>; ++ }; ++ + battery: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <9800000>; +@@ -443,3 +450,39 @@ vp2_out_edp1: endpoint@ROCKCHIP_VOP2_EP_EDP1 { + remote-endpoint = <&edp1_in_vp2>; + }; + }; ++ ++&package_thermal { ++ polling-delay = <1000>; ++ ++ trips { ++ package_fan0: package-fan0 { ++ temperature = <55000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ ++ package_fan1: package-fan1 { ++ temperature = <65000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ }; ++ ++ cooling-maps { ++ map0 { ++ trip = <&package_fan0>; ++ cooling-device = <&fan THERMAL_NO_LIMIT 2>; ++ }; ++ ++ map1 { ++ trip = <&package_fan1>; ++ cooling-device = <&fan 3 THERMAL_NO_LIMIT>; ++ }; ++ }; ++}; ++ ++&pwm15 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm15m3_pins>; ++ status = "okay"; ++}; +-- +2.54.0 + diff --git a/patches/board/coolpi-genbook/0003-arm64-dts-rockchip-rk3588-coolpi-cm5-fix-power-off-b.patch b/patches/board/coolpi-genbook/0003-arm64-dts-rockchip-rk3588-coolpi-cm5-fix-power-off-b.patch new file mode 100644 index 0000000..d4f6e88 --- /dev/null +++ b/patches/board/coolpi-genbook/0003-arm64-dts-rockchip-rk3588-coolpi-cm5-fix-power-off-b.patch @@ -0,0 +1,40 @@ +From 0ce6ef5d48f2a557b5f39b9cf10903e46c0b55e9 Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Thu, 16 Apr 2026 23:52:53 +0200 +Subject: [PATCH 3/3] arm64: dts: rockchip: rk3588-coolpi-cm5: fix power-off by + enabling RK806 as system power controller +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Without the system-power-controller property the rk8xx-core driver never +registers its sys_off handler (rk808_power_off), which writes the DEV_OFF +bit to RK806_SYS_CFG3 at shutdown time. As a result the RK806 PMIC does +not cut power and the board remains partially active after "poweroff" — +the heartbeat LED stops but internal activity continues. + +All other mainline RK3588 boards that use the RK806 carry this property +(NanoPC-T6, Rock 5A, OrangePi 5, Jaguar, ...). Add it to the CoolPi CM5 +PMIC node to restore proper power-off behaviour. + +Generated-by: Claude Sonnet 4.6 +Signed-off-by: Markus Fritsche +--- + arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi +index b07543315f87..83b72ec95f5a 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi +@@ -346,6 +346,7 @@ pmic@0 { + interrupts = <7 IRQ_TYPE_LEVEL_LOW>; + gpio-controller; + #gpio-cells = <2>; ++ system-power-controller; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, + <&rk806_dvs2_null>, <&rk806_dvs3_null>; +-- +2.54.0 + -- 2.47.3 From 1d805ef70d52b5441a02ef6a28e49077f47aa6fb Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Sat, 16 May 2026 06:02:28 +0000 Subject: [PATCH 2/2] fleet/ampere: extend baseline with lid+USB-C PD+speaker (all 6 patches verified) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After verifying the minimal v7.0-rc3+pwm15+pwm-fan+RK806 baseline boots with display on ampere, extended via bisect-by-addition to include 3 more from linux-rk3588-marfrit's pre-cherry-pick set: 0004 enable speaker output (genbook dts + cm5 dtsi) 0005 USB-C PD charging (genbook dts: FUSB302, vcc5v0_otg) 0006 lid switch + USB3 lane mux (genbook dts: gpio-keys SW_LID, usbdp_phy1) ampere-minimal-devices branch on git.reauktion.de/marfrit/linux-rk3588-marfrit @ 7c241f2e2835 = the verified-working state with all 6 patches. Display continues to work — confirms regression source is in one of the 12 remaining linux-rk3588-marfrit commits (Shawn Lin pcie3 phy series, Cristian Ciocaltea clk/dts/dw-dp, Sebastian Reichel hdmirx, Pedro Alves btrtl, plus the WIP suspend/resume patch 0010). Generated-by: Claude Opus 4.7 --- fleet/ampere.yaml | 13 +- ...ip-rk3588-coolpi-cm5-genbook-enable-.patch | 114 +++++++++ ...ip-rk3588-coolpi-cm5-genbook-add-USB.patch | 236 ++++++++++++++++++ ...ip-rk3588-coolpi-cm5-genbook-add-lid.patch | 100 ++++++++ 4 files changed, 459 insertions(+), 4 deletions(-) create mode 100644 patches/board/coolpi-genbook/0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-enable-.patch create mode 100644 patches/board/coolpi-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-USB.patch create mode 100644 patches/board/coolpi-genbook/0006-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-lid.patch diff --git a/fleet/ampere.yaml b/fleet/ampere.yaml index 7050096..0b64d7f 100644 --- a/fleet/ampere.yaml +++ b/fleet/ampere.yaml @@ -39,14 +39,19 @@ includes: - board/coolpi-genbook/0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch - board/coolpi-genbook/0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm.patch - board/coolpi-genbook/0003-arm64-dts-rockchip-rk3588-coolpi-cm5-fix-power-off-b.patch + - board/coolpi-genbook/0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-enable-.patch + - board/coolpi-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-USB.patch + - board/coolpi-genbook/0006-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-lid.patch # Explicitly NOT included (decision logged): # - misc_patches/genbook/kernel/0010 (sleep fixes / WIP — re-evaluate # once Markus closes the suspend/resume thread) -# - lid switch / USB-C PD / speaker / Shawn Lin pcie3 phy series / -# Collabora clk/dts/dw-dp fixes / Sebastian Reichel hdmirx -# (all currently suspect for black-screen regression; re-bisect -# individually before re-adding) +# - 12 other linux-rk3588-marfrit commits (Shawn Lin pcie3 phy series, +# Cristian Ciocaltea clk/dts/dw-dp fixes, Sebastian Reichel hdmirx +# Rock 5 ITX, Pedro Alves btrtl). Top regression suspect: +# 55d1b3dcc05e "clk: rockchip: rk3588: Drop CLK_SET_RATE_PARENT from +# DCLK_VOP2_SRC" — touches display controller clock. Bisect campaign +# separately to identify the actual offender(s). config: source: /proc/config.gz on running ampere kernel (7.0.0-rc3-ARCH+) diff --git a/patches/board/coolpi-genbook/0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-enable-.patch b/patches/board/coolpi-genbook/0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-enable-.patch new file mode 100644 index 0000000..72bd8a9 --- /dev/null +++ b/patches/board/coolpi-genbook/0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-enable-.patch @@ -0,0 +1,114 @@ +From 3722eabbf2d28b1ea35add3e7b36d52e4bbd63c3 Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Thu, 16 Apr 2026 23:52:54 +0200 +Subject: [PATCH 4/6] arm64: dts: rockchip: rk3588-coolpi-cm5-genbook: enable + speaker output + +The GenBook carrier board routes the ES8316 HPOL/HPOR outputs to both a +headphone jack and an external speaker amplifier. The amplifier is +enabled by GPIO1_A6 (active-high) and headphone insertion is detected by +GPIO1_B5 (active-high, pull-up). + +Add a label to the shared analog-sound node in the CM5 DTSI so the +GenBook DTS can extend it, then override the node to: + + - add pa-gpios for the speaker amplifier enable line (GPIO1_A6) + - add hp-det-gpios for headphone jack detection (GPIO1_B5) + - extend widgets/routing to include the Speaker path through the + audio-graph-card built-in "Amplifier" DAPM output-driver widget, + which gates the pa-gpios GPIO on widget power-up/down + - add the hp-det pinctrl group for GPIO1_B5 + +The "Amplifier" DAPM widget (snd_soc_dapm_out_drv) is provided by +audio-graph-card.c and registered at card level. Its event handler +drives pa-gpios high on SND_SOC_DAPM_POST_PMU and low on +SND_SOC_DAPM_PRE_PMD, giving automatic speaker enable/disable in step +with DAPM power management. + +DAPM path for speaker output: + ES8316 AIF1RX (DAI) -> Left/Right DAC -> Left/Right Headphone Mixer + -> Left/Right Headphone Driver -> HPOL/HPOR [codec OUTPUT pins] + -> Amplifier [card OUT_DRV, fires pa-gpios] -> Speaker [SPK terminal] + +The Left/Right Headphone Mixer Left/Right DAC Switch controls, which +gate the DAC-to-mixer connections in the DAPM graph, are set on by the +UCM BootSequence in the rk3588-es8316 ALSA UCM profile and must remain +enabled for the path to be traversable. + +The HPOL/HPOR codec output pins also feed the Headphones HP widget: + + HPOL/HPOR -> Headphones [HP terminal, jack-controlled via hp-det-gpios] + +Both the Speaker and Headphones paths are active whenever a PCM stream +is running. Speaker-muting when headphones are inserted is handled at +the userspace (UCM) level via JackHWMute on the Speaker UCM device: when +PipeWire routes audio away from the Speaker sink on headphone insertion, +the absence of an active PCM consumer causes DAPM to power down the +Amplifier widget and drive GPIO1_A6 low. + +Note: full speaker output also requires a Speaker SectionDevice in the +rk3588-es8316 ALSA UCM HiFi.conf. Without it the HiFi profile's only +playback port is Headphones (jack-controlled), causing the profile to be +reported as "not available" when no headphones are inserted, and +PipeWire falls back to the pro-audio profile with no speaker sub-device. +A separate patch to alsa-ucm-conf adds the missing Speaker device. + +Generated-by: Claude Sonnet 4.6 +Signed-off-by: Markus Fritsche +--- + .../rockchip/rk3588-coolpi-cm5-genbook.dts | 24 +++++++++++++++++++ + .../boot/dts/rockchip/rk3588-coolpi-cm5.dtsi | 2 +- + 2 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +index 9819ac482855..070f5dde715c 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +@@ -283,7 +283,31 @@ &pcie3x4 { + status = "okay"; + }; + ++&analog_sound { ++ pa-gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>; ++ hp-det-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hp_det>; ++ ++ widgets = "Microphone", "Mic Jack", ++ "Headphone", "Headphones", ++ "Speaker", "Speaker"; ++ ++ routing = "MIC2", "Mic Jack", ++ "Headphones", "HPOL", ++ "Headphones", "HPOR", ++ "Amplifier", "HPOL", ++ "Amplifier", "HPOR", ++ "Speaker", "Amplifier"; ++}; ++ + &pinctrl { ++ headphone { ++ hp_det: hp-det { ++ rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ + lcd { + lcdpwr_en: lcdpwr-en { + rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>; +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi +index 83b72ec95f5a..582c3717192f 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi +@@ -21,7 +21,7 @@ aliases { + serial2 = &uart2; + }; + +- analog-sound { ++ analog_sound: analog-sound { + compatible = "audio-graph-card"; + dais = <&i2s0_8ch_p0>; + label = "rk3588-es8316"; +-- +2.54.0 + diff --git a/patches/board/coolpi-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-USB.patch b/patches/board/coolpi-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-USB.patch new file mode 100644 index 0000000..046a446 --- /dev/null +++ b/patches/board/coolpi-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-USB.patch @@ -0,0 +1,236 @@ +From 3e42ab69173dc33ffc07307a5ae2f83153d6894d Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Tue, 24 Mar 2026 00:00:00 +0000 +Subject: [PATCH 5/6] arm64: dts: rockchip: rk3588-coolpi-cm5-genbook: add + USB-C PD charging +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The GenBook carrier board exposes a USB Type-C port driven by the +RK3588 USB3OTG0 controller (usb_host0_xhci / usbdp_phy0 combo). The +port uses a Fairchild FUSB302 (I²C address 0x22, bus i2c4) for USB +Power Delivery negotiation. Hardware signals: + + GPIO0_PD5 – FUSB302 interrupt (active-low, shared with CC logic) + GPIO0_PA0 – VBUS switch enable (active-high) + +Without these changes the kernel registers usb_host0_xhci in +peripheral-only, high-speed mode, which prevents PD negotiation and +leaves the port unable to charge the battery. + +Changes: + +* Add #include for PDO_FIXED macros. + +* Add vcc5v0_otg regulator: GPIO0_PA0 active-high switch that gates + VBUS; used as vbus-supply for the FUSB302 and connected via the new + typec5v_pwren pinctrl entry. The previously defined but unreferenced + usb_otg_pwren entry (same pin, wrong pull direction) is removed. + +* Add usbc0 (FUSB302) node inside &i2c4: + - compatible "fcs,fusb302", reg 0x22 + - interrupt GPIO0_PD5 (IRQ_TYPE_LEVEL_LOW), pinctrl usbc0_int + - usb-c-connector child with: + data-role / power-role "dual", try-power-role "sink" + pd-revision 2.0 Ver 1.2 (maximum supported by FUSB302) + sink-pdos: 5 V/3 A, 9 V/3 A, 12 V/3 A, 15 V/3 A + source-pdos: 5 V/3 A + DisplayPort alt-mode (SVID 0xff01) declared for orientation + switching; three connector ports linking HS (→ usb_host0_xhci), + SS (→ usbdp_phy0) and SBU (→ usbdp_phy0) endpoints. + +* Expand &usbdp_phy0 to add mode-switch and orientation-switch + capabilities; register endpoint@0 (SS, linked to usbc0_ss) and + endpoint@1 (SBU, linked to usbc0_sbu). + +* Replace the &usb_host0_xhci override: + - remove dr_mode "peripheral" and maximum-speed "high-speed" + (the base DTSI already sets dr_mode "otg") + - add usb-role-switch and the port endpoint linked to usbc0_hs + This allows the TCPM stack to switch the controller between host + and device role as the PD contract dictates. + +* Add pinctrl group usb-typec with: + - usbc0_int: GPIO0_PD5 pull-up (FUSB302 /INT) + - typec5v_pwren: GPIO0_PA0 pull-down (VBUS switch, default off) + +DAPM / power flow: + USB-C charger → FUSB302 CC negotiation → TCPM requests VBUS → + vcc5v0_otg regulator enables GPIO0_PA0 → VBUS present on port → + DWC3 OTG detects VBUS, enters device/host mode per PD data-role. + +Generated-by: Claude Sonnet 4.6 +Signed-off-by: Markus Fritsche +--- + .../rockchip/rk3588-coolpi-cm5-genbook.dts | 112 +++++++++++++++++- + 1 file changed, 106 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +index 070f5dde715c..7c577a603cb5 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include "rk3588-coolpi-cm5.dtsi" + + / { +@@ -153,6 +154,18 @@ vcc5v0_usb_host0: vcc5v0_usb30_host: regulator-vcc5v0-usb-host { + pinctrl-0 = <&usb_host_pwren>; + vin-supply = <&vcc5v0_usb>; + }; ++ ++ vcc5v0_otg: regulator-vcc5v0-otg { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_otg"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&typec5v_pwren>; ++ vin-supply = <&vcc5v0_sys>; ++ }; + }; + + &edp1 { +@@ -239,6 +252,65 @@ cw2015@62 { + monitored-battery = <&battery>; + power-supplies = <&charger>; + }; ++ ++ usbc0: usb-typec@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usbc0_int>; ++ vbus-supply = <&vcc5v0_otg>; ++ ++ usb_con: connector { ++ compatible = "usb-c-connector"; ++ label = "USB-C"; ++ data-role = "dual"; ++ power-role = "dual"; ++ try-power-role = "sink"; ++ op-sink-microwatt = <1000000>; ++ /* FUSB302 supports PD Rev 2.0 Ver 1.2 */ ++ pd-revision = /bits/ 8 <0x2 0x0 0x1 0x2>; ++ sink-pdos = , ++ , ++ , ++ ; ++ source-pdos = ; ++ ++ altmodes { ++ displayport { ++ svid = /bits/ 16 <0xff01>; ++ vdo = <0xffffffff>; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ usbc0_hs: endpoint { ++ remote-endpoint = <&usb_host0_xhci_to_usbc0>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ usbc0_ss: endpoint { ++ remote-endpoint = <&usbdp_phy0_ss>; ++ }; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ usbc0_sbu: endpoint { ++ remote-endpoint = <&usbdp_phy0_sbu>; ++ }; ++ }; ++ }; ++ }; ++ }; + }; + + &i2c5 { +@@ -323,15 +395,21 @@ usb_pwren: usb-pwren { + rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + +- usb_otg_pwren: usb-otg-pwren { +- rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; +- }; +- + usb_host_pwren: usb-host-pwren { + rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + ++ usb-typec { ++ usbc0_int: usbc0-int { ++ rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ typec5v_pwren: typec5v-pwren { ++ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ + wifi { + bt_pwron: bt-pwron { + rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; +@@ -387,7 +465,24 @@ &u2phy0_otg { + }; + + &usbdp_phy0 { ++ mode-switch; ++ orientation-switch; + status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usbdp_phy0_ss: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&usbc0_ss>; ++ }; ++ ++ usbdp_phy0_sbu: endpoint@1 { ++ reg = <1>; ++ remote-endpoint = <&usbc0_sbu>; ++ }; ++ }; + }; + + &u2phy1 { +@@ -431,9 +526,14 @@ &usb_host0_ohci { + + /* Type C port */ + &usb_host0_xhci { +- dr_mode = "peripheral"; +- maximum-speed = "high-speed"; ++ usb-role-switch; + status = "okay"; ++ ++ port { ++ usb_host0_xhci_to_usbc0: endpoint { ++ remote-endpoint = <&usbc0_hs>; ++ }; ++ }; + }; + + /* connected to a HUB for camera and BT */ +-- +2.54.0 + diff --git a/patches/board/coolpi-genbook/0006-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-lid.patch b/patches/board/coolpi-genbook/0006-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-lid.patch new file mode 100644 index 0000000..220df03 --- /dev/null +++ b/patches/board/coolpi-genbook/0006-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-add-lid.patch @@ -0,0 +1,100 @@ +From 7c241f2e28353aa2256682993d2546b96883ae27 Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Tue, 24 Mar 2026 00:00:00 +0000 +Subject: [PATCH 6/6] arm64: dts: rockchip: rk3588-coolpi-cm5-genbook: add lid + switch and USB3 PHY lane config + +The GenBook laptop has two features missing from the mainline DTS: + +1. Lid switch (MH248 hall-effect sensor on GPIO0_PB0) + The lid state is reported via a gpio-keys node using SW_LID / EV_SW. + The GPIO is active-low (low = lid closed) and pulled up. + wakeup-source is set so that opening the lid can wake the system from + suspend. A sensor pinctrl group is added for the GPIO configuration. + +2. usbdp_phy1 lane mux (rockchip,dp-lane-mux = <2 3>) + The RK3588 usbdp_phy1 is a combo USB3 + DisplayPort PHY shared between + the USB3 host1 port (USB-A connector) and the DisplayPort output on the + GenBook board. Lanes 0+1 carry USB3 SuperSpeed to the USB-A socket; + lanes 2+3 are routed to the DP connector. + + Without this property the phy-rockchip-usbdp driver selects + UDPHY_MODE_USB and configures all four lanes as USB3. That conflicts + with the physical routing on this board: lanes 2+3 are not connected to + the USB-A socket, so the 4-lane USB3 training fails silently and the + USB3 host1 DWC3 controller (usb_host1_xhci) cannot enumerate devices. + + Setting rockchip,dp-lane-mux = <2 3> restricts USB3 to lanes 0+1, + matching the physical wiring, and enables correct SuperSpeed operation + on the USB-A port. + + The USB2 EHCI host1 controller (usb_host1_ehci) shares the USB power + domain with usb_host1_xhci. A stalled USB3 DWC3 probe can delay + power-domain activation in a way that prevents the EHCI hub (which + carries the integrated webcam) from being enumerated. With the correct + lane mux both controllers probe cleanly and the webcam is detected. + +Generated-by: Claude Sonnet 4.6 +Signed-off-by: Markus Fritsche +--- + .../rockchip/rk3588-coolpi-cm5-genbook.dts | 23 +++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +index 7c577a603cb5..e3954851b0cb 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include "rk3588-coolpi-cm5.dtsi" + +@@ -166,6 +167,21 @@ vcc5v0_otg: regulator-vcc5v0-otg { + pinctrl-0 = <&typec5v_pwren>; + vin-supply = <&vcc5v0_sys>; + }; ++ ++ gpio-key-lid { ++ compatible = "gpio-keys"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mh248_irq_gpio>; ++ ++ lid { ++ debounce-interval = <20>; ++ gpios = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>; ++ label = "Lid"; ++ linux,code = ; ++ linux,input-type = ; ++ wakeup-source; ++ }; ++ }; + }; + + &edp1 { +@@ -431,6 +447,12 @@ pcie_wake: pcie-wake { + rockchip,pins = <4 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; ++ ++ sensor { ++ mh248_irq_gpio: mh248-irq-gpio { ++ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; + }; + + &pwm6 { +@@ -512,6 +534,7 @@ &u2phy3_host { + }; + + &usbdp_phy1 { ++ rockchip,dp-lane-mux = <2 3>; + status = "okay"; + }; + +-- +2.54.0 + -- 2.47.3