From c955695b60f92816312164e21641362736029f68 Mon Sep 17 00:00:00 2001 From: Alessandro Lannocca Date: Sat, 24 Aug 2024 20:14:51 +0100 Subject: [PATCH 1/2] rockchip-rk3588: rock-5b current, edge: u-boot: bump to mainline 2024.10-rc3 - ensure ARMV8_CRYPTO is disabled (currently broken) - enable creation of /chosen/kaslr-seed node (to enable Kernel address space layout randomization --- config/boards/rock-5b.conf | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/config/boards/rock-5b.conf b/config/boards/rock-5b.conf index e961d1568f5d..b3ab6e7e3ab7 100644 --- a/config/boards/rock-5b.conf +++ b/config/boards/rock-5b.conf @@ -27,16 +27,39 @@ function post_family_tweaks__rock5b_naming_audios() { return 0 } -# Mainline u-boot or Kwiboo's tree + Mainline u-boot tree function post_family_config_branch_edge__rock-5b_use_mainline_uboot() { display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info" - declare -g BOOTCONFIG="rock5b-rk3588_defconfig" # override the default for the board/family - declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc - declare -g BOOTSOURCE="https://github.com/Kwiboo/u-boot-rockchip.git" # We ❤️ Kwiboo's tree - declare -g BOOTBRANCH="branch:rk3xxx-2024.04" # commit:31522fe7b3c7733313e1c5eb4e340487f6000196 as of 2024-04-01 - declare -g BOOTPATCHDIR="v2024.04-rock5b-radxa" # empty; defconfig changes are done in hook below - declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory + declare -g BOOTCONFIG="rock5b-rk3588_defconfig" # override the default for the board/family + declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc + declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️Mainline tree + declare -g BOOTBRANCH="tag:v2024.10-rc3" # commit:d11a60610e17373331ad17b6c5c31735cf9fffa8 as of 2024-08-20 + declare -g BOOTPATCHDIR="v2024.10-rock5b-radxa" # empty; defconfig changes are done in hook below + declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory + 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" + 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 + + # 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 + } +} + +# Mainline u-boot tree +function post_family_config_branch_current__rock-5b_use_mainline_uboot() { + display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info" + + declare -g BOOTCONFIG="rock5b-rk3588_defconfig" # override the default for the board/family + declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc + declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ Mainline tree + declare -g BOOTBRANCH="tag:v2024.10-rc3" # commit:d11a60610e17373331ad17b6c5c31735cf9fffa8 as of 2024-08-20 + declare -g BOOTPATCHDIR="v2024.10-rock5b-radxa" # empty; defconfig changes are done in hook below + declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory 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" 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 @@ -51,7 +74,7 @@ function post_family_config_branch_edge__rock-5b_use_mainline_uboot() { } function post_config_uboot_target__extra_configs_for_rock5b_mainline_environment_in_spi() { - [[ "${BRANCH}" != "edge" ]] && return 0 + [[ "${BRANCH}" != "edge" && "${BRANCH}" != "current" ]] && return 0 display_alert "$BOARD" "u-boot configs for ${BOOTBRANCH} u-boot config BRANCH=${BRANCH}" "info" run_host_command_logged scripts/config --set-val CONFIG_ENV_IS_NOWHERE "n" @@ -60,6 +83,10 @@ function post_config_uboot_target__extra_configs_for_rock5b_mainline_environment 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" + run_host_command_logged scripts/config --set-val CONFIG_BOARD_RNG_SEED "y" + run_host_command_logged scripts/config --set-val ARMV8_CRYPTO "n" #broken as per 2024.10-rc3 + run_host_command_logged scripts/config --set-val ARMV8_CE_SHA1 "n" #broken as per 2024.10-rc3 + run_host_command_logged scripts/config --set-val ARMV8_CE_SHA256 "n" #broken as per 2024.10-rc3 } # Include fw_setenv, configured to point to the correct spot on the SPI Flash From f3465d3b98b5a7d63c4c4e78f25497cdda50aaf8 Mon Sep 17 00:00:00 2001 From: Alessandro Lannocca Date: Sun, 25 Aug 2024 22:00:00 +0100 Subject: [PATCH 2/2] comment an actual comment (prepend with #) --- config/boards/rock-5b.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/boards/rock-5b.conf b/config/boards/rock-5b.conf index b3ab6e7e3ab7..0e7e1f33bd7a 100644 --- a/config/boards/rock-5b.conf +++ b/config/boards/rock-5b.conf @@ -27,13 +27,13 @@ function post_family_tweaks__rock5b_naming_audios() { return 0 } - Mainline u-boot tree +# Mainline u-boot tree function post_family_config_branch_edge__rock-5b_use_mainline_uboot() { display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info" declare -g BOOTCONFIG="rock5b-rk3588_defconfig" # override the default for the board/family declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc - declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️Mainline tree + declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ Mainline tree declare -g BOOTBRANCH="tag:v2024.10-rc3" # commit:d11a60610e17373331ad17b6c5c31735cf9fffa8 as of 2024-08-20 declare -g BOOTPATCHDIR="v2024.10-rock5b-radxa" # empty; defconfig changes are done in hook below declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory @@ -56,7 +56,7 @@ function post_family_config_branch_current__rock-5b_use_mainline_uboot() { declare -g BOOTCONFIG="rock5b-rk3588_defconfig" # override the default for the board/family declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc - declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ Mainline tree + declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ ainline tree declare -g BOOTBRANCH="tag:v2024.10-rc3" # commit:d11a60610e17373331ad17b6c5c31735cf9fffa8 as of 2024-08-20 declare -g BOOTPATCHDIR="v2024.10-rock5b-radxa" # empty; defconfig changes are done in hook below declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory