SC8280XP: Initial refactor from board to family config#9818
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR consolidates SC8280XP Snapdragon board support by extracting shared firmware, service, and userspace logic into a new family configuration. ThinkPad X13s is refactored to delegate duplicated concerns to the family level. Radxa Dragon Q8B board is added using the new family foundation with board-specific firmware variants, Bluetooth customization, and audio/graphics configuration. ChangesSC8280XP Family Consolidation and Board Onboarding
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
config/sources/families/sc8280xp.conf (2)
28-28: 💤 Low valueFactor out duplicate GRUB command line.
The same
GRUB_CMDLINE_LINUX_DEFAULTvalue is defined for both branches. Consider declaring it once before or after the case statement to reduce duplication.♻️ Proposed refactor
+declare -g GRUB_CMDLINE_LINUX_DEFAULT="clk_ignore_unused pd_ignore_unused arm64.nopauth efi=noruntime" + case $BRANCH in sc8280xp) declare -g KERNEL_MAJOR_MINOR="7.0" declare -g KERNELSOURCE='https://github.com/steev/linux.git' declare -g KERNELBRANCH='branch:lenovo-x13s-linux-7.0.y' declare -g LINUXCONFIG="linux-${ARCH}-${BRANCH}" - declare -g GRUB_CMDLINE_LINUX_DEFAULT="clk_ignore_unused pd_ignore_unused arm64.nopauth efi=noruntime" ;; vendor) declare -g KERNEL_MAJOR_MINOR="7.0" declare -g KERNELSOURCE='https://github.com/radxa/kernel.git' declare -g KERNELBRANCH='branch:linux-7.0.2' - declare -g GRUB_CMDLINE_LINUX_DEFAULT="clk_ignore_unused pd_ignore_unused arm64.nopauth efi=noruntime" ;; esacAlso applies to: 35-35
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@config/sources/families/sc8280xp.conf` at line 28, The GRUB_CMDLINE_LINUX_DEFAULT variable is duplicated in both case branches; to fix, remove the duplicate assignments inside the case and declare a single GRUB_CMDLINE_LINUX_DEFAULT="clk_ignore_unused pd_ignore_unused arm64.nopauth efi=noruntime" once (either before or after the case statement) so both branches inherit the same value; update any branch-specific logic only if it needs to augment that base value rather than reassign it.
51-54: 💤 Low valueHardcoded release list requires manual maintenance.
The function checks for specific Debian/Ubuntu releases. This will need updates for each new release (e.g., when Debian 14 or Ubuntu 26.04 are released). Consider documenting this maintenance requirement or adding a comment explaining why specific releases are gated.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@config/sources/families/sc8280xp.conf` around lines 51 - 54, The release check in sc8280xp_is_userspace_supported() currently hardcodes specific releases and requires manual updates for new OS versions; add an explanatory comment above the function referencing why only these releases are supported, include a TODO explaining that RELEASE must be updated when new Debian/Ubuntu releases are added (e.g., Debian 14/Ubuntu 26.04), and optionally note where RELEASE is defined so future maintainers know how to change it; keep the function body unchanged but document the maintenance requirement and expected update procedure.config/boards/radxa-dragon-q8b.conf (1)
11-22: ⚡ Quick winMove Bluetooth MAC initialization to family config to eliminate duplication.
This function is duplicated identically in
thinkpad-x13s.conf. Both boards share the same logic for Bluetooth MAC address initialization and belong to thesc8280xpfamily. Move the function toconfig/sources/families/sc8280xp.confaspost_family_tweaks_bsp__sc8280xp_bluetooth_addr()and remove the board-specific versions. This follows the existing pattern used bypost_family_tweaks_bsp__sc8280xp_always_start_pdmapper()in the same file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@config/boards/radxa-dragon-q8b.conf` around lines 11 - 22, The bluetooth MAC init function is duplicated across boards; move the implementation into the sc8280xp family file and remove the board-specific copies: create post_family_tweaks_bsp__sc8280xp_bluetooth_addr() in the families sc8280xp config with the same body (random_mac_address generation, display_alert and add_file_from_stdin_to_bsp_destination override), delete post_family_tweaks_bsp__radxa_dragon_q8b_bluetooth_addr() and the identical thinkpad-x13s version, and ensure no board-specific callers need renaming (the family hook name should match existing family-hook usage alongside post_family_tweaks_bsp__sc8280xp_always_start_pdmapper()).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/boards/radxa-dragon-q8b.conf`:
- Line 1: The board config is missing a CI hint for which kernel branches to
test; add a global declaration for KERNEL_TEST_TARGET matching the board's
kernel choice (KERNEL_TARGET value "vendor") so CI will run kernel tests for the
vendor kernel—update the radxa-dragon-q8b.conf to declare the KERNEL_TEST_TARGET
variable as a global and set it to "vendor" (refer to KERNEL_TEST_TARGET and
existing KERNEL_TARGET="vendor" in the file).
---
Nitpick comments:
In `@config/boards/radxa-dragon-q8b.conf`:
- Around line 11-22: The bluetooth MAC init function is duplicated across
boards; move the implementation into the sc8280xp family file and remove the
board-specific copies: create post_family_tweaks_bsp__sc8280xp_bluetooth_addr()
in the families sc8280xp config with the same body (random_mac_address
generation, display_alert and add_file_from_stdin_to_bsp_destination override),
delete post_family_tweaks_bsp__radxa_dragon_q8b_bluetooth_addr() and the
identical thinkpad-x13s version, and ensure no board-specific callers need
renaming (the family hook name should match existing family-hook usage alongside
post_family_tweaks_bsp__sc8280xp_always_start_pdmapper()).
In `@config/sources/families/sc8280xp.conf`:
- Line 28: The GRUB_CMDLINE_LINUX_DEFAULT variable is duplicated in both case
branches; to fix, remove the duplicate assignments inside the case and declare a
single GRUB_CMDLINE_LINUX_DEFAULT="clk_ignore_unused pd_ignore_unused
arm64.nopauth efi=noruntime" once (either before or after the case statement) so
both branches inherit the same value; update any branch-specific logic only if
it needs to augment that base value rather than reassign it.
- Around line 51-54: The release check in sc8280xp_is_userspace_supported()
currently hardcodes specific releases and requires manual updates for new OS
versions; add an explanatory comment above the function referencing why only
these releases are supported, include a TODO explaining that RELEASE must be
updated when new Debian/Ubuntu releases are added (e.g., Debian 14/Ubuntu
26.04), and optionally note where RELEASE is defined so future maintainers know
how to change it; keep the function body unchanged but document the maintenance
requirement and expected update procedure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3ea32700-b275-4c71-bc4d-f2b3b8475a7c
📒 Files selected for processing (5)
config/boards/radxa-dragon-q8b.confconfig/boards/thinkpad-x13s.confconfig/kernel/linux-sc8280xp-sc8280xp.configconfig/kernel/linux-sc8280xp-vendor.configconfig/sources/families/sc8280xp.conf
🚫 Missing required board assetsThis PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
Missing items
Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check. |
|
This probably works, but goes in the opposite direction I intended: sc8280xp was just a different branch from the default UEFI with the hope that enough will be mainlined so that it could just use the standard UEFI kernel (eg just drop the custom BRANCH and use current/edge, plus grub-with-dtb (or recently the With this move that gets further away, not closer, and I can't really tell what it buys us? In practice the dragon thing gets its own kernel, and so does the x13s. Also, has "the other sc8280xp" ("Windows Dev Kit 2023", |
4d5ddff to
122f42a
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/boards/radxa-dragon-q8b.conf`:
- Around line 27-41: The function
post_family_tweaks_bsp__radxa_dragon_q8b_download_firmware downloads firmware
without security or stability safeguards. First, replace the hardcoded 'main'
branch in the fw_base_url variable with a specific commit SHA or release tag to
pin the version. Second, after each wget command (both in the for loop and the
separate radxa/dragon-q8b download), add SHA256 checksum validation by piping
the expected checksum and file path to sha256sum with the -c flag to verify
integrity. Third, optionally enhance the wget commands with retry logic using
--tries=3 and --timeout=10 parameters, and check the exit status ($?) to handle
network failures gracefully.
- Around line 11-22: The Bluetooth MAC address is generated at build time in the
post_family_tweaks_bsp__radxa_dragon_q8b_bluetooth_addr function, causing all
devices to share the same address. Move the random_mac_address generation from
build-time to runtime by creating a systemd service or script in
/etc/network/if-up.d/ that runs at first-boot or every-boot. Instead of using
RANDOM at build time, generate the MAC address at runtime using a
hardware-unique seed such as CPU serial or eMMC CID, or generate it once on
first boot and persist it in a dedicated file under /var/lib/ or
/etc/machine-id. Update the bluetooth.service.d/override.conf to source the MAC
from this persistent location.
- Line 1: The first-line comment in the radxa-dragon-q8b.conf file lacks
critical hardware specification details needed for interactive compilation.
Expand the existing comment that currently reads "# Qualcomm Snapdragon 8cx Gen
3 Adreno 690 Radxa Dragon Q8B" to include the SoC core count (number of CPU
cores), available RAM configurations/options, and key hardware features such as
WiFi version, Bluetooth support, USB port details, eMMC storage capacity, and
any other relevant connectivity or storage features specific to this board
model. Ensure the enhanced comment provides comprehensive hardware information
while remaining a single line comment at the start of the file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bd1a6635-ded7-4545-afd6-d6cafba982df
📒 Files selected for processing (2)
config/boards/radxa-dragon-q8b.confconfig/boards/thinkpad-x13s.conf
🚧 Files skipped from review as they are similar to previous changes (1)
- config/boards/thinkpad-x13s.conf
|
Worked on this a bit and pushed a few things. Audio is in now through an ALSA UCM profile, so PipeWire gives you proper Headphones, HDMI, DisplayPort and headset-mic sinks. It works, but I want to flag one thing: the headphone jack has audible distortion at higher volume. The wcd938x analog side has no real documentation, so it has been hard to pin down. I have reached out to Sophon at Radxa to see if there is a known fix, since I would rather not just guess at it. HDMI and DisplayPort audio are clean. On the GPU side, native freedreno GL corrupts the desktop at 4K on the Adreno 690, so I route the system GL through zink. Chromium needed its own handling since it is ANGLE-only, so it gets an ANGLE-GLES drop-in on native Wayland. That clears the same 4K glitch in the browser and also puts H264 and VP9 video on the Iris VPU instead of decoding in software. The kernel moves to the radxa vendor 7.0.11 branch, which is what enables the VPU. The board now pulls the VPU firmware and loads the GPU zap shader from the initrd so it all comes up at early boot. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@config/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/usr/share/alsa/ucm2/Qualcomm/sc8280xp/Dragon-Q8B-HiFi.conf`:
- Around line 10-14: The DisableSequence block only contains cset commands to
disable DISPLAY_PORT_RX routes but is missing disable commands for the non-DP
routes that are enabled in the SectionVerb enable block (referenced at lines 3
and 7). Add corresponding cset disable commands to the DisableSequence block for
all non-DP audio mixer routes that were enabled in the SectionVerb, ensuring
that every audio path enabled during setup is properly disabled during teardown
to prevent codec/TX paths from remaining latched and causing stale audio state
and unnecessary power consumption.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a1711ecf-f25e-4d7c-ac64-0683d87532e3
📒 Files selected for processing (6)
config/boards/radxa-dragon-q8b.confconfig/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/etc/chromium.d/zzz-armbian-angle-glesconfig/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/etc/environment.d/zz-armbian-mesa-zink.confconfig/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/usr/share/alsa/ucm2/Qualcomm/sc8280xp/Dragon-Q8B-HiFi.confconfig/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/usr/share/alsa/ucm2/conf.d/sc8280xp/RadxaComputerCo.Ltd.-RadxaDragonQ8B-1.1.confconfig/sources/families/sc8280xp.conf
✅ Files skipped from review due to trivial changes (2)
- config/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/etc/environment.d/zz-armbian-mesa-zink.conf
- config/optional/boards/radxa-dragon-q8b/_packages/bsp-cli/etc/chromium.d/zzz-armbian-angle-gles
🚧 Files skipped from review as they are similar to previous changes (1)
- config/boards/radxa-dragon-q8b.conf
|
I had only tried up to 1440P@120hz so interesting 4k was bugged but at least Zink comes into rescue. I hadn’t had any luck with IRIS decoding either so the ANGLE GLES route seems to be a nice solution. Gonna give this a try and we can probably merge this this weekend |
Same thing happens on the AYN Odin 3, and we are not the only ones, other projects lean on zink to work around it too. Honestly I think the Odin 3 is still too early to land in Armbian. It needs too many tweaks, and Mesa has not shipped the driver for that GPU (Adreno 830) in a stable release yet, so we would be stuck on bleeding-edge builds. As soon as Mesa ships something usable, the work is ready on my side and I will open a PR for it. |
|
Update on the headphone jack: I got it working 🎉 The distortion I flagged earlier is gone, and after a few UCM tweaks it now plays clean and at a proper volume 😄 I turn the rx-macro companders off, trim the digital level for headroom, and run the WCD9385 HPH amp in class-AB HIFI with HD2. The compander and headroom hint came from radxa's Q6A config (thanks Sophon for pointing me there 🙏), but the values are tuned by me for this board. It is in the latest commit. |
|
Ref the x13s: let it not be a blocker for the dragon. We can go ahead -- my guess is that we'll all eventually land on |
Yup but after checking with Radxa only Q6A has stable SMBIOS for now and Q8B will see some changes there. In the end family change will basically be just exchanging kernel for these and the type we have here is regular mainline and mainline + patches. Quite surprising tbh how much of the qcom stack is still not fully upstream (even for this SoC) but eventually we will only have mainline. Linux 8.0 maybe who knows 🤷♂️ |
No sc8280xp board had an onboard MAC, so the family config left CONFIG_ETHERNET off. The Dragon Q8B is the first with one: two Synopsys GMACs behind a TC9563 PCIe switch. Enable the ethernet menu and the stmmac dwmac-tc956x glue so both QCA8081 ports come up. Signed-off-by: SuperKali <hello@superkali.me>
Ship the radxa HiFi UCM profile so PipeWire exposes clean Headphones, HDMI and DisplayPort sinks plus the headset mic. Installed as a per-board bsp-cli overlay under ucm2, matched by card long name. Signed-off-by: SuperKali <hello@superkali.me>
Native freedreno GL corrupts at 4K on the Adreno 690, so route the system GL stack through zink. Chromium gets an ANGLE-GLES drop-in on native Wayland, which clears the same glitch and lets the Iris VPU hardware-decode H264 and VP9 instead of falling back to software. Signed-off-by: SuperKali <hello@superkali.me>
The radxa vendor branch moves to linux-7.0.11, which enables the Iris VPU. The Q8B then fetches the VPU firmware and loads the GPU zap shader from the initrd so the decoder and GPU come up during early boot. Signed-off-by: SuperKali <hello@superkali.me>
The WCD9385 headphone output crackled with pumping bass. Turn the rx-macro companders off and trim the digital level for headroom, then run the HPH amp in class-AB HIFI with HD2 for clean, loud output. The compander and headroom part follows radxa's Q6A config, the rest is tuned for this board. Signed-off-by: SuperKali <hello@superkali.me>
zink and the V4L2 GL decode path corrupt Chromium's 4K render with white UI tiles, a glitch native freedreno does not have. Drop both and run ANGLE on native freedreno like Firefox does: the UI stays clean and GPU composited, video just decodes on the CPU. Signed-off-by: SuperKali <hello@superkali.me>
Noble's alsa-ucm-conf 1.2.10 has no codecs/qcom-lpass/rx-macro/init.conf, so the Include of it made the whole card profile fail to import: audio dropped to a dummy sink with no HDMI and no headphones. Fold the rx-macro init csets into the card BootSequence so the profile stops depending on that package file. Signed-off-by: SuperKali <hello@superkali.me>
zink as the system GL corrupts the Chromium 4K render and the V4L2 GL decode path, so the browser uses native freedreno via ANGLE-GLES with CPU video decode. The override is unnecessary here. Signed-off-by: SuperKali <hello@superkali.me>
Export MESA_LOADER_DRIVER_OVERRIDE=zink only in the Chromium launcher env so the browser renders on Turnip and fixes the 4K render, while the desktop GL stays on native freedreno. Signed-off-by: SuperKali <hello@superkali.me>
Signed-off-by: SuperKali <hello@superkali.me>
The vendor hpd recovery work gated the link clocks under active scanout and raced compositor modesets, hard resetting the SoC on replugs that change the EDID behind the onboard CH7218A. Retrain the link in place under the modeset locks, recheck the bridge EDID after plug and keep the transient training noise out of dmesg. Signed-off-by: SuperKali <hello@superkali.me>
Switch DRM_MSM and its OCMEM dependency to built-in so the display driver probes from the kernel image instead of depending on initrd module order. Remaining hunks are kernel-config normalization churn. Signed-off-by: SuperKali <hello@superkali.me>
d67eec7 to
146b259
Compare
|
Pushed the display fixes for the Q8B. The board was hard resetting itself on hotplugs that change the EDID (KVMs, monitor swaps): the vendor DP recovery was switching clocks off mid-scanout and racing the compositor modeset. The series retrains the link in place instead, and also rereads the bridge EDID a moment after plug, since the CH7218A likes to hand out its 1080p fallback while it is still settling. Full story is in the patch descriptions. Tested here behind a GLKVM: EDID swaps between 1080p120, 1440p and 4K30 with replugs, no more resets, and 4K30 output finally works 🎉 Second commit builds DRM_MSM into the image so the display does not depend on initrd module order, the rest of the config diff is just kernel-config churn. |
|
✅ This PR has been reviewed and approved — all set for merge! |
Derive the Bluetooth public address on the device from /etc/machine-id instead of a build-time random, so every board gets a stable unique MAC from the same image. Pin the radxa-firmware download to a commit and complete the first-line hardware description. Signed-off-by: SuperKali <hello@superkali.me>
Absence of this in x13 config will most likely break CI. |
…ption The board config declared no KERNEL_TARGET, which breaks CI matrix generation, and the first-line description repeated Qualcomm three times. Point the target at the sc8280xp branch and rewrite the line in the standard hardware-summary format. Signed-off-by: SuperKali <hello@superkali.me>
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
In preparation for future boards using the sc8280xp / Snapdragon 8cx Gen 3 SoC I refactored the Thinkpad X13s to a family config similar to how we handle other boards and their families. What we need to do now is to test for regressions. @rpardini seems to be the active maintainer around this board / SoC so it would be nice if you could take a look over this too.
How Has This Been Tested?
Summary by CodeRabbit
Release Notes
New Features
Improvements
Performance / Compatibility