WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d5bceb9

Browse files
rpardiniigorpecovnik
authored andcommitted
rock-5b: u-boot: edge: bump to v2026.01-rc2; use mainline ATF; bootorder; fancy u-boot
- boot order: SD -> NVMe -> eMMC -> USB -> PXE - enable compression, EFI stuff, BTRFS, LED support - this is large bump from a custom-Kwiboo 24.04 to 26.01 - upstream has handled the whole fusb302 acrobatics for PD
1 parent 9b2843d commit d5bceb9

File tree

1 file changed

+64
-7
lines changed

1 file changed

+64
-7
lines changed

config/boards/rock-5b.conf

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ function post_family_tweaks__rock5b_naming_audios() {
3131
function post_family_config_branch_edge__rock-5b_use_mainline_uboot() {
3232
display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info"
3333

34+
# To reuse ATF code in rockchip64_common, let's change the BOOT_SCENARIO and call prepare_boot_configuration() again
35+
BOOT_SCENARIO="tpl-blob-atf-mainline"
36+
prepare_boot_configuration
37+
3438
declare -g BOOTCONFIG="rock5b-rk3588_defconfig"
3539
declare -g BOOTDELAY=1
36-
declare -g BOOTSOURCE="https://github.com/Kwiboo/u-boot-rockchip.git"
37-
declare -g BOOTBRANCH="branch:rk3xxx-2024.04" # commit:31522fe7b3c7733313e1c5eb4e340487f6000196 as of 2024-04-01
38-
declare -g BOOTPATCHDIR="v2024.04-rock5b-radxa"
40+
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
41+
declare -g BOOTBRANCH="tag:v2026.01-rc2"
42+
declare -g BOOTPATCHDIR="v2026.01"
3943
declare -g BOOTDIR="u-boot-${BOARD}"
40-
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"
44+
declare -g UBOOT_TARGET_MAP="BL31=bl31.elf ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"
4145
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already
4246

4347
# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
@@ -50,16 +54,69 @@ function post_family_config_branch_edge__rock-5b_use_mainline_uboot() {
5054
}
5155
}
5256

57+
function pre_config_uboot_target__rock5b_patch_uboot_dtsi_for_ums() {
58+
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
59+
60+
# IMPORTANT: this typical copypasta is not needed for rock5b, which already has it all in arch/arm/dts/rk3588-rock-5b-u-boot.dtsi
61+
display_alert "u-boot for ${BOARD}" "u-boot: upstream u-boot for ${BOARD} is *already* UMS-enabled" "info"
62+
}
63+
64+
# "rockchip-common: boot SD card first, then NVMe, then mmc"
65+
# include/configs/rockchip-common.h
66+
# -#define BOOT_TARGETS "mmc1 mmc0 nvme scsi usb pxe dhcp spi"
67+
# +#define BOOT_TARGETS "mmc0 nvme mmc1 scsi usb pxe dhcp spi"
68+
# On rock-5b, mmc0 is the eMMC, mmc1 is the SD card slot
69+
function pre_config_uboot_target__rock5b_patch_rockchip_common_boot_order() {
70+
declare -a rockchip_uboot_targets=("mmc1" "nvme" "mmc0" "scsi" "usb" "pxe" "dhcp" "spi") # for future make-this-generic delight
71+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: adjust boot order to '${rockchip_uboot_targets[*]}'" "info"
72+
sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h
73+
regular_git diff -u include/configs/rockchip-common.h || true
74+
}
75+
5376
function post_config_uboot_target__extra_configs_for_rock5b_mainline_environment_in_spi() {
5477
[[ "${BRANCH}" != "edge" ]] && return 0
5578

56-
display_alert "$BOARD" "u-boot configs for ${BOOTBRANCH} u-boot config BRANCH=${BRANCH}" "info"
79+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable board-specific configs (env in SPI)" "info"
80+
run_host_command_logged scripts/config --enable CONFIG_DM_PMIC_FAN53555
81+
run_host_command_logged scripts/config --enable CONFIG_CMD_MISC
5782
run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_NOWHERE "n"
5883
run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_IN_SPI_FLASH "y"
5984
run_host_command_logged scripts/config --set-val CONFIG_ENV_SECT_SIZE_AUTO "y"
6085
run_host_command_logged scripts/config --set-val CONFIG_ENV_OVERWRITE "y"
6186
run_host_command_logged scripts/config --set-val CONFIG_ENV_SIZE "0x20000"
6287
run_host_command_logged scripts/config --set-val CONFIG_ENV_OFFSET "0xc00000"
88+
89+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable EFI debugging commands" "info"
90+
run_host_command_logged scripts/config --enable CMD_EFIDEBUG
91+
run_host_command_logged scripts/config --enable CMD_NVEDIT_EFI
92+
93+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more filesystems support" "info"
94+
run_host_command_logged scripts/config --enable CONFIG_CMD_BTRFS
95+
96+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more compression support" "info"
97+
run_host_command_logged scripts/config --enable CONFIG_LZO
98+
run_host_command_logged scripts/config --enable CONFIG_BZIP2
99+
run_host_command_logged scripts/config --enable CONFIG_ZSTD
100+
101+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable gpio LED support" "info"
102+
run_host_command_logged scripts/config --enable CONFIG_LED
103+
run_host_command_logged scripts/config --enable CONFIG_LED_GPIO
104+
105+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable networking cmds" "info"
106+
run_host_command_logged scripts/config --enable CONFIG_CMD_NFS
107+
run_host_command_logged scripts/config --enable CONFIG_CMD_WGET
108+
run_host_command_logged scripts/config --enable CONFIG_CMD_DNS
109+
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP
110+
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP_SACK
111+
112+
# UMS, RockUSB, gadget stuff
113+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable UMS/RockUSB gadget" "info"
114+
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" "CONFIG_CMD_USB_MASS_STORAGE")
115+
for config in "${enable_configs[@]}"; do
116+
run_host_command_logged scripts/config --enable "${config}"
117+
done
118+
# Auto-enabled by the above, force off...
119+
run_host_command_logged scripts/config --disable USB_FUNCTION_FASTBOOT
63120
}
64121

65122
# Include fw_setenv, configured to point to the correct spot on the SPI Flash
@@ -68,8 +125,8 @@ function post_family_tweaks__config_rock5b_fwenv() {
68125
[[ "${BRANCH}" != "edge" ]] && return 0
69126
display_alert "Configuring fw_printenv and fw_setenv" "for ${BOARD} and u-boot ${BOOTBRANCH}" "info"
70127
# Addresses below come from CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE in defconfig
71-
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
72-
# MTD/SPI u-boot env for the Rock-5b
128+
cat <<- FW_ENV_CONFIG > "${SDCARD}"/etc/fw_env.config
129+
# MTD/SPI u-boot env for the ${BOARD_NAME}
73130
# MTD device name Device offset Env. size Flash sector size Number of sectors
74131
/dev/mtd0 0xc00000 0x20000
75132
FW_ENV_CONFIG

0 commit comments

Comments
 (0)