Skip to content

Commit

Permalink
fix: update rk3576 idbloader build method
Browse files Browse the repository at this point in the history
Signed-off-by: ZHANG Yuntian <[email protected]>
  • Loading branch information
RadxaYuntian committed Nov 26, 2024
1 parent 3398574 commit f75d36e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
41 changes: 38 additions & 3 deletions lib/u-boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ bsp_reset() {
RKBIN_DDR=
RKMINILOADER=
UBOOT_BASE_ADDR=
RKBOOT_IDB=
USE_ATF="false"

BSP_MTK_LK_PROJECT=
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions u-boot/rk2410/fork.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit f75d36e

Please sign in to comment.