SC8280XP: Initial refactor from board to family config#9818
Conversation
📝 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 and Bluetooth customization. ChangesSC8280XP Family Consolidation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested labels
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", |
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>
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
| @@ -0,0 +1,58 @@ | |||
| # Qualcomm Snapdragon 8cx Gen 3 Adreno 690 Radxa Dragon Q8B | |||
There was a problem hiding this comment.
Enhance the first-line comment with complete hardware specifications.
The first-line comment is missing critical hardware details. As per coding guidelines, it must specify core count, RAM options, and key connectivity/storage features (WiFi, BT, USB, eMMC, etc.) since this text is used during interactive compilation.
📋 Suggested enhancement
-# Qualcomm Snapdragon 8cx Gen 3 Adreno 690 Radxa Dragon Q8B
+# Qualcomm Snapdragon 8cx Gen 3 octa core 4GB-16GB eMMC WiFi BT USB3 Adreno 690 Radxa Dragon Q8B(Adjust RAM range and features based on actual hardware specifications)
Based on learnings: In Armbian board configuration files, the first-line comment must contain a dedicated hardware feature description including SoC model, core count, RAM options, and key features (connectivity, storage, special features), as this text is used during interactive compilation.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Qualcomm Snapdragon 8cx Gen 3 Adreno 690 Radxa Dragon Q8B | |
| # Qualcomm Snapdragon 8cx Gen 3 octa core 4GB-16GB eMMC WiFi BT USB3 Adreno 690 Radxa Dragon Q8B |
🧰 Tools
🪛 GitHub Actions: Validate board configs / 0_Validate changed board configs.txt
[warning] 1-1: KERNEL_TEST_TARGET: recommended, comma-separated list of branches to test (e.g. current,edge)
🪛 GitHub Actions: Validate board configs / Validate changed board configs
[warning] 1-1: KERNEL_TEST_TARGET: recommended, comma-separated list of branches to test (e.g. current,edge).
🪛 GitHub Check: Validate changed board configs
[warning] 1-1:
KERNEL_TEST_TARGET: recommended, comma-separated list of branches to test (e.g. current,edge)
🤖 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` at 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.
Source: Learnings
| function post_family_tweaks_bsp__radxa_dragon_q8b_bluetooth_addr() { | ||
| ### The bluetooth does not have a public MAC address set in DT, and BT won't start without one. | ||
| ### Use a systemd override to hook up setting a public-addr before starting bluetoothd | ||
| declare random_mac_address="" # would be much better to rnd mac on board-side though | ||
| random_mac_address=$(printf '02:%02X:%02X:%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256))) | ||
| display_alert "Adding systemd override for bluetooth public address init" "${BOARD} :: bt mac ${random_mac_address}" "info" | ||
|
|
||
| add_file_from_stdin_to_bsp_destination "/etc/systemd/system/bluetooth.service.d/override.conf" <<- EOD | ||
| [Service] | ||
| ExecStartPre=/bin/bash -c 'sleep 5 && yes | btmgmt public-addr ${random_mac_address}' | ||
| EOD | ||
| } |
There was a problem hiding this comment.
Bluetooth MAC address collision: all devices will share the same MAC.
The random MAC is generated at BSP build time (line 15), meaning all devices flashed with the same image will have identical Bluetooth addresses. This will cause conflicts when multiple devices are powered on in the same area. While the inline comment on line 14 acknowledges this limitation, it remains a functional issue for production deployments.
💡 Recommended approach
Move MAC generation to first-boot or every-boot via a systemd service or script in /etc/network/if-up.d/, deriving the address from a hardware-unique seed (e.g., CPU serial, eMMC CID) or generating and persisting it on first boot in /etc/machine-id or a dedicated file under /var/lib/.
🤖 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
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.
| function post_family_tweaks_bsp__radxa_dragon_q8b_download_firmware() { | ||
| display_alert "Downloading sc8280xp firmware" "${BOARD}: radxa-pkg/radxa-firmware" "info" | ||
| declare fw_base_url="https://raw.githubusercontent.com/radxa-pkg/radxa-firmware/main/radxa-firmware-sc8280xp/lib/firmware/qcom/sc8280xp" | ||
| declare fw_dest="${destination}/lib/firmware/qcom/sc8280xp" | ||
|
|
||
| run_host_command_logged mkdir -pv "${fw_dest}" "${fw_dest}/radxa/dragon-q8b" | ||
|
|
||
| for fw in qccdsp8280.mbn qcdxkmsuc8280.mbn qcslpi8280.mbn qcvss8280.mbn; do | ||
| run_host_command_logged wget -q --show-progress "${fw_base_url}/${fw}" -O "${fw_dest}/${fw}" | ||
| done | ||
|
|
||
| run_host_command_logged wget -q --show-progress \ | ||
| "${fw_base_url}/radxa/dragon-q8b/qcadsp8280.mbn" \ | ||
| -O "${fw_dest}/radxa/dragon-q8b/qcadsp8280.mbn" | ||
| } |
There was a problem hiding this comment.
Add checksum validation and version pinning for firmware downloads.
The firmware files are downloaded from the main branch without version pinning or integrity verification. This creates two risks:
- Security: No checksum validation means corrupted or tampered firmware could be silently included in the image.
- Stability: Pulling from
mainmeans upstream changes can break builds without warning.
🔒 Recommended improvements
- Pin to a specific commit SHA or release tag in the URL instead of
main. - Add SHA256 checksum verification after each
wget:echo "<expected-sha256> ${fw_dest}/${fw}" | sha256sum -c -
- Consider using
wget --tries=3 --timeout=10and checking$?to handle transient network failures gracefully.
🤖 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 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.
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