amlogic: rework bootloader files for U-Boot 2024.04

This commit is contained in:
Christian Hewitt 2024-03-20 10:09:31 +00:00
parent d763c1eb28
commit 7098547b2e
No known key found for this signature in database
3 changed files with 25 additions and 31 deletions

View File

@ -26,7 +26,7 @@ mkimage_bootini(){
mkimage_uEnv(){
echo "image: creating uEnv.ini"
cat << EOF > "${LE_TMP}/uEnv.ini"
dtb_name=/dtb/${DTB}
dtb_name=/amlogic/${DTB}
bootargs=boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s "${LE_TMP}/uEnv.ini" ::
@ -38,7 +38,7 @@ mkimage_extlinux(){
cat << EOF > "${LE_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDT /${DTB}
FDT /amlogic/${DTB}
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s -o "${LE_TMP}/extlinux" ::
@ -50,31 +50,15 @@ mkimage_extlinux_fdtdir(){
cat << EOF > "${LE_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDTDIR /
FDTDIR /amlogic/
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s -o "${LE_TMP}/extlinux" ::
}
mkimage_dtb(){
if [ "$DTB" != "@@DTB_NAME@@" ]; then
echo "image: copying device tree"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/$DTB" ::
if [ "$DTB" = "meson-g12b-odroid-n2.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-odroid-n2-plus.dtb" ::
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-odroid-n2l.dtb" ::
elif [ "$DTB" = "meson-g12b-gtking.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-gtking-pro.dtb" ::
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-g12b-gsking-x.dtb" ::
elif [ "$DTB" = "meson-gxl-s905x-libretech-cc.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-gxl-s905x-libretech-cc-v2.dtb" ::
elif [ "$DTB" = "meson-sm1-odroid-c4.dtb" ]; then
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb/meson-sm1-odroid-hc4.dtb" ::
fi
else
echo "image: copying device trees"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/dtb" ::
fi
echo "image: copying device trees"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader/amlogic" ::
}
case "${UBOOT_SYSTEM}" in

View File

@ -11,14 +11,15 @@ mkdir -p "$DSTDIR"
cp -av "${FOUND_PATH}" "$DSTDIR/boot.ini"
fi
mkdir -p "$DSTDIR/dtb"
mkdir -p "$DSTDIR/amlogic"
ln -sf "$DSTDIR/amlogic" "$DSTDIR/dtb"
case ${DEVICE:-$PROJECT} in
AMLGX)
cp -a "$SRCDIR"/*gxbb*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxl*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxm*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*g12a*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*g12b*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*sm1*.dtb "$DSTDIR/dtb"
cp -a "$SRCDIR"/*gxbb*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*gxl*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*gxm*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*g12a*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*g12b*.dtb "$DSTDIR/amlogic"
cp -a "$SRCDIR"/*sm1*.dtb "$DSTDIR/amlogic"
;;
esac

View File

@ -22,7 +22,16 @@
# mount $BOOT_ROOT rw
mount -o remount,rw $BOOT_ROOT
# update extlinux device trees
# update /amlogic device trees
if [ -d $BOOT_ROOT/amlogic ]; then
for dtbfile in $BOOT_ROOT/amlogic/*.dtb ; do
dtb=$(basename $dtbfile)
echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/amlogic/ 2>/dev/null || true
done
fi
# update /extlinux device trees
if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
for dtbfile in $BOOT_ROOT/*.dtb ; do
dtb=$(basename $dtbfile)
@ -31,8 +40,8 @@
done
fi
# update box device trees
if [ -f $BOOT_ROOT/uEnv.ini ]; then
# update /dtb device trees
if [ -d $BOOT_ROOT/dtb ]; then
for dtbfile in $BOOT_ROOT/dtb/*.dtb ; do
dtb=$(basename $dtbfile)
echo "Updating $dtb"