Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions config/boards/radxa-dragon-q8b.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Qualcomm Snapdragon 8cx Gen 3 Adreno 690 Radxa Dragon Q8B
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add KERNEL_TEST_TARGET for CI coverage.

Pipeline validation recommends adding KERNEL_TEST_TARGET to specify which kernel branches should be tested for this board. Since this board uses KERNEL_TARGET="vendor", consider adding:

declare -g KERNEL_TEST_TARGET="vendor"
📋 Proposed addition
 declare -g BOARDFAMILY="sc8280xp"
 declare -g KERNEL_TARGET="vendor"
+declare -g KERNEL_TEST_TARGET="vendor"
🧰 Tools
🪛 GitHub Actions: Validate board configs / 0_Validate changed board configs.txt

[warning] 1-1: validate-board-config.py: 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 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).

declare -g BOARD_NAME="Radxa Dragon Q8B"
declare -g BOARD_VENDOR="radxa"
declare -g BOARD_MAINTAINER="HeyMeco"
declare -g INTRODUCED="2026"
declare -g BOARDFAMILY="sc8280xp"
declare -g KERNEL_TARGET="vendor"

declare -g BOOT_FDT_FILE="qcom/sc8280xp-radxa-dragon-q8b.dtb"

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
}

##
## Download sc8280xp firmware from radxa-pkg/radxa-firmware into the BSP package
##
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"
}

## Include board-specific firmware in the initrd
function post_family_tweaks_bsp__radxa_dragon_q8b_firmware_in_initrd() {
display_alert "Adding to bsp-cli" "${BOARD}: board firmware in initrd" "info"
declare file_added_to_bsp_destination
add_file_from_stdin_to_bsp_destination "/etc/initramfs-tools/hooks/q8b-firmware" <<- 'FIRMWARE_HOOK'
#!/bin/bash
[[ "$1" == "prereqs" ]] && exit 0
. /usr/share/initramfs-tools/hook-functions
for f in /lib/firmware/qcom/sc8280xp/*.mbn \
/lib/firmware/qcom/sc8280xp/radxa/dragon-q8b/* ; do
add_firmware "${f#/lib/firmware/}"
done
FIRMWARE_HOOK
run_host_command_logged chmod -v +x "${file_added_to_bsp_destination}"
}

105 changes: 8 additions & 97 deletions config/boards/thinkpad-x13s.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ declare -g BOARD_NAME="ThinkPad X13s"
declare -g BOARD_VENDOR="lenovo"
declare -g BOARD_MAINTAINER="PeterChrz rpardini"
declare -g INTRODUCED="2023"
declare -g BOARDFAMILY="uefi-arm64"
declare -g KERNEL_TARGET="sc8280xp"
declare -g BOARDFAMILY="sc8280xp"

declare -g BOOT_LOGO=desktop

Expand All @@ -19,59 +18,13 @@ declare -g BOOT_LOGO=desktop
# - deploy fprintd/libpam-fprintd (sic) for fingerprint authentication [done]
# - (ubuntu, mantic for sure): protection-domain-mapper's pd-mapper.service has a condition on "-laptop" kernel, use override to get rid of it [done]

# This board boots via EFI/Grub, but requires a DTB to be passed, from Grub, to the Kernel.
declare -g GRUB_CMDLINE_LINUX_DEFAULT="clk_ignore_unused pd_ignore_unused arm64.nopauth efi=noruntime" # iommu.passthrough=0 iommu.strict=0 pcie_aspm.policy=powersupersave
declare -g BOOT_FDT_FILE="qcom/sc8280xp-lenovo-thinkpad-x13s.dtb"

enable_extension "grub-with-dtb" # important, puts the whole DTB handling in place.

# Use the full firmware, complete linux-firmware plus Armbian's
declare -g BOARD_FIRMWARE_INSTALL="-full"

## DISABLED: jhovold must be on vacations. Kept here for reference and quick switchback.
#function DISABLED_post_family_config_branch_sc8280xp__jhovolds_wip_kernel() {
# declare -g KERNEL_MAJOR_MINOR="6.16" # Major and minor versions of this kernel.
# declare -g KERNELBRANCH='branch:wip/sc8280xp-6.16' # this is down to 25 patches, from 47 patches around 6.15, from 28 around 6.13
# declare -g KERNELSOURCE='https://github.com/jhovold/linux.git'
# declare -g LINUXCONFIG="linux-${ARCH}-${BRANCH}" # for this board: linux-arm64-sc8280xp
# display_alert "Set up jhovold's kernel ${KERNELBRANCH} for" "${BOARD}" "info"
#}

function post_family_config_branch_sc8280xp__x13s_steenv_kernel() {
declare -g KERNEL_MAJOR_MINOR="7.0" # Major and minor versions of this kernel.
declare -g KERNELBRANCH='branch:lenovo-x13s-linux-7.0.y'
declare -g KERNELSOURCE='https://github.com/steev/linux.git'
declare -g LINUXCONFIG="linux-${ARCH}-${BRANCH}" # for this board: linux-arm64-sc8280xp
display_alert "Set up steev's kernel ${KERNELBRANCH} for" "${BOARD}" "info"
}

function x13s_is_userspace_supported() {
[[ "${RELEASE}" == "trixie" || "${RELEASE}" == "sid" || "${RELEASE}" == "noble" || "${RELEASE}" == "oracular" ]] && return 0
return 1
}

# https://wiki.debian.org/InstallingDebianOn/Thinkpad/X13s
function post_family_config__debian_now_has_userspace_for_the_x13s() {
if ! x13s_is_userspace_supported; then
if [[ "${RELEASE}" != "" ]]; then
display_alert "Missing userspace for ${BOARD}" "${RELEASE} does not have the userspace necessary to support the ${BOARD}" "warn"
fi
return 0
fi

display_alert "Setting up extra Debian packages for ${BOARD}" "${RELEASE}///${BOARD}" "info"
add_packages_to_image "bluez" "bluetooth" # for bluetooth stuff
add_packages_to_image "protection-domain-mapper" # for charging; see https://packages.ubuntu.com/protection-domain-mapper and https://packages.debian.org/protection-domain-mapper
add_packages_to_image "qrtr-tools" # for charging; see https://packages.ubuntu.com/qrtr-tools and https://packages.debian.org/qrtr-tools
add_packages_to_image "alsa-ucm-conf" # for audio; see https://packages.ubuntu.com/alsa-ucm-conf and https://packages.debian.org/alsa-ucm-conf - we need 1.2.10 + patches, see below
add_packages_to_image "acpi" # general ACPI support
add_packages_to_image "zstd" # for zstd compression of initrd
add_packages_to_image "mtools" # for access to the EFI partition
add_packages_to_image "fprintd" # for fingerprint reader; see https://packages.ubuntu.com/fprintd and https://packages.debian.org/fprintd
add_packages_to_image "libpam-fprintd" # for fingerprint reader PAM support; see https://packages.ubuntu.com/libpam-fprintd and https://packages.debian.org/libpam-fprintd

# Also needed, not listed here:
# - mesa > 23.1.5; see https://packages.ubuntu.com/mesa-vulkan-drivers and https://packages.debian.org/mesa-vulkan-drivers
sc8280xp_is_userspace_supported || return 0
add_packages_to_image "fprintd" # for fingerprint reader; see https://packages.ubuntu.com/fprintd and https://packages.debian.org/fprintd
add_packages_to_image "libpam-fprintd" # for fingerprint reader PAM support; see https://packages.ubuntu.com/libpam-fprintd and https://packages.debian.org/libpam-fprintd
}

# Distros don't carry the necessary alsa-ucm-conf files.
Expand All @@ -82,7 +35,7 @@ function post_family_config__debian_now_has_userspace_for_the_x13s() {
# This means the fixes will be lost if package is updated, so we apt-mark it to hold.
# Also means that this will break when ucm package is actually updated, so we can remove this when it is upstreamed.
function pre_customize_image__x13s_debian_ucm_hack_via_patch() {
if ! x13s_is_userspace_supported; then
if ! sc8280xp_is_userspace_supported; then
return 0
fi

Expand Down Expand Up @@ -114,33 +67,19 @@ function post_family_tweaks_bsp__thinkpad_x13s_bsp_bluetooth_addr() {
EOD
}

function post_family_tweaks_bsp__thinkpad_x13s_bsp_always_start_pdmapper() {
### (At least) Ubuntu's version of protection-domain-mapper's pd-mapper.service has a kernel condition.
### On Debian, this does not hurt.
### Remove it using a systemd override.
add_file_from_stdin_to_bsp_destination "/etc/systemd/system/pd-mapper.service.d/override.conf" <<- EOD
[Unit]
Description=Qualcomm PD mapper service (always starts)
ConditionKernelVersion=
EOD
}

##
## Include certain firmware in the initrd
## Include board-specific firmware in the initrd (blobs are shipped via armbian-firmware-full)
##
function post_family_tweaks_bsp__thinkpad_x13s_bsp_firmware_in_initrd() {
display_alert "Adding to bsp-cli" "${BOARD}: firmware in initrd" "info"
declare file_added_to_bsp_destination # will be filled in by add_file_from_stdin_to_bsp_destination
display_alert "Adding to bsp-cli" "${BOARD}: board firmware in initrd" "info"
declare file_added_to_bsp_destination
add_file_from_stdin_to_bsp_destination "/etc/initramfs-tools/hooks/x13s-firmware" <<- 'FIRMWARE_HOOK'
#!/bin/bash
[[ "$1" == "prereqs" ]] && exit 0
. /usr/share/initramfs-tools/hook-functions
for f in /lib/firmware/qcom/sc8280xp/LENOVO/21BX/* ; do
add_firmware "${f#/lib/firmware/}"
done
add_firmware "qcom/a660_sqe.fw" # extra one for dpu
add_firmware "qcom/a660_gmu.bin" # extra one for gpu
add_firmware "qcom/a690_gmu.bin" # extra one for gpu (is a symlink)
FIRMWARE_HOOK
run_host_command_logged chmod -v +x "${file_added_to_bsp_destination}"
}
Expand Down Expand Up @@ -174,31 +113,3 @@ function post_family_tweaks_bsp__thinkpad_x13s_bsp_modules_in_initrd() {
EXTRA_MODULES

}

# armbian-firstrun waits for systemd to be ready, but snapd.seeded might cause it to hang due to wrong clock.
# if the battery runs out, the clock is reset to 1970. This causes snapd.seeded to hang, and armbian-firstrun to hang.
function pre_customize_image__disable_snapd_seeded() {
[[ "${DISTRIBUTION}" != "Ubuntu" ]] && return 0 # only needed for Ubuntu
display_alert "Disabling snapd.seeded" "${BOARD}" "info"
chroot_sdcard systemctl disable snapd.seeded.service "||" true
}

# Utility to get firmware needed; this is used to populate armbian/firmware, and is here for reference only.
# TODO 20251005: ironrobin has dropped all firmware, wonder if this has been upstreamed?
function x13s_obtain_firmware() {
display_alert "Getting extra firmware for ${BOARD}" "${RELEASE}///${BOARD}" "info"
declare fw_target="${SDCARD}/lib/firmware"
mkdir -p "${fw_target}/qcom/sc8280xp/LENOVO/21BX"

# video acceleration firmware/interconnect stuff; get it from ironrobin's repo;
curl -o "${fw_target}/qcom/sc8280xp/LENOVO/21BX/qcvss8280.mbn" \
"https://raw.githubusercontent.com/ironrobin/x13s-alarm/trunk/x13s-firmware/qcvss8280.mbn"

# add a link to audio fw
(cd "${fw_target}/qcom/sc8280xp" && ln -s "LENOVO/21BX/audioreach-tplg.bin" "SC8280XP-LENOVO-X13S-tplg.bin")

# gpu, link 690 to 660 gmu
(cd "${fw_target}/qcom/" && ln -s a660_gmu.bin a690_gmu.bin)

return 0
}
Loading