Rockchip: bootloader: add support for fdtdir

This commit is contained in:
Jonas Karlman
2024-11-08 20:00:38 +00:00
committed by Christian Hewitt
parent 269a3b511e
commit 8f61262ff6
2 changed files with 30 additions and 0 deletions

View File

@@ -1,6 +1,22 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
if [ -z "${DTB}" ]; then
echo "image: copying device tree blobs..."
mmd rockchip >"${SAVE_ERROR}" 2>&1 || show_error
mcopy "${RELEASE_DIR}/3rdparty/bootloader/"*.dtb ::/rockchip >"${SAVE_ERROR}" 2>&1 || show_error
echo "image: copying extlinux.conf..."
mkdir -p "${IMG_TMP}/extlinux"
cat <<EOF >"${IMG_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDTDIR /
APPEND boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s "${IMG_TMP}/extlinux" :: >"${SAVE_ERROR}" 2>&1 || show_error
fi
if [ -n "${UBOOT_SYSTEM}" ]; then if [ -n "${UBOOT_SYSTEM}" ]; then
BOOTLOADER_PATH="${RELEASE_DIR}/3rdparty/bootloader/u-boot-rockchip.bin" BOOTLOADER_PATH="${RELEASE_DIR}/3rdparty/bootloader/u-boot-rockchip.bin"
if [ -f "${BOOTLOADER_PATH}" ]; then if [ -f "${BOOTLOADER_PATH}" ]; then

View File

@@ -20,6 +20,7 @@ fi
# update device tree # update device tree
for all_dtb in ${BOOT_ROOT}/*.dtb; do for all_dtb in ${BOOT_ROOT}/*.dtb; do
[ -f "$all_dtb" ] || continue
dtb=$(basename ${all_dtb}) dtb=$(basename ${all_dtb})
# device tree mappings for update from vendor to mainline kernel # device tree mappings for update from vendor to mainline kernel
@@ -56,6 +57,19 @@ fi
fi fi
done done
# update /rockchip device tree blobs
if [ -d ${BOOT_ROOT}/rockchip ]; then
echo -n "Updating Device Tree Blobs... "
for all_dtb in ${BOOT_ROOT}/rockchip/*.dtb; do
[ -f "$all_dtb" ] || continue
dtb=$(basename ${all_dtb})
if [ -f ${SYSTEM_ROOT}/usr/share/bootloader/${dtb} ]; then
cp -p ${SYSTEM_ROOT}/usr/share/bootloader/${dtb} ${BOOT_ROOT}/rockchip
fi
done
echo "done"
fi
# update bootloader # update bootloader
if [ -f ${SYSTEM_ROOT}/usr/share/bootloader/u-boot-rockchip.bin ]; then if [ -f ${SYSTEM_ROOT}/usr/share/bootloader/u-boot-rockchip.bin ]; then
echo -n "Updating U-Boot... " echo -n "Updating U-Boot... "