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
158 changes: 153 additions & 5 deletions config/boards/recomputer-rk3588-devkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BOARD_VENDOR="seeed-studio"
INTRODUCED="2025"
BOOTCONFIG="recomputer-rk3588-devkit_defconfig" # vendor name, not standard, see hook below, set BOOT_SOC below to compensate
BOOT_SOC="rk3588"
KERNEL_TARGET="vendor"
KERNEL_TARGET="vendor,edge"
KERNEL_TEST_TARGET="vendor"
FULL_DESKTOP="yes"
BOOT_LOGO="desktop"
Expand All @@ -16,21 +16,37 @@ BOOT_SUPPORT_SPI="yes"
BOOT_SPI_RKSPI_LOADER="yes"
IMAGE_PARTITION_TABLE="gpt"
OTA_ENABLE="yes"
SERIALCON="ttyFIQ0,ttyGS0"
BT_UART="/dev/ttyS6"
PACKAGE_LIST_BOARD="net-tools rfkill pulseaudio-module-bluetooth fail2ban"
AIC8800_TYPE="sdio"
enable_extension "radxa-aic8800"

source "${SRC}/config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc"
# select case for BRANCH=vendor to source the Seeed Studio recomputer-rk35xx-common.inc
case "${BRANCH}" in
vendor)
enable_extension "radxa-aic8800"
declare -g PACKAGE_LIST_BOARD="net-tools rfkill pulseaudio-module-bluetooth fail2ban"
declare -g SERIALCON="ttyFIQ0,ttyGS0"
source "${SRC}/config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc"
;;

*)
# @TODO: there is no aic8800 support for kernel > v7.0 yet

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Um if you mean radxa aic8800, then it has been updated to work up to 7.2 now
radxa-pkg/aic8800@bd01abe

# mainline DTB name is different
display_alert "$BOARD" "Using mainline kernel DTB: rockchip/rk3588-recomputer-devkit.dtb -> boot_fdt_file" "warn"
declare -g BOOT_FDT_FILE="rockchip/rk3588-recomputer-devkit.dtb"
# userspace for manipulating the u-boot env stored in SPI flash
PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
;;
Comment on lines +31 to +38

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use declare -g for PACKAGE_LIST_BOARD.

Line 26 uses declare -g PACKAGE_LIST_BOARD in the vendor branch. Line 37 uses a plain assignment. Board configs are sourced inside a function in the Armbian build, so a plain assignment can stay function-local and the package can be dropped for edge. Keep both branches consistent.

♻️ Proposed fix
 		# userspace for manipulating the u-boot env stored in SPI flash
-		PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
+		declare -g PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
 		;;
📝 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.

Suggested change
*)
# @TODO: there is no aic8800 support for kernel > v7.0 yet
# mainline DTB name is different
display_alert "$BOARD" "Using mainline kernel DTB: rockchip/rk3588-recomputer-devkit.dtb -> boot_fdt_file" "warn"
declare -g BOOT_FDT_FILE="rockchip/rk3588-recomputer-devkit.dtb"
# userspace for manipulating the u-boot env stored in SPI flash
PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
;;
*)
# `@TODO`: there is no aic8800 support for kernel > v7.0 yet
# mainline DTB name is different
display_alert "$BOARD" "Using mainline kernel DTB: rockchip/rk3588-recomputer-devkit.dtb -> boot_fdt_file" "warn"
declare -g BOOT_FDT_FILE="rockchip/rk3588-recomputer-devkit.dtb"
# userspace for manipulating the u-boot env stored in SPI flash
declare -g PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
;;
🤖 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/recomputer-rk3588-devkit.conf` around lines 31 - 38, Update the
PACKAGE_LIST_BOARD assignment in the wildcard branch to use declare -g, matching
the vendor branch, so libubootenv-tool remains available when the board
configuration is sourced inside a function.

esac

function post_family_config__recomputer_rk3588_devkit_use_seeed_bootscript() {
[[ "${BRANCH}" == "vendor" ]] || return 0 # only for BRANCH=vendor
display_alert "$BOARD" "Using Seeed bootscript: boot-seeed-rk35xx.cmd -> boot.cmd" "info"
declare -g BOOTSCRIPT="boot-seeed-rk35xx.cmd:boot.cmd"
}

# Install libmali package for RK3588 GPU userspace
function pre_install_distribution_specific__recomputer_rk3588_install_libmali() {
[[ "${BRANCH}" == "vendor" ]] || return 0 # only for BRANCH=vendor
display_alert "Installing Mali GPU libraries from APT repo" "libmali-g610" "info"

seeed_recomputer_install_from_apt libmali-valhall-g610-g24p0-x11-wayland-gbm
Expand All @@ -39,6 +55,7 @@ function pre_install_distribution_specific__recomputer_rk3588_install_libmali()

# Install RK camera engine package for RK3588
function pre_install_distribution_specific__recomputer_rk3588_install_camera_engine() {
[[ "${BRANCH}" == "vendor" ]] || return 0 # only for BRANCH=vendor
display_alert "Installing camera engine from APT repo" "camera-engine-rkaiq" "info"

seeed_recomputer_install_from_apt camera-engine-rkaiq-rk3588
Expand All @@ -48,6 +65,7 @@ function pre_install_distribution_specific__recomputer_rk3588_install_camera_eng

# Audio naming: HDMI0, HDMI1, HDMI-In, DP0, ES8311
function post_family_tweaks__recomputer_rk3588_naming_audios() {
[[ "${BRANCH}" == "vendor" ]] || return 0 # only for BRANCH=vendor
display_alert "$BOARD" "Renaming recomputer rk3588 devkit audios" "info"

mkdir -p "${SDCARD}"/etc/udev/rules.d/
Expand All @@ -57,3 +75,133 @@ function post_family_tweaks__recomputer_rk3588_naming_audios() {
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-dp0-sound", ENV{SOUND_DESCRIPTION}="DP0 Audio"' >> "${SDCARD}"/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-es8311-sound", ENV{SOUND_DESCRIPTION}="ES8311 Audio"' >> "${SDCARD}"/etc/udev/rules.d/90-naming-audios.rules
}

#### mainline u-boot for edge/current <==-------------------------------------------------------------------------------

# Mainline U-Boot
function post_family_config__recomputer_rk3588_devkit_use_mainline_uboot() {
[[ "${BRANCH}" == "vendor" ]] && return 0 # only for BRANCH=current/edge, not vendor

display_alert "$BOARD" "Using mainline U-Boot for $BOARD / $BRANCH" "info"

# If BRANCH==vendor, use rkbin BL31 ${RKBIN_DIR}/${BL31_BLOB}, otherwise, bl31.elf from mainline ATF/TF-A
declare bl31_blob="undetermined"
if [[ "${BRANCH}" == "vendor" ]]; then
display_alert "${BOARD}/${BRANCH}" "Using Rockchip rkbin BL31 blob : ${RKBIN_DIR}/${BL31_BLOB}" "info"
bl31_blob="${RKBIN_DIR}/${BL31_BLOB}"
declare -g ATF_COMPILE="no" # no need to build mainline it either
else
display_alert "${BOARD}/${BRANCH}" "Using mainline BL31: bl31.elf from mainline ATF/TF-A" "info"
bl31_blob="bl31.elf"
# To reuse ATF code in rockchip64_common, let's change the BOOT_SCENARIO and call prepare_boot_configuration() again
BOOT_SCENARIO="tpl-blob-atf-mainline"
prepare_boot_configuration
fi

declare -g BOOTCONFIG="recomputer-rk3588_defconfig"
declare -g BOOTDELAY=1
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
declare -g BOOTBRANCH="tag:v2026.07"
declare -g BOOTPATCHDIR="v2026.07"

# Binman produces both eMMC/SD and SPI images
declare -g UBOOT_TARGET_MAP="BL31=${bl31_blob} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"

# Disable vendor-specific postprocessing; binman does all the work
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd

# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
function write_uboot_platform() {
dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none
}

function write_uboot_platform_mtd() {
flashcp -v -p "$1/u-boot-rockchip-spi.bin" /dev/mtd0
}
}

# fancy-up the mainline U-Boot
function post_config_uboot_target__recomputer_rk3588_devkit_enable_ufs_and_spi_env() {
[[ "${BRANCH}" == "vendor" ]] && return 0 # only for BRANCH=current/edge, not vendor

display_alert "mainline u-boot" "Extra mainline u-boot configs for ${BOARD}/${BRANCH}" "info"

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: environment in SPI flash" "info"
run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_NOWHERE "n"
run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_IN_SPI_FLASH "y"
run_host_command_logged scripts/config --set-val CONFIG_ENV_SECT_SIZE_AUTO "y"
run_host_command_logged scripts/config --set-val CONFIG_ENV_OVERWRITE "y"
run_host_command_logged scripts/config --set-val CONFIG_ENV_SIZE "0x20000"
run_host_command_logged scripts/config --set-val CONFIG_ENV_OFFSET "0xc00000"

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable preboot & flash user LED in preboot" "info"
run_host_command_logged scripts/config --enable CONFIG_USE_PREBOOT
run_host_command_logged scripts/config --set-str CONFIG_PREBOOT "'led red:indicator on; sleep 0.1; led red:indicator off; led blue:heartbeat on; sleep 0.1; led blue:heartbeat off; led green:indicator on; sleep 0.1; led green:indicator off;'" # double quotes required due to run_host_command_logged's quirks

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable EFI debugging commands" "info"
run_host_command_logged scripts/config --enable CMD_EFIDEBUG
run_host_command_logged scripts/config --enable CMD_NVEDIT_EFI

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more filesystems support" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_BTRFS

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more compression support" "info"
run_host_command_logged scripts/config --enable CONFIG_LZO
run_host_command_logged scripts/config --enable CONFIG_BZIP2
run_host_command_logged scripts/config --enable CONFIG_ZSTD

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable gpio LED support" "info"
run_host_command_logged scripts/config --enable CONFIG_LED
run_host_command_logged scripts/config --enable CONFIG_LED_GPIO

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable networking cmds" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_NFS
run_host_command_logged scripts/config --enable CONFIG_CMD_WGET
run_host_command_logged scripts/config --enable CONFIG_CMD_DNS
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP_SACK

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable LWIP (new networking stack)" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_MII
run_host_command_logged scripts/config --enable CONFIG_NET_LWIP

display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable MBed TLS stuff" "info"
run_host_command_logged scripts/config --enable CONFIG_WGET_HTTPS
run_host_command_logged scripts/config --enable CONFIG_WGET_CACERT
#run_host_command_logged scripts/config --enable CONFIG_WGET_BUILTIN_CACERT # not yet
run_host_command_logged scripts/config --enable CONFIG_MBEDTLS_LIB

# UMS, RockUSB, gadget stuff
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable UMS/RockUSB gadget" "info"
declare -a enable_configs=("CONFIG_CMD_USB_MASS_STORAGE" "CONFIG_USB_GADGET" "USB_GADGET_DOWNLOAD" "CONFIG_USB_FUNCTION_ROCKUSB" "CONFIG_USB_FUNCTION_ACM" "CONFIG_CMD_ROCKUSB")
for config in "${enable_configs[@]}"; do
run_host_command_logged scripts/config --enable "${config}"
done
# Auto-enabled by the above, force off...
run_host_command_logged scripts/config --disable USB_FUNCTION_FASTBOOT

return 0
}

# "rockchip-common: boot SD card first, then NVMe, then USB, then NET"
# On reComputer_rk3588, mmc1 is SD card, mmc0 is not present
function pre_config_uboot_target__recomputer_rk3588_devkit_boot_order() {
[[ "${BRANCH}" == "vendor" ]] && return 0 # only for BRANCH=current/edge, not vendor

declare -a rockchip_uboot_targets=("mmc1" "nvme" "usb" "pxe" "dhcp")
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: adjust boot order to '${rockchip_uboot_targets[*]}'" "info"
sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h
regular_git diff -u include/configs/rockchip-common.h || true
}

# Include fw_setenv, configured to point to the correct spot on the SPI Flash
function post_family_tweaks__config_recomputer_rk3588_fwenv() {
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
display_alert "Configuring fw_printenv and fw_setenv" "for ${BOARD} and u-boot ${BOOTBRANCH}" "info"
# Addresses below come from CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE in defconfig
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
# MTD/SPI u-boot env for the ${BOARD_NAME}
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc00000 0x20000
FW_ENV_CONFIG
Comment on lines +202 to +206

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the non-expanded variable in the generated comment.

The heredoc delimiter is quoted ('FW_ENV_CONFIG'), so ${BOARD_NAME} is written literally into /etc/fw_env.config. Use a literal board name in the comment.

♻️ Proposed fix
 	cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
-		# MTD/SPI u-boot env for the ${BOARD_NAME}
+		# MTD/SPI u-boot env for the reComputer RK3588
 		# MTD device name Device offset Env. size Flash sector size Number of sectors
 		/dev/mtd0         0xc00000      0x20000
 	FW_ENV_CONFIG
📝 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.

Suggested change
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
# MTD/SPI u-boot env for the ${BOARD_NAME}
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc00000 0x20000
FW_ENV_CONFIG
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
# MTD/SPI u-boot env for the reComputer RK3588
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc00000 0x20000
FW_ENV_CONFIG
🤖 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/recomputer-rk3588-devkit.conf` around lines 202 - 206, Update
the generated fw_env.config comment in the heredoc to use the literal board name
instead of ${BOARD_NAME}; keep the quoted FW_ENV_CONFIG delimiter and all
configuration values unchanged.

}
Loading