61 lines
1.4 KiB
Text
61 lines
1.4 KiB
Text
|
# SPDX-License-Identifier: GPL-2.0
|
||
|
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
|
||
|
# Copyright (C) 2021-present Fewtarius
|
||
|
|
||
|
PKG_RKBIN="$(get_build_dir rkbin)"
|
||
|
source ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/options
|
||
|
|
||
|
if [ -n "$PKG_DATAFILE" -a -n "$PKG_LOADER" ]; then
|
||
|
tools/mkimage -n ${PKG_SOC} -T rksd -d "${PKG_DATAFILE}" idbloader.img
|
||
|
cat "$PKG_LOADER" >> idbloader.img
|
||
|
cp -av idbloader.img $INSTALL/usr/share/bootloader
|
||
|
fi
|
||
|
|
||
|
if [ ! -n "${PKG_LOAD_ADDR}" ]; then
|
||
|
PKG_LOAD_ADDR="0x00200000"
|
||
|
fi
|
||
|
|
||
|
$PKG_RKBIN/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img ${PKG_LOAD_ADDR}
|
||
|
cp -av uboot.img $INSTALL/usr/share/bootloader
|
||
|
|
||
|
if [ -n "$PKG_BL31" ]; then
|
||
|
cat >trust.ini <<EOF
|
||
|
[BL30_OPTION]
|
||
|
SEC=0
|
||
|
[BL31_OPTION]
|
||
|
SEC=1
|
||
|
PATH=$PKG_BL31
|
||
|
ADDR=0x00010000
|
||
|
[BL32_OPTION]
|
||
|
SEC=0
|
||
|
[BL33_OPTION]
|
||
|
SEC=0
|
||
|
[OUTPUT]
|
||
|
PATH=trust.img
|
||
|
EOF
|
||
|
if [[ "${DEVICE}" =~ RG351 ]]
|
||
|
then
|
||
|
TROPTS="--rsa 3 --verbose"
|
||
|
else
|
||
|
TROPTS="--verbose"
|
||
|
fi
|
||
|
$PKG_RKBIN/tools/trust_merger ${TROPTS} trust.ini
|
||
|
cp -av trust.img $INSTALL/usr/share/bootloader
|
||
|
fi
|
||
|
|
||
|
if [ "${BOOT_INI}" == true ]
|
||
|
then
|
||
|
cat >$INSTALL/usr/share/bootloader/boot.ini <<EOF
|
||
|
odroidgoa-uboot-config
|
||
|
|
||
|
setenv fdt_addr_r "0x01f00000"
|
||
|
setenv dtb_name "${DEVICE_DTB}.dtb"
|
||
|
setenv loadaddr "${PKG_LOAD_ADDR}"
|
||
|
setenv scriptaddr "0x00500000"
|
||
|
setenv kernel_addr_r "0x02008000"
|
||
|
|
||
|
sysboot mmc 1:1 any \${scriptaddr} /extlinux/extlinux.conf
|
||
|
|
||
|
EOF
|
||
|
fi
|