commit
b1198e9a61
5 changed files with 70 additions and 56 deletions
|
@ -58,16 +58,14 @@ fi
|
|||
|
||||
case "${PKG_SOC}" in
|
||||
rk35*)
|
||||
if [ -f "u-boot.itb" ]
|
||||
then
|
||||
echo "uboot: copy u-boot.itb image to ${INSTALL}/usr/share/bootloader..."
|
||||
cp -av u-boot.itb ${INSTALL}/usr/share/bootloader/u-boot.itb
|
||||
generate_rkspi_loader
|
||||
elif [ -f "u-boot.img" ]
|
||||
then
|
||||
echo "uboot: copy u-boot.img image to ${INSTALL}/usr/share/bootloader..."
|
||||
cp -av u-boot.img ${INSTALL}/usr/share/bootloader/u-boot.img
|
||||
fi
|
||||
for BOOT_IMAGE in u-boot.itb u-boot.img uboot.img
|
||||
do
|
||||
if [ -f "${BOOT_IMAGE}" ]; then
|
||||
echo "uboot: copy ${BOOT_IMAGE} image to ${INSTALL}/usr/share/bootloader..."
|
||||
cp -av ${BOOT_IMAGE} ${INSTALL}/usr/share/bootloader/${BOOT_IMAGE}
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
rk3399)
|
||||
PKG_ATF_INI="${PKG_RKBIN}"/RKTRUST/"${DEVICE}"TRUST.ini
|
||||
|
|
|
@ -22,10 +22,14 @@ fi
|
|||
|
||||
case "${PKG_SOC}" in
|
||||
rk35*)
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot.itb" ]; then
|
||||
echo "image: burn uboot.itb to image... (${PKG_SOC})"
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot.itb" of="${DISK}" bs=512 seek=16384 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
for BOOT_IMAGE in u-boot.itb u-boot.img uboot.img
|
||||
do
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${BOOT_IMAGE}" ]; then
|
||||
echo "image: burn ${BOOT_IMAGE} to image..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/${BOOT_IMAGE}" of="${DISK}" bs=512 seek=16384 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/trust.img" ]; then
|
||||
echo "image: burn trust.img to image..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/trust.img" of="${DISK}" bs=512 seek=24576 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
|
@ -41,10 +45,13 @@ case "${PKG_SOC}" in
|
|||
fi
|
||||
;;
|
||||
*)
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.img" ]; then
|
||||
echo "image: burn uboot.img to image..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/uboot.img" of="$DISK" bs=512 seek=16384 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
fi
|
||||
for BOOT_IMAGE in u-boot.itb u-boot.img uboot.img
|
||||
do
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/${BOOT_IMAGE}" ]; then
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/${BOOT_IMAGE}" of="${DISK}" bs=512 seek=16384 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/trust.img" ]; then
|
||||
echo "image: burn trust.img to image..."
|
||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/trust.img" of="$DISK" bs=512 seek=24576 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||
|
|
|
@ -11,11 +11,13 @@ if [ -n "${UBOOT_CONFIG}" ]; then
|
|||
fi
|
||||
case "${PKG_SOC}" in
|
||||
rk35*)
|
||||
if [ -f ${BOOTLOADER_DIR}/u-boot.itb ]; then
|
||||
cp -a ${BOOTLOADER_DIR}/u-boot.itb ${RELEASE_DIR}/3rdparty/bootloader
|
||||
elif [ -f ${BOOTLOADER_DIR}/uboot.img ]; then
|
||||
cp -a ${BOOTLOADER_DIR}/uboot.img ${RELEASE_DIR}/3rdparty/bootloader
|
||||
fi
|
||||
for BOOT_IMAGE in u-boot.itb u-boot.img uboot.img
|
||||
do
|
||||
if [ -f "${BOOTLOADER_DIR}/${BOOT_IMAGE}" ]; then
|
||||
cp -a ${BOOTLOADER_DIR}/${BOOT_IMAGE} ${RELEASE_DIR}/3rdparty/bootloader
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -f ${KERNEL_DIR}/resource.img ]; then
|
||||
cp -a ${KERNEL_DIR}/resource.img ${RELEASE_DIR}/3rdparty/bootloader
|
||||
fi
|
||||
|
@ -26,9 +28,13 @@ if [ -n "${UBOOT_CONFIG}" ]; then
|
|||
fi
|
||||
;;
|
||||
*)
|
||||
if [ -f ${BOOTLOADER_DIR}/uboot.img ]; then
|
||||
cp -a ${BOOTLOADER_DIR}/uboot.img ${RELEASE_DIR}/3rdparty/bootloader
|
||||
fi
|
||||
for BOOT_IMAGE in u-boot.itb u-boot.img uboot.img
|
||||
do
|
||||
if [ -f "${BOOTLOADER_DIR}/${BOOT_IMAGE}" ]; then
|
||||
cp -a ${BOOTLOADER_DIR}/${BOOT_IMAGE} ${RELEASE_DIR}/3rdparty/bootloader
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -f ${BOOTLOADER_DIR}/trust.img ]; then
|
||||
cp -a ${BOOTLOADER_DIR}/trust.img ${RELEASE_DIR}/3rdparty/bootloader
|
||||
fi
|
||||
|
|
|
@ -122,21 +122,16 @@ if [ -f $SYSTEM_ROOT/usr/share/bootloader/idbloader.img ]; then
|
|||
dd if=$SYSTEM_ROOT/usr/share/bootloader/idbloader.img of=$BOOT_DISK ${IDBSEEK} conv=fsync &>/dev/null
|
||||
echo "done"
|
||||
fi
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/uboot.img ]; then
|
||||
echo -n "Updating uboot.img... "
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/uboot.img of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
||||
echo "done"
|
||||
fi
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/rk3399-uboot.bin ]; then
|
||||
echo -n "Updating uboot.bin... "
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/rk3399-uboot.bin of=$BOOT_DISK bs=512 seek=64 conv=fsync &>/dev/null
|
||||
echo "done"
|
||||
fi
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot.itb ]; then
|
||||
echo -n "Updating uboot.itb... "
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.itb of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
for BOOT_IMAGE in u-boot.itb u-boot.img uboot.img rk3399-uboot.bin
|
||||
do
|
||||
if [ -f "$SYSTEM_ROOT/usr/share/bootloader/${BOOT_IMAGE}" ]; then
|
||||
echo "Updating ${BOOT_IMAGE}..."
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/${BOOT_IMAGE} of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/trust.img ]; then
|
||||
echo -n "Updating trust.img... "
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/trust.img of=$BOOT_DISK bs=512 seek=24576 conv=fsync &>/dev/null
|
||||
|
|
|
@ -11,7 +11,6 @@ PKG_DEPENDS_TARGET="toolchain Python3 swig:host rkbin glibc pyelftools:host"
|
|||
PKG_LONGDESC="Rockchip U-Boot is a bootloader for embedded systems."
|
||||
PKG_PATCH_DIRS+="${DEVICE}"
|
||||
|
||||
UBOOT_IMG="u-boot.itb"
|
||||
case ${DEVICE} in
|
||||
RK358*)
|
||||
PKG_VERSION="d34ff0716"
|
||||
|
@ -20,7 +19,6 @@ case ${DEVICE} in
|
|||
RK3566-BSP*)
|
||||
PKG_URL="${PKG_SITE}/rk356x-uboot.git"
|
||||
PKG_VERSION="97c658238f7ccd436fbdede451bfd7488514a5c8"
|
||||
UBOOT_IMG="u-boot.img"
|
||||
;;
|
||||
RK356*)
|
||||
PKG_URL="https://github.com/u-boot/u-boot.git"
|
||||
|
@ -76,26 +74,36 @@ make_target() {
|
|||
then
|
||||
PKG_LOADER="$(get_build_dir rkbin)/${PKG_LOADER}"
|
||||
fi
|
||||
if [[ "${PKG_SOC}" =~ "rk3568" ]]
|
||||
if [[ "${PKG_SOC}" =~ rk356* ]]
|
||||
then
|
||||
# rk3566 device
|
||||
echo "Building for GPT (${UBOOT_DTB})..."
|
||||
# rk3566 device
|
||||
echo "Building for GPT (${UBOOT_DTB})..."
|
||||
echo "toolchain (${TOOLCHAIN})"
|
||||
export BL31="${PKG_BL31}"
|
||||
export ROCKCHIP_TPL="${PKG_DATAFILE}"
|
||||
|
||||
case ${DEVICE} in
|
||||
RK3566-BSP*)
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make ${UBOOT_CONFIG} BL31=${PKG_BL31} ${PKG_LOADER} u-boot.dtb u-boot.itb CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
;;
|
||||
*)
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
|
||||
echo "begin make"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="--lssl -lcrypto" ARCH=arm64 make ${UBOOT_CONFIG} ${PKG_LOADER} u-boot.dtb u-boot.itb tools HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTCFLAGS="-I${TOOLCHAIN}/include"
|
||||
echo "end make"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
;;
|
||||
esac
|
||||
elif [[ "${PKG_SOC}" =~ "rk3588" ]]
|
||||
then
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
|
||||
echo "begin make"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="--lssl -lcrypto" ARCH=arm64 make ${UBOOT_CONFIG} ${PKG_LOADER} u-boot.dtb ${UBOOT_IMG} tools HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTCFLAGS="-I${TOOLCHAIN}/include"
|
||||
echo "end make"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
elif [[ "${PKG_SOC}" =~ "rk3588" ]]
|
||||
then
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make ${UBOOT_CONFIG} BL31=${PKG_BL31} ${PKG_LOADER} u-boot.dtb u-boot.img CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
else
|
||||
# rk3326 and rk3399 devices
|
||||
echo "Building for MBR (${UBOOT_DTB})..."
|
||||
else
|
||||
# rk3326 and rk3399 devices
|
||||
echo "Building for MBR (${UBOOT_DTB})..."
|
||||
if [[ "${ATF_PLATFORM}" =~ "rk3399" ]]; then
|
||||
export BL31="$(get_build_dir atf)/.install_pkg/usr/share/bootloader/bl31.elf"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue