From 6ecad4eb1300be7c696e93b5a8c77bbb0d674c01 Mon Sep 17 00:00:00 2001 From: Seeta Rama Raju Date: Mon, 19 Oct 2020 19:28:40 +0530 Subject: [PATCH] gpu: nvgpu: update unit.sh file - It will be copy firmware files from "/lib/firmware/" for l4t target. - For Host based UT, it will copy firmware files from gpu-firmware-private Bug 3093555 Change-Id: I97eb0e5f005378a34bc6ce893bcdbb5be2d83cc8 Signed-off-by: Seeta Rama Raju Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2433824 (cherry picked from commit 41e0d44b5f2655e544abf350d30348bd442f3330) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2430023 Reviewed-by: automaticguardword Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/unit.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/userspace/unit.sh b/userspace/unit.sh index 476a23063..813c56974 100755 --- a/userspace/unit.sh +++ b/userspace/unit.sh @@ -31,7 +31,29 @@ options=$(getopt -o t: --long test-level: -- "$@") this_script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" pushd $this_script_dir +FIRMWARES=("/gpu-firmware-private/t19x/gr/net/safety/NETD_img.bin" + "/gpu-firmware-private/t19x/gr/net/safety/fecs_sig.bin" + "/gpu-firmware-private/t19x/gr/net/safety/gpccs_sig.bin" + "/gpu-firmware-private/t19x/gr/fecs/safety/fecs.bin" + "/gpu-firmware-private/t19x/gr/gpccs/safety/gpccs.bin" + "/gpu-firmware-private/t19x/gr/pmu/safety/acr_ucode_prod.bin" + "/gpu-firmware-private/t19x/gr/pmu/safety/acr_ucode_dbg.bin") + +FIRMWARE_TARGET_PATH="/lib/firmware/gv11b/" + +CUR_DIR=`pwd` +DEST_DIR=${CUR_DIR}/firmware/gv11b/ +mkdir -p ${DEST_DIR} + if [ -f nvgpu_unit ]; then + if [ -d ${FIRMWARE_TARGET_PATH} ] + then + cp -rf ${FIRMWARE_TARGET_PATH}/* ${DEST_DIR} + else + echo "${FIRMWARE_TARGET_PATH} doesn't exist\n" + exit 1 + fi + # if the executable is in the current directory, we are running on # target, so use that dir structure LD_LIBRARY_PATH=".:units/igpu" @@ -42,8 +64,27 @@ if [ -f nvgpu_unit ]; then # actual computing time. NVGPU_UNIT="./nvgpu_unit --nvtest --unit-load-path units/igpu --no-color \ --num-threads 1" + else - # running on host + # running on host + if [ "x$TEGRA_TOP" == "x" ] + then + echo "\$TEGRA_TOP must be set!" + exit 1 + fi + + for i in "${FIRMWARES[@]}" + do + if [ -f ${TEGRA_TOP}/${i} ] + then + cp -f ${TEGRA_TOP}/${i} ${DEST_DIR} + else + echo "firmware file \"${TEGRA_TOP}/${i}\" doesn't exist\n" + exit 1 + fi + + done + LD_LIBRARY_PATH="build:build/units" # On host, must run single-threaded to avoid high VAs NVGPU_UNIT="./build/nvgpu_unit --num-threads 1 -r required_tests.ini" @@ -71,5 +112,7 @@ if [ $rc -eq "0" ]; then shift done fi + +rm -rf ${CUR_DIR}/firmware popd exit $rc