u-boot-dey: ccmp1: update install scripts for CCMP1 platform
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
This commit is contained in:
parent
44a05a819e
commit
b1ee0307cc
|
|
@ -7,41 +7,9 @@
|
||||||
install_abort=0
|
install_abort=0
|
||||||
BASEFILENAME=0
|
BASEFILENAME=0
|
||||||
|
|
||||||
# Determine U-Boot file to program basing on module variant
|
setenv INSTALL_ATF_FILENAME tf-a-##MACHINE##-nand.stm32
|
||||||
if test -n "${module_variant}"; then
|
setenv INSTALL_FIP_FILENAME fip-##MACHINE##-optee.bin
|
||||||
if test "${module_variant}" = "0x02" || test "${module_variant}" = "0x03" || test "${module_variant}" = "0x06" || test "${module_variant}" = "0x0a"; then
|
setenv INSTALL_MMCDEV 1
|
||||||
setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##.imx;
|
|
||||||
elif test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05" || test "${module_variant}" = "0x07"; then
|
|
||||||
setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##1GB.imx;
|
|
||||||
elif test "${module_variant}" = "0x08" || test "${module_variant}" = "0x09"; then
|
|
||||||
setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##512MB.imx
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use 'test -n ...' because 'test -z ...' does not work well on old versions of
|
|
||||||
# u-boot when the checked value is empty.
|
|
||||||
if test -n "${INSTALL_UBOOT_FILENAME}"; then
|
|
||||||
true;
|
|
||||||
else
|
|
||||||
echo "";
|
|
||||||
echo "[ERROR] Cannot determine U-Boot file for this module!";
|
|
||||||
echo "";
|
|
||||||
echo "1. Set variable 'INSTALL_UBOOT_FILENAME' depending on your ConnectCore 6UL variant:";
|
|
||||||
echo " - For a SOM with 1GB DDR3, run:";
|
|
||||||
echo " => setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##1GB.imx";
|
|
||||||
echo " - For a SOM with 512MB DDR3, run:";
|
|
||||||
echo " => setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##512MB.imx";
|
|
||||||
echo " - For a SOM with 256MB DDR3, run:";
|
|
||||||
echo " => setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##.imx";
|
|
||||||
echo "";
|
|
||||||
echo "2. Run the install script again.";
|
|
||||||
echo "";
|
|
||||||
echo "Aborted";
|
|
||||||
echo "";
|
|
||||||
exit;
|
|
||||||
fi;
|
|
||||||
|
|
||||||
setenv INSTALL_MMCDEV 0
|
|
||||||
|
|
||||||
if test -z "${image-name}"; then
|
if test -z "${image-name}"; then
|
||||||
setenv image-name ##DEFAULT_IMAGE_NAME##
|
setenv image-name ##DEFAULT_IMAGE_NAME##
|
||||||
|
|
@ -60,7 +28,7 @@ setenv INSTALL_RECOVERY_FILENAME ${BASEFILENAME}-##MACHINE##.recovery.ubifs
|
||||||
setenv INSTALL_ROOTFS_FILENAME ${BASEFILENAME}-##MACHINE##.ubifs
|
setenv INSTALL_ROOTFS_FILENAME ${BASEFILENAME}-##MACHINE##.ubifs
|
||||||
|
|
||||||
# Check for presence of firmware files on the SD card
|
# Check for presence of firmware files on the SD card
|
||||||
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
|
for install_f in ${INSTALL_ATF_FILENAME} ${INSTALL_FIP_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
|
||||||
if test ! -e mmc ${INSTALL_MMCDEV} ${install_f}; then
|
if test ! -e mmc ${INSTALL_MMCDEV} ${install_f}; then
|
||||||
echo "ERROR: Could not find file ${install_f}";
|
echo "ERROR: Could not find file ${install_f}";
|
||||||
install_abort=1;
|
install_abort=1;
|
||||||
|
|
@ -80,7 +48,10 @@ echo " on the partitions of the NAND."
|
||||||
echo ""
|
echo ""
|
||||||
echo " PARTITION FILENAME"
|
echo " PARTITION FILENAME"
|
||||||
echo " --------- --------"
|
echo " --------- --------"
|
||||||
echo " bootloader ${INSTALL_UBOOT_FILENAME}"
|
echo " fsbl1 ${INSTALL_ATF_FILENAME}"
|
||||||
|
echo " fsbl2 ${INSTALL_ATF_FILENAME}"
|
||||||
|
echo " fip-a ${INSTALL_FIP_FILENAME}"
|
||||||
|
echo " fip-b ${INSTALL_FIP_FILENAME}"
|
||||||
if test "${dualboot}" = "yes"; then
|
if test "${dualboot}" = "yes"; then
|
||||||
echo " linux_a ${INSTALL_LINUX_FILENAME}"
|
echo " linux_a ${INSTALL_LINUX_FILENAME}"
|
||||||
echo " linux_b ${INSTALL_LINUX_FILENAME}"
|
echo " linux_b ${INSTALL_LINUX_FILENAME}"
|
||||||
|
|
@ -108,41 +79,60 @@ setenv forced_update 1
|
||||||
# the first reset.
|
# the first reset.
|
||||||
setenv bootdelay 0
|
setenv bootdelay 0
|
||||||
|
|
||||||
# Update U-Boot
|
# Update ATF and FIP images
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo ">> Installing U-Boot boot loader image ${INSTALL_UBOOT_FILENAME} (target will reset)"
|
echo ">> Installing ATF boot loader image ${INSTALL_ATF_FILENAME}"
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
update uboot mmc ${INSTALL_MMCDEV} ${INSTALL_UBOOT_FILENAME}
|
update fsbl1 mmc ${INSTALL_MMCDEV} ${INSTALL_ATF_FILENAME}
|
||||||
if test $? -eq 1; then
|
if test $? -eq 1; then
|
||||||
# Use old-style update with source file system argument
|
echo "[ERROR] Failed to update fsbl1!";
|
||||||
update uboot mmc ${INSTALL_MMCDEV} fat ${INSTALL_UBOOT_FILENAME}
|
echo "";
|
||||||
if test $? -eq 1; then
|
echo "Aborted.";
|
||||||
echo "[ERROR] Failed to update U-Boot boot loader!";
|
exit;
|
||||||
echo "";
|
fi
|
||||||
echo "Aborted.";
|
update fsbl2 mmc ${INSTALL_MMCDEV} ${INSTALL_ATF_FILENAME}
|
||||||
exit;
|
if test $? -eq 1; then
|
||||||
fi
|
echo "[ERROR] Failed to update fsbl2!";
|
||||||
|
echo "";
|
||||||
|
echo "Aborted.";
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ">> Installing FIP boot loader image ${INSTALL_FIP_FILENAME} (target will reset)"
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
update fip-a mmc ${INSTALL_MMCDEV} ${INSTALL_FIP_FILENAME}
|
||||||
|
if test $? -eq 1; then
|
||||||
|
echo "[ERROR] Failed to update fip-a!";
|
||||||
|
echo "";
|
||||||
|
echo "Aborted.";
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
update fip-b mmc ${INSTALL_MMCDEV} ${INSTALL_FIP_FILENAME}
|
||||||
|
if test $? -eq 1; then
|
||||||
|
echo "[ERROR] Failed to update fip-b!";
|
||||||
|
echo "";
|
||||||
|
echo "Aborted.";
|
||||||
|
exit;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set 'bootcmd' to the second part of the script that will
|
# Set 'bootcmd' to the second part of the script that will
|
||||||
# - Reset environment to defaults
|
# - Reset environment to defaults
|
||||||
# - Restore 'dualboot' if previously set
|
# - Restore 'dualboot' if previously set
|
||||||
# - Run 'partition_nand_linux' script to re-partition the NAND if needed
|
# - Run 'ubivolscript' script to re-partition the UBI partition and save the
|
||||||
# - Save the environment
|
# environment
|
||||||
# - If Dual Boot
|
# - If Dual Boot
|
||||||
# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b
|
# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b
|
||||||
# - If Normal Boot:
|
# - If Normal Boot:
|
||||||
# - Update the system partitions: linux, recovery, rootfs
|
# - Update the system partitions: linux, recovery, rootfs
|
||||||
# - Erase the 'update' partition
|
|
||||||
# - Configure recovery to wipe 'update' partition
|
# - Configure recovery to wipe 'update' partition
|
||||||
# - Run 'recovery' and let the system boot after
|
# - Run 'recovery' and let the system boot after
|
||||||
setenv bootcmd "
|
setenv bootcmd "
|
||||||
env default -a;
|
env default -a;
|
||||||
setenv dualboot ${dualboot};
|
setenv dualboot ${dualboot};
|
||||||
run partition_nand_linux;
|
|
||||||
saveenv;
|
|
||||||
run ubivolscript;
|
run ubivolscript;
|
||||||
if test \"\$\{dualboot\}\" = yes; then
|
if test \"\$\{dualboot\}\" = yes; then
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -233,8 +223,8 @@ setenv bootcmd "
|
||||||
echo \"\";
|
echo \"\";
|
||||||
setenv boot_recovery yes;
|
setenv boot_recovery yes;
|
||||||
setenv recovery_command wipe_update;
|
setenv recovery_command wipe_update;
|
||||||
|
saveenv;
|
||||||
fi;
|
fi;
|
||||||
saveenv;
|
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \">> Firmware installation complete.\";
|
echo \">> Firmware installation complete.\";
|
||||||
|
|
|
||||||
|
|
@ -7,40 +7,8 @@
|
||||||
install_abort=0
|
install_abort=0
|
||||||
BASEFILENAME=0
|
BASEFILENAME=0
|
||||||
|
|
||||||
# Determine U-Boot file to program basing on module variant
|
setenv INSTALL_ATF_FILENAME tf-a-##MACHINE##-nand.stm32
|
||||||
if test -n "${module_variant}"; then
|
setenv INSTALL_FIP_FILENAME fip-##MACHINE##-optee.bin
|
||||||
if test "${module_variant}" = "0x02" || test "${module_variant}" = "0x03" || test "${module_variant}" = "0x06" || test "${module_variant}" = "0x0a"; then
|
|
||||||
setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##.imx;
|
|
||||||
elif test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05" || test "${module_variant}" = "0x07"; then
|
|
||||||
setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##1GB.imx;
|
|
||||||
elif test "${module_variant}" = "0x08" || test "${module_variant}" = "0x09"; then
|
|
||||||
setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##512MB.imx
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use 'test -n ...' because 'test -z ...' does not work well on old versions of
|
|
||||||
# u-boot when the checked value is empty.
|
|
||||||
if test -n "${INSTALL_UBOOT_FILENAME}"; then
|
|
||||||
true;
|
|
||||||
else
|
|
||||||
echo "";
|
|
||||||
echo "[ERROR] Cannot determine U-Boot file for this module!";
|
|
||||||
echo "";
|
|
||||||
echo "1. Set variable 'INSTALL_UBOOT_FILENAME' depending on your ConnectCore 6UL variant:";
|
|
||||||
echo " - For a SOM with 1GB DDR3, run:";
|
|
||||||
echo " => setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##1GB.imx";
|
|
||||||
echo " - For a SOM with 512MB DDR3, run:";
|
|
||||||
echo " => setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##512MB.imx";
|
|
||||||
echo " - For a SOM with 256MB DDR3, run:";
|
|
||||||
echo " => setenv INSTALL_UBOOT_FILENAME u-boot-##MACHINE##.imx";
|
|
||||||
echo "";
|
|
||||||
echo "2. Run the install script again.";
|
|
||||||
echo "";
|
|
||||||
echo "Aborted";
|
|
||||||
echo "";
|
|
||||||
exit;
|
|
||||||
fi;
|
|
||||||
|
|
||||||
setenv INSTALL_USBDEV 0
|
setenv INSTALL_USBDEV 0
|
||||||
|
|
||||||
if test -z "${image-name}"; then
|
if test -z "${image-name}"; then
|
||||||
|
|
@ -60,7 +28,7 @@ setenv INSTALL_RECOVERY_FILENAME ${BASEFILENAME}-##MACHINE##.recovery.ubifs
|
||||||
setenv INSTALL_ROOTFS_FILENAME ${BASEFILENAME}-##MACHINE##.ubifs
|
setenv INSTALL_ROOTFS_FILENAME ${BASEFILENAME}-##MACHINE##.ubifs
|
||||||
|
|
||||||
# Check for presence of firmware files on the USB
|
# Check for presence of firmware files on the USB
|
||||||
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
|
for install_f in ${INSTALL_ATF_FILENAME} ${INSTALL_FIP_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
|
||||||
if test ! -e usb ${INSTALL_USBDEV} ${install_f}; then
|
if test ! -e usb ${INSTALL_USBDEV} ${install_f}; then
|
||||||
echo "ERROR: Could not find file ${install_f}";
|
echo "ERROR: Could not find file ${install_f}";
|
||||||
install_abort=1;
|
install_abort=1;
|
||||||
|
|
@ -80,7 +48,10 @@ echo " on the partitions of the NAND."
|
||||||
echo ""
|
echo ""
|
||||||
echo " PARTITION FILENAME"
|
echo " PARTITION FILENAME"
|
||||||
echo " --------- --------"
|
echo " --------- --------"
|
||||||
echo " bootloader ${INSTALL_UBOOT_FILENAME}"
|
echo " fsbl1 ${INSTALL_ATF_FILENAME}"
|
||||||
|
echo " fsbl2 ${INSTALL_ATF_FILENAME}"
|
||||||
|
echo " fip-a ${INSTALL_FIP_FILENAME}"
|
||||||
|
echo " fip-b ${INSTALL_FIP_FILENAME}"
|
||||||
if test "${dualboot}" = "yes"; then
|
if test "${dualboot}" = "yes"; then
|
||||||
echo " linux_a ${INSTALL_LINUX_FILENAME}"
|
echo " linux_a ${INSTALL_LINUX_FILENAME}"
|
||||||
echo " linux_b ${INSTALL_LINUX_FILENAME}"
|
echo " linux_b ${INSTALL_LINUX_FILENAME}"
|
||||||
|
|
@ -108,41 +79,60 @@ setenv forced_update 1
|
||||||
# the first reset.
|
# the first reset.
|
||||||
setenv bootdelay 0
|
setenv bootdelay 0
|
||||||
|
|
||||||
# Update U-Boot
|
# Update ATF and FIP images
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo ">> Installing U-Boot boot loader image ${INSTALL_UBOOT_FILENAME} (target will reset)"
|
echo ">> Installing ATF boot loader image ${INSTALL_ATF_FILENAME}"
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME}
|
update fsbl1 usb ${INSTALL_USBDEV} ${INSTALL_ATF_FILENAME}
|
||||||
if test $? -eq 1; then
|
if test $? -eq 1; then
|
||||||
# Use old-style update with source file system argument
|
echo "[ERROR] Failed to update fsbl1!";
|
||||||
update uboot usb ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME}
|
echo "";
|
||||||
if test $? -eq 1; then
|
echo "Aborted.";
|
||||||
echo "[ERROR] Failed to update U-Boot boot loader!";
|
exit;
|
||||||
echo "";
|
fi
|
||||||
echo "Aborted.";
|
update fsbl2 usb ${INSTALL_USBDEV} ${INSTALL_ATF_FILENAME}
|
||||||
exit;
|
if test $? -eq 1; then
|
||||||
fi
|
echo "[ERROR] Failed to update fsbl2!";
|
||||||
|
echo "";
|
||||||
|
echo "Aborted.";
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo ">> Installing FIP boot loader image ${INSTALL_FIP_FILENAME} (target will reset)"
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
update fip-a usb ${INSTALL_USBDEV} ${INSTALL_FIP_FILENAME}
|
||||||
|
if test $? -eq 1; then
|
||||||
|
echo "[ERROR] Failed to update fip-a!";
|
||||||
|
echo "";
|
||||||
|
echo "Aborted.";
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
update fip-b usb ${INSTALL_USBDEV} ${INSTALL_FIP_FILENAME}
|
||||||
|
if test $? -eq 1; then
|
||||||
|
echo "[ERROR] Failed to update fip-b!";
|
||||||
|
echo "";
|
||||||
|
echo "Aborted.";
|
||||||
|
exit;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set 'bootcmd' to the second part of the script that will
|
# Set 'bootcmd' to the second part of the script that will
|
||||||
# - Reset environment to defaults
|
# - Reset environment to defaults
|
||||||
# - Restore 'dualboot' if previously set
|
# - Restore 'dualboot' if previously set
|
||||||
# - Run 'partition_nand_linux' script to re-partition the NAND if needed
|
# - Run 'ubivolscript' script to re-partition the UBI partition and save the
|
||||||
# - Save the environment
|
# environment
|
||||||
# - If Dual Boot
|
# - If Dual Boot
|
||||||
# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b
|
# - Update the system partitions: linux_a, linux_b, rootfs_a, rootfs_b
|
||||||
# - If Normal Boot:
|
# - If Normal Boot:
|
||||||
# - Update the system partitions: linux, recovery, rootfs
|
# - Update the system partitions: linux, recovery, rootfs
|
||||||
# - Erase the 'update' partition
|
|
||||||
# - Configure recovery to wipe 'update' partition
|
# - Configure recovery to wipe 'update' partition
|
||||||
# - Run 'recovery' and let the system boot after
|
# - Run 'recovery' and let the system boot after
|
||||||
setenv bootcmd "
|
setenv bootcmd "
|
||||||
env default -a;
|
env default -a;
|
||||||
setenv dualboot ${dualboot};
|
setenv dualboot ${dualboot};
|
||||||
run partition_nand_linux;
|
|
||||||
saveenv;
|
|
||||||
run ubivolscript;
|
run ubivolscript;
|
||||||
usb start;
|
usb start;
|
||||||
if test \"\$\{dualboot\}\" = yes; then
|
if test \"\$\{dualboot\}\" = yes; then
|
||||||
|
|
@ -234,8 +224,8 @@ setenv bootcmd "
|
||||||
echo \"\";
|
echo \"\";
|
||||||
setenv boot_recovery yes;
|
setenv boot_recovery yes;
|
||||||
setenv recovery_command wipe_update;
|
setenv recovery_command wipe_update;
|
||||||
|
saveenv;
|
||||||
fi;
|
fi;
|
||||||
saveenv;
|
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \">> Firmware installation complete.\";
|
echo \">> Firmware installation complete.\";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
# Copyright (C) 2020-2021 by Digi International Inc.
|
# Copyright (C) 2022 by Digi International Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
|
@ -32,13 +32,15 @@ show_usage()
|
||||||
echo "Usage: $0 [options]"
|
echo "Usage: $0 [options]"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Options:"
|
echo " Options:"
|
||||||
|
echo " -a <atf-filename> Arm-trusted-firmware filename."
|
||||||
|
echo " Auto-determined by variant if not provided."
|
||||||
|
echo " -f <fip-filename> FIP filename."
|
||||||
|
echo " Auto-determined by variant if not provided."
|
||||||
echo " -h Show this help."
|
echo " -h Show this help."
|
||||||
echo " -i <dey-image-name> Image name that prefixes the image filenames, such as 'dey-image-qt', "
|
echo " -i <dey-image-name> Image name that prefixes the image filenames, such as 'dey-image-qt', "
|
||||||
echo " 'dey-image-webkit', 'core-image-base'..."
|
echo " 'dey-image-webkit', 'core-image-base'..."
|
||||||
echo " Defaults to '##DEFAULT_IMAGE_NAME##' if not provided."
|
echo " Defaults to '##DEFAULT_IMAGE_NAME##' if not provided."
|
||||||
echo " -n No wait. Skips 10 seconds delay to stop script."
|
echo " -n No wait. Skips 10 seconds delay to stop script."
|
||||||
echo " -u <u-boot-filename> U-Boot filename."
|
|
||||||
echo " Auto-determined by variant if not provided."
|
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +61,7 @@ part_update()
|
||||||
echo "\033[0m"
|
echo "\033[0m"
|
||||||
|
|
||||||
uuu fb: download -f "${2}"
|
uuu fb: download -f "${2}"
|
||||||
uuu "fb[-t ${3}]:" ucmd update "${1}" ram \${fastboot_buffer} \${fastboot_bytes} ${ERASE}
|
uuu "fb[-t ${3}]:" ucmd update "${1}" ram \${fastboot_buffer} \${filesize} ${ERASE}
|
||||||
}
|
}
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
@ -68,15 +70,17 @@ echo "# Linux firmware install through USB OTG #"
|
||||||
echo "############################################################"
|
echo "############################################################"
|
||||||
|
|
||||||
# Command line admits the following parameters:
|
# Command line admits the following parameters:
|
||||||
# -u <u-boot-filename>
|
# -a <atf-filename>
|
||||||
|
# -f <fip-filename>
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
while getopts 'hi:nu:' c
|
while getopts 'a:f:hi:n' c
|
||||||
do
|
do
|
||||||
case $c in
|
case $c in
|
||||||
|
a) INSTALL_ATF_FILENAME=${OPTARG} ;;
|
||||||
|
f) INSTALL_FIP_FILENAME=${OPTARG} ;;
|
||||||
h) show_usage ;;
|
h) show_usage ;;
|
||||||
i) IMAGE_NAME=${OPTARG} ;;
|
i) IMAGE_NAME=${OPTARG} ;;
|
||||||
n) NOWAIT=true ;;
|
n) NOWAIT=true ;;
|
||||||
u) INSTALL_UBOOT_FILENAME=${OPTARG} ;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -89,54 +93,21 @@ if [ "${dualboot}" = "yes" ]; then
|
||||||
DUALBOOT=true;
|
DUALBOOT=true;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# remove redirect
|
||||||
|
uuu fb: ucmd setenv stdout serial
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Determining image files to use..."
|
echo "Determining image files to use..."
|
||||||
|
|
||||||
# Determine U-Boot filename if not provided
|
# Determine ATF file to program
|
||||||
if [ -z "${INSTALL_UBOOT_FILENAME}" ]; then
|
if [ -z "${INSTALL_ATF_FILENAME}" ]; then
|
||||||
module_variant=$(getenv "module_variant")
|
INSTALL_ATF_FILENAME="tf-a-##MACHINE##-nand.stm32"
|
||||||
# Determine U-Boot file to program basing on SOM's variant
|
|
||||||
if [ -n "$module_variant" ] || [ "$module_variant" = "0x00" ]; then
|
|
||||||
if [ "$module_variant" = "0x08" ] || \
|
|
||||||
[ "$module_variant" = "0x09" ]; then
|
|
||||||
INSTALL_UBOOT_FILENAME="u-boot-##MACHINE##512MB.imx"
|
|
||||||
elif [ "$module_variant" = "0x04" ] || \
|
|
||||||
[ "$module_variant" = "0x05" ] || \
|
|
||||||
[ "$module_variant" = "0x07" ]; then
|
|
||||||
INSTALL_UBOOT_FILENAME="u-boot-##MACHINE##1GB.imx"
|
|
||||||
else
|
|
||||||
INSTALL_UBOOT_FILENAME="u-boot-##MACHINE##.imx"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# U-Boot when the checked value is empty.
|
|
||||||
if [ -n "${INSTALL_UBOOT_FILENAME}" ]; then
|
|
||||||
true
|
|
||||||
else
|
|
||||||
# remove redirect
|
|
||||||
uuu fb: ucmd setenv stdout serial
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "[ERROR] Cannot determine U-Boot file for this module!"
|
|
||||||
echo ""
|
|
||||||
echo "1. Add U-boot file name, depending on your ConnectCore 6UL variant, to script command line:"
|
|
||||||
echo " - For a SOM with 1GB DDR3, run:"
|
|
||||||
echo " => ./install_linux_fw_uuu.sh -u u-boot-##MACHINE##1GB.imx"
|
|
||||||
echo " - For a SOM with 512MB DDR3, run:"
|
|
||||||
echo " => ./install_linux_fw_uuu.sh -u u-boot-##MACHINE##512MB.imx"
|
|
||||||
echo " - For a SOM with 256MB DDR3, run:"
|
|
||||||
echo " => ./install_linux_fw_uuu.sh -u u-boot-##MACHINE##.imx"
|
|
||||||
echo ""
|
|
||||||
echo "2. Run the install script again."
|
|
||||||
echo ""
|
|
||||||
echo "Aborted"
|
|
||||||
echo ""
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove redirect
|
# Determine FIP file to program
|
||||||
uuu fb: ucmd setenv stdout serial
|
if [ -z "${INSTALL_FIP_FILENAME}" ]; then
|
||||||
|
INSTALL_FIP_FILENAME="fip-##MACHINE##-optee.bin"
|
||||||
|
fi
|
||||||
|
|
||||||
# Determine linux, recovery, and rootfs image filenames to update
|
# Determine linux, recovery, and rootfs image filenames to update
|
||||||
if [ -z "${IMAGE_NAME}" ]; then
|
if [ -z "${IMAGE_NAME}" ]; then
|
||||||
|
|
@ -156,7 +127,7 @@ INSTALL_RECOVERY_FILENAME="${BASEFILENAME}-##MACHINE##.recovery.ubifs"
|
||||||
INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-##MACHINE##.ubifs"
|
INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-##MACHINE##.ubifs"
|
||||||
|
|
||||||
# Verify existance of files before starting the update
|
# Verify existance of files before starting the update
|
||||||
FILES="${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}"
|
FILES="${INSTALL_ATF_FILENAME} ${INSTALL_FIP_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}"
|
||||||
for f in ${FILES}; do
|
for f in ${FILES}; do
|
||||||
if [ ! -f ${f} ]; then
|
if [ ! -f ${f} ]; then
|
||||||
echo "\033[31m[ERROR] Could not find file '${f}'\033[0m"
|
echo "\033[31m[ERROR] Could not find file '${f}'\033[0m"
|
||||||
|
|
@ -182,7 +153,10 @@ if [ "${NOWAIT}" != true ]; then
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf " PARTITION\tFILENAME\n"
|
printf " PARTITION\tFILENAME\n"
|
||||||
printf " ---------\t--------\n"
|
printf " ---------\t--------\n"
|
||||||
printf " bootloader\t${INSTALL_UBOOT_FILENAME}\n"
|
printf " fsbl1\t${INSTALL_ATF_FILENAME}\n"
|
||||||
|
printf " fsbl2\t${INSTALL_ATF_FILENAME}\n"
|
||||||
|
printf " fip-a\t${INSTALL_FIP_FILENAME}\n"
|
||||||
|
printf " fip-b\t${INSTALL_FIP_FILENAME}\n"
|
||||||
if [ "${DUALBOOT}" = true ]; then
|
if [ "${DUALBOOT}" = true ]; then
|
||||||
printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n"
|
printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n"
|
||||||
printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n"
|
printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n"
|
||||||
|
|
@ -211,20 +185,26 @@ uuu fb: ucmd setenv fastboot_buffer \${loadaddr}
|
||||||
# Skip user confirmation for U-Boot update
|
# Skip user confirmation for U-Boot update
|
||||||
uuu fb: ucmd setenv forced_update 1
|
uuu fb: ucmd setenv forced_update 1
|
||||||
|
|
||||||
# Update U-Boot
|
# Update ATF
|
||||||
part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000
|
part_update "fsbl1" "${INSTALL_ATF_FILENAME}" 5000
|
||||||
|
part_update "fsbl2" "${INSTALL_ATF_FILENAME}" 5000
|
||||||
|
|
||||||
|
# Update FIP
|
||||||
|
part_update "fip-a" "${INSTALL_FIP_FILENAME}" 5000
|
||||||
|
part_update "fip-b" "${INSTALL_FIP_FILENAME}" 5000
|
||||||
|
|
||||||
|
|
||||||
# Set 'bootcmd' for the second part of the script that will
|
# Set 'bootcmd' for the second part of the script that will
|
||||||
# - Reset environment to defaults
|
# - Reset environment to defaults
|
||||||
|
# - Keep the 'dualboot' status
|
||||||
# - Save the environment
|
# - Save the environment
|
||||||
# - Update the 'linux' partition
|
# - Update the 'linux' partition(s)
|
||||||
# - Update the 'recovery' partition
|
# - Update the 'rootfs' partition(s)
|
||||||
# - Update the 'rootfs' partition
|
|
||||||
# - Erase the 'update' partition
|
|
||||||
uuu fb: ucmd setenv bootcmd "
|
uuu fb: ucmd setenv bootcmd "
|
||||||
env default -a;
|
env default -a;
|
||||||
setenv dualboot \${dualboot};
|
setenv dualboot \${dualboot};
|
||||||
saveenv;
|
saveenv;
|
||||||
|
saveenv;
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \">> Installing Linux firmware\";
|
echo \">> Installing Linux firmware\";
|
||||||
|
|
@ -237,16 +217,13 @@ uuu fb: ucmd saveenv
|
||||||
uuu fb: acmd reset
|
uuu fb: acmd reset
|
||||||
|
|
||||||
# Wait for the target to reset
|
# Wait for the target to reset
|
||||||
sleep 3
|
sleep 8
|
||||||
|
|
||||||
# Set fastboot buffer address to $loadaddr
|
# Set fastboot buffer address to $loadaddr
|
||||||
uuu fb: ucmd setenv fastboot_buffer \${loadaddr}
|
uuu fb: ucmd setenv fastboot_buffer \${loadaddr}
|
||||||
|
|
||||||
# Create partition table
|
# Create UBI volumes
|
||||||
uuu "fb[-t 10000]:" ucmd run partition_nand_linux
|
uuu "fb[-t 20000]:" ucmd run ubivolscript
|
||||||
|
|
||||||
uuu "fb[-t 30000]:" ucmd nand erase.part system
|
|
||||||
uuu "fb[-t 10000]:" ucmd run ubivolscript
|
|
||||||
|
|
||||||
if [ "${DUALBOOT}" = true ]; then
|
if [ "${DUALBOOT}" = true ]; then
|
||||||
# Update Linux A
|
# Update Linux A
|
||||||
|
|
@ -264,19 +241,12 @@ else
|
||||||
part_update "${RECOVERY_NAME}" "${INSTALL_RECOVERY_FILENAME}" 15000
|
part_update "${RECOVERY_NAME}" "${INSTALL_RECOVERY_FILENAME}" 15000
|
||||||
# Update Rootfs
|
# Update Rootfs
|
||||||
part_update "${ROOTFS_NAME}" "${INSTALL_ROOTFS_FILENAME}" 90000
|
part_update "${ROOTFS_NAME}" "${INSTALL_ROOTFS_FILENAME}" 90000
|
||||||
fi
|
# Configure u-boot to boot into recovery mode and format the
|
||||||
|
# 'update' partition
|
||||||
if [ "${DUALBOOT}" != true ]; then
|
|
||||||
# Erase the 'Update' partition
|
|
||||||
uuu "fb[-t 20000]:" ucmd nand erase.part update
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${DUALBOOT}" != true ]; then
|
|
||||||
# Configure u-boot to boot into recovery mode
|
|
||||||
uuu fb: ucmd setenv boot_recovery yes
|
uuu fb: ucmd setenv boot_recovery yes
|
||||||
uuu fb: ucmd setenv recovery_command wipe_update
|
uuu fb: ucmd setenv recovery_command wipe_update
|
||||||
|
uuu fb: ucmd saveenv
|
||||||
fi
|
fi
|
||||||
uuu fb: ucmd saveenv
|
|
||||||
|
|
||||||
# Reset the target
|
# Reset the target
|
||||||
uuu fb: acmd reset
|
uuu fb: acmd reset
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue