summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUsama Arif <usama.arif@arm.com>2020-10-26 20:45:55 +0000
committerTushar Khandelwal <tushar.khandelwal@arm.com>2020-10-26 22:42:11 +0000
commitefd71bfc1d464c65b9525549c026ffa88397e61e (patch)
tree5cc83a1333c81dbf05dcdc74e5e2798dc340d15e
parent98bfa31c7c10fb2ddb6bd7922cd27c5ad7389f6c (diff)
platform/tc0: run-scripts update for tc0TC0-2020.10.29
This include the following changes: - Move creation of android images to build-scripts. - parameter changes for Android verified boot and verified u-boot. - Enable DPU. Signed-off-by: Usama Arif <usama.arif@arm.com>
-rwxr-xr-xtc0/add-uboot-header.sh45
-rwxr-xr-xtc0/create_android_image.sh86
-rwxr-xr-xtc0/run_model.sh45
3 files changed, 19 insertions, 157 deletions
diff --git a/tc0/add-uboot-header.sh b/tc0/add-uboot-header.sh
deleted file mode 100755
index de04cc6..0000000
--- a/tc0/add-uboot-header.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2020, ARM Limited and Contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# Neither the name of ARM nor the names of its contributors may be used
-# to endorse or promote products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-set -e
-
-if [ -z "$ANDROID_PRODUCT_OUT" ]
-then
- echo "var ANDROID_PRODUCT_OUT is empty"
- exit 1
-fi
-
-pushd .
-
-cd $ANDROID_PRODUCT_OUT
-
-mkimage -A arm64 -O linux -C none -T ramdisk -n ramdisk -a 0x88000000 -e 0x88000000 -n "Total Compute Ramdisk" -d ramdisk.img ramdisk_uboot.img
-
-popd \ No newline at end of file
diff --git a/tc0/create_android_image.sh b/tc0/create_android_image.sh
deleted file mode 100755
index 040a83e..0000000
--- a/tc0/create_android_image.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2020, ARM Limited and Contributors. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# Neither the name of ARM nor the names of its contributors may be used
-# to endorse or promote products derived from this software without specific
-# prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-set -e
-
-if [ -z "$ANDROID_PRODUCT_OUT" ]
-then
- echo "var ANDROID_PRODUCT_OUT is empty"
- exit 1
-fi
-
-pushd .
-
-cd $ANDROID_PRODUCT_OUT
-
-IMG=${IMG:-android.img}
-
-size_in_mb() {
- local size_in_bytes
- size_in_bytes=$(wc -c $1)
- size_in_bytes=${size_in_bytes%% *}
- echo $((size_in_bytes / 1024 / 1024 + 1))
-}
-
-SYSTEM_IMG=${SYSTEM_IMG:-system.img}
-SYSTEM_SIZE=$(size_in_mb ${SYSTEM_IMG})
-USERDATA_IMG=${USERDATA_IMG:-userdata.img}
-USERDATA_SIZE=$(size_in_mb ${USERDATA_IMG})
-
-IMAGE_LEN=$((SYSTEM_SIZE + USERDATA_SIZE + 4))
-
-# measured in MBytes
-PART1_START=1
-PART1_END=4
-PART2_START=${PART1_END}
-PART2_END=$((PART2_START + SYSTEM_SIZE))
-PART3_START=${PART2_END}
-PART3_END=${IMAGE_LEN}
-
-# We don't want parted to mess with alignment or try to be smart
-PARTED="parted -a none --script"
-
-# Create an empty disk image file
-dd if=/dev/zero of=$IMG bs=1M count=$IMAGE_LEN
-
-# Create a partition table
-$PARTED $IMG unit s mktable msdos
-
-# Create partitions
-SEC_PER_MB=$((1024*2))
-$PARTED $IMG unit s mkpart p fat32 $((PART1_START * SEC_PER_MB)) $((PART1_END * SEC_PER_MB - 1))
-$PARTED $IMG unit s mkpart p ext4 $((PART2_START * SEC_PER_MB)) $((PART2_END * SEC_PER_MB - 1))
-$PARTED $IMG unit s mkpart p ext4 $((PART3_START * SEC_PER_MB)) $((PART3_END * SEC_PER_MB - 1))
-
-# Assemble all the images into one final image
-dd if=$SYSTEM_IMG of=$IMG bs=1M seek=${PART2_START} conv=notrunc
-dd if=$USERDATA_IMG of=$IMG bs=1M seek=${PART3_START} conv=notrunc
-
-popd \ No newline at end of file
diff --git a/tc0/run_model.sh b/tc0/run_model.sh
index de98a3f..860d850 100755
--- a/tc0/run_model.sh
+++ b/tc0/run_model.sh
@@ -30,8 +30,6 @@
RUN_SCRIPTS_DIR=$(dirname "$0")
-export FASTSIM_CMN_INTERNAL_RNSAM=1
-
#NOTE: The OPTIONS below are misaligned on purpose so that they appear aligned when the script is called.
incorrect_script_use () {
echo "Incorrect script use, call script as:"
@@ -39,7 +37,7 @@ incorrect_script_use () {
echo "OPTIONS:"
echo "-m, --model path to model"
echo "-d, --distro distro version, values supported [poky, android-nano, android-swr]"
- echo "-g, --generate-android-image [OPTIONAL] generate android image and ramdisk, values supported [true, false], DEFAULT: true"
+ echo "-a, --avb [OPTIONAL] avb boot, values supported [true, false], DEFAULT: false"
echo "-t, --tap-interface [OPTIONAL] tap interface"
echo "-e, --extra-model-params [OPTIONAL] extra model parameters"
echo "If using an android distro, export ANDROID_PRODUCT_OUT variable to point to android out directory"
@@ -77,14 +75,11 @@ check_file_exists_and_exit () {
check_android_images () {
check_file_exists_and_exit $ANDROID_PRODUCT_OUT/system.img
check_file_exists_and_exit $ANDROID_PRODUCT_OUT/userdata.img
+ [ "$AVB" == true ] && check_file_exists_and_exit $ANDROID_PRODUCT_OUT/vbmeta.img
+ [ "$AVB" == true ] && check_file_exists_and_exit $ANDROID_PRODUCT_OUT/boot.img
}
-make_ramdisk_android_image () {
- ./"$RUN_SCRIPTS_DIR"/add-uboot-header.sh
- ./"$RUN_SCRIPTS_DIR"/create_android_image.sh
-}
-
-GENERATE_ANDROID_IMAGE=true
+AVB=false
while [[ $# -gt 0 ]]
do
@@ -111,8 +106,8 @@ do
shift
shift
;;
- -g|--generate-android-image)
- GENERATE_ANDROID_IMAGE="$2"
+ -a|--avb)
+ AVB="$2"
shift
shift
;;
@@ -125,7 +120,7 @@ done
[ -z "$DISTRO" ] && incorrect_script_use || echo "DISTRO=$DISTRO"
echo "TAP_INTERFACE=$TAP_INTERFACE"
echo "EXTRA_MODEL_PARAMS=$EXTRA_MODEL_PARAMS"
-echo "GENERATE_ANDROID_IMAGE=$GENERATE_ANDROID_IMAGE"
+echo "AVB=$AVB"
YOCTO_DIR="$RUN_SCRIPTS_DIR/../../"
@@ -135,33 +130,32 @@ if [ ! -f "$MODEL" ]; then
fi
YOCTO_OUTDIR="${YOCTO_DIR}"/build-poky/tmp-poky/deploy/images/tc0/
-
check_dir_exists_and_exit $YOCTO_OUTDIR "firmware and kernel images"
case $DISTRO in
poky)
- DISTRO_MODEL_PARAMS="--data board.cpu=$YOCTO_OUTDIR/core-image-minimal-tc0.cpio.gz.u-boot@0x8000000"
+ DISTRO_MODEL_PARAMS="--data board.cpu=$YOCTO_OUTDIR/fitImage-core-image-minimal-tc0-tc0@0x20000000"
;;
android-nano)
[ -z "$ANDROID_PRODUCT_OUT" ] && echo "var ANDROID_PRODUCT_OUT is empty" && exit 1
check_dir_exists_and_exit $ANDROID_PRODUCT_OUT "android build images"
check_substring_and_exit $ANDROID_PRODUCT_OUT "tc0_nano"
check_android_images
- [ "$GENERATE_ANDROID_IMAGE" == true ] && make_ramdisk_android_image
- DISTRO_MODEL_PARAMS="--data board.cpu=$ANDROID_PRODUCT_OUT/ramdisk_uboot.img@0x8000000 \
- -C board.virtioblockdevice.image_path=$ANDROID_PRODUCT_OUT/android.img \
- "
- ;;
+ DISTRO_MODEL_PARAMS="-C board.mmc.p_mmc_file=$ANDROID_PRODUCT_OUT/android.img"
+ [ "$AVB" == true ] || DISTRO_MODEL_PARAMS="$DISTRO_MODEL_PARAMS \
+ --data board.cpu=$ANDROID_PRODUCT_OUT/ramdisk_uboot.img@0x8000000 \
+ --data board.cpu=$YOCTO_OUTDIR/Image@0x80000 "
+ ;;
android-swr)
[ -z "$ANDROID_PRODUCT_OUT" ] && echo "var ANDROID_PRODUCT_OUT is empty" && exit 1
check_dir_exists_and_exit $ANDROID_PRODUCT_OUT "android build images"
check_substring_and_exit $ANDROID_PRODUCT_OUT "tc0_swr"
check_android_images
- [ "$GENERATE_ANDROID_IMAGE" == true ] && make_ramdisk_android_image
- DISTRO_MODEL_PARAMS="--data board.cpu=$ANDROID_PRODUCT_OUT/ramdisk_uboot.img@0x8000000 \
- -C board.virtioblockdevice.image_path=$ANDROID_PRODUCT_OUT/android.img \
- "
- ;;
+ DISTRO_MODEL_PARAMS="-C board.mmc.p_mmc_file=$ANDROID_PRODUCT_OUT/android.img"
+ [ "$AVB" == true ] || DISTRO_MODEL_PARAMS="$DISTRO_MODEL_PARAMS \
+ --data board.cpu=$ANDROID_PRODUCT_OUT/ramdisk_uboot.img@0x8000000 \
+ --data board.cpu=$YOCTO_OUTDIR/Image@0x80000 "
+ ;;
*) echo "bad option for distro $3"; incorrect_script_use
;;
esac
@@ -180,14 +174,13 @@ LOGS_DIR="$RUN_SCRIPTS_DIR"/logs
mkdir -p $LOGS_DIR
"$MODEL" \
---data board.cpu=$YOCTO_OUTDIR/Image@0x80000 \
-C css.scp.ROMloader.fname=$YOCTO_OUTDIR/scp_romfw.bin \
-C css.trustedBootROMloader.fname=$YOCTO_OUTDIR/bl1-tc0.bin \
-C board.flashloader0.fname=$YOCTO_OUTDIR/fip-tc0.bin \
-C soc.pl011_uart0.out_file=$LOGS_DIR/uart0_soc.log \
-C soc.pl011_uart1.out_file=$LOGS_DIR/uart1_soc.log \
-C css.pl011_uart_ap.out_file=$LOGS_DIR/uart_ap.log \
--C css.scp.pl011_uart_scp.out_file=$LOGS_DIR/uart_scp.log \
+-C displayController=2 \
${TAP_INTERFACE_MODEL_PARAMS} \
${DISTRO_MODEL_PARAMS} \
${EXTRA_MODEL_PARAMS} \