From f75d36eceab169ce473c396a6c5bff29a7511401 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian Date: Tue, 26 Nov 2024 15:57:15 +0800 Subject: [PATCH] fix: update rk3576 idbloader build method Signed-off-by: ZHANG Yuntian --- lib/u-boot.sh | 41 ++++++++++++++++++++++++++++++++++++++--- u-boot/rk2410/fork.conf | 1 + 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/u-boot.sh b/lib/u-boot.sh index 5af2004..8c25b4b 100644 --- a/lib/u-boot.sh +++ b/lib/u-boot.sh @@ -27,6 +27,7 @@ bsp_reset() { RKBIN_DDR= RKMINILOADER= UBOOT_BASE_ADDR= + RKBOOT_IDB= USE_ATF="false" BSP_MTK_LK_PROJECT= @@ -197,6 +198,11 @@ bsp_make() { rkpack_idbloader() { local flash_data= + if [[ -n $RKBOOT_IDB ]] + then + echo "Skip rkpack_idbloader. idbloader will be created by rkpack_rkboot." + return + fi if [[ -n $BSP_ROCKCHIP_TPL ]] then echo "Using rkbin $(basename $BSP_ROCKCHIP_TPL) as TPL" @@ -262,10 +268,39 @@ rkpack_rkboot() { local variant for variant in "" "_SPINOR" "_SPI_NAND" "_UART0_SD_NAND" do - if [[ -f "$SCRIPT_DIR/.src/rkbin/RKBOOT/${BSP_TRUST_OVERRIDE^^}MINIALL$variant.ini" ]] + local rkboot_ini="$SCRIPT_DIR/.src/rkbin/RKBOOT/${BSP_TRUST_OVERRIDE^^}MINIALL$variant.ini" + + if [[ ! -f $rkboot_ini ]] + then + continue + fi + + if [[ -n $RKBOOT_IDB ]] + then + sed -i "s|FlashBoot=.*$|FlashBoot=${SCRIPT_DIR}/.src/u-boot/spl/u-boot-spl.bin|g" "$rkboot_ini" + fi + + $SCRIPT_DIR/.src/rkbin/tools/boot_merger "$rkboot_ini" + mv ./*_loader_*.bin "$SCRIPT_DIR/.root/usr/lib/u-boot/$BSP_BOARD_OVERRIDE/rkboot$variant.bin" + + if [[ -n $RKBOOT_IDB ]] then - $SCRIPT_DIR/.src/rkbin/tools/boot_merger "$SCRIPT_DIR/.src/rkbin/RKBOOT/${BSP_TRUST_OVERRIDE^^}MINIALL$variant.ini" - mv ./*_loader_*.bin "$SCRIPT_DIR/.root/usr/lib/u-boot/$BSP_BOARD_OVERRIDE/rkboot$variant.bin" + local idb_variant + case "$variant" in + "_SPINOR") + idb_variant="-spi_spl" + ;; + "_SPI_NAND") + idb_variant="-spi_nand" + ;; + "_UART0_SD_NAND") + idb_variant="-sd_nand" + ;; + "") + idb_variant="" + ;; + esac + mv ./"$RKBOOT_IDB"* "$TARGET_DIR/idbloader$idb_variant.img" fi done popd diff --git a/u-boot/rk2410/fork.conf b/u-boot/rk2410/fork.conf index 02a2a39..b80c4df 100644 --- a/u-boot/rk2410/fork.conf +++ b/u-boot/rk2410/fork.conf @@ -50,6 +50,7 @@ bsp_rk3568() { bsp_rk3576() { BSP_SOC="rk3576" + RKBOOT_IDB="${BSP_SOC}_idblock_v" RKBIN_DDR="${BSP_SOC}_ddr_lp4_2112MHz_lp5_2736MHz_v" }