Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | INSTALLER_DIR="`dirname ${0}`" |
| 4 | |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 5 | # for cases that don't run "lunch db845c-userdebug" |
| 6 | if [ -z "${ANDROID_BUILD_TOP}" ]; then |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 7 | ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`" |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 8 | fi |
| 9 | |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 10 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 11 | . "${ANDROID_BUILD_TOP}/device/linaro/dragonboard/vendor-package-ver.sh" |
| 12 | |
| 13 | FIRMWARE_DIR="${ANDROID_BUILD_TOP}/vendor/linaro/db845c/${EXPECTED_LINARO_VENDOR_VERSION}" |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 14 | |
| 15 | # TODO: Pull one-time recovery/qdl path out of standard install |
| 16 | # Flash bootloader firmware files |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 17 | if [ ! -d "${FIRMWARE_DIR}/" ]; then |
| 18 | echo "RECOVERY: Missing vendor firmware package?" |
| 19 | echo " Make sure the vendor binaries have been downloaded from" |
| 20 | echo " ${VND_PKG_URL}" |
| 21 | echo " and extracted to $ANDROID_BUILD_TOP." |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 22 | exit |
| 23 | fi |
| 24 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 25 | QDL="`readlink -f ${FIRMWARE_DIR}/qdl/qdl`" |
| 26 | |
| 27 | pushd "${FIRMWARE_DIR}/dragonboard-845c-bootloader-ufs-aosp" > /dev/null |
| 28 | echo "RECOVERY: Running QDL board recovery tool" |
| 29 | sudo ${QDL} prog_firehose_ddr.elf rawprogram[012345].xml patch[012345].xml |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 30 | popd > /dev/null |
| 31 | |
| 32 | echo |
| 33 | echo |
| 34 | echo "RECOVERY: Please boot the db845c into fastboot mode, and use the flash-all-aosp.sh script!" |
| 35 | echo |