Verified Commit e599017f authored by Vincent Coubard's avatar Vincent Coubard
Browse files

Add support to build and run on Corstone-310



This is controlled by the option "-t" or "--target" that can be passed
to ats commands provided by ats.sh.
The value of the options can be Corstone-300 or Corstone-310
conftest.py has also been updated to support multiple AVH.
Use the option --avh followed by the path to the avh to use to select
an avh.
Signed-off-by: Vincent Coubard's avatarVincent Coubard <vincent.coubard@arm.com>
parent 52e708fb
......@@ -21,6 +21,7 @@ import subprocess
def pytest_addoption(parser):
parser.addoption("--build-path", action="store", default="build")
parser.addoption("--credentials-path", action="store", default="credentials")
parser.addoption("--avh", action="store", default="/arm/fvp/VHT_Corstone_SSE-300_Ethos-U55")
@pytest.fixture()
......@@ -36,8 +37,8 @@ def credentials_path(pytestconfig):
@pytest.fixture
def fvp_path():
yield '/opt/VHT/VHT_Corstone_SSE-300_Ethos-U55'
def fvp_path(pytestconfig):
yield pytestconfig.getoption("--avh")
@pytest.fixture
......@@ -66,6 +67,10 @@ def fvp(fvp_path, build_path, vsi_script_path, binary_path):
'-C', 'mps3_board.smsc_91c111.enabled=1',
'-C', 'mps3_board.hostbridge.userNetworking=1',
'-C', 'mps3_board.DISABLE_GATING=1',
'-C', 'cpu0.CFGDTCMSZ=10',
'-C', 'cpu0.CFGITCMSZ=10',
'-C', 'cpu0.INITNSVTOR=0x00000000',
'-C', 'cpu0.INITSVTOR=0x10000000',
'-V', f'{vsi_script_path}'
]
......
#!/bin/bash
# Copyright (c) 2021 Arm Limited. All rights reserved.
# Copyright (c) 2021-2022 Arm Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
......@@ -24,6 +24,8 @@ EXAMPLE=""
CLEAN=0
BUILD_PATH="$ROOT/build"
CREDENTIALS_PATH="$ROOT/bsp/default_credentials"
TARGET="Corstone-300"
TARGET_PROCESSOR=""
set -e
......@@ -47,8 +49,8 @@ function build_with_cmake {
set -ex
# Note: A bug in CMake force us to set the toolchain here
cmake -G Ninja -S . -B $BUILD_PATH --toolchain=toolchains/toolchain-armclang.cmake -DCMAKE_SYSTEM_PROCESSOR=cortex-m55 -DAWS_CONFIG_CREDENTIALS_PATH=$CREDENTIALS_PATH
cmake --build $BUILD_PATH --target $EXAMPLE
cmake -G Ninja -S . -B $BUILD_PATH --toolchain=toolchains/toolchain-armclang.cmake -DCMAKE_SYSTEM_PROCESSOR=$TARGET_PROCESSOR -DAWS_CONFIG_CREDENTIALS_PATH=$CREDENTIALS_PATH -DTS_TARGET=$TARGET
cmake --build $BUILD_PATH --target $EXAMPLE
)
}
......@@ -63,6 +65,7 @@ Options:
-c,--clean Clean build
-p,--path Build path
-a,--credentials Credentials path
-t,--target Build target (Corstone-300 or Corstone-310)
Examples:
blinky
......@@ -75,8 +78,8 @@ if [[ $# -eq 0 ]]; then
exit 1
fi
SHORT=a:p:,c,h
LONG=credentials:path:,clean,help
SHORT=a:p:t:,c,h
LONG=credentials:path:target:,clean,help
OPTS=$(getopt -n build --options $SHORT --longoptions $LONG -- "$@")
eval set -- "$OPTS"
......@@ -100,6 +103,10 @@ do
CREDENTIALS_PATH=$ROOT/$2
shift 2
;;
-t | --target )
TARGET=$2
shift 2
;;
--)
shift;
break
......@@ -126,4 +133,18 @@ case "$1" in
;;
esac
case "$TARGET" in
Corstone-300 )
TARGET_PROCESSOR="cortex-m55"
;;
Corstone-310 )
TARGET_PROCESSOR="cortex-m85"
;;
*)
echo "Invalid target <Corstone-300|Corstone-310>"
show_usage
exit 2
;;
esac
build_with_cmake
#!/bin/bash
# Copyright (c) 2021 Arm Limited. All rights reserved.
# Copyright (c) 2021-2022 Arm Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
......@@ -16,6 +16,9 @@
# limitations under the License.
BUILD_PATH="build"
TARGET="Corstone-300"
TARGET_OPTIONS=""
FVP_BIN=""
function show_usage {
cat <<EOF
......@@ -26,6 +29,7 @@ Run an example.
Options:
-h,--help Show this help
-p,--path Build path
-t,--target Target to run
Examples:
blinky
......@@ -33,8 +37,8 @@ Examples:
EOF
}
SHORT=p:,h
LONG=path:,help
SHORT=p:t:,h
LONG=path:target:,help
OPTS=$(getopt -n run --options $SHORT --longoptions $LONG -- "$@")
eval set -- "$OPTS"
......@@ -50,6 +54,10 @@ do
BUILD_PATH=$2
shift 2
;;
-t | --target )
TARGET=$2
shift 2
;;
--)
shift;
break
......@@ -72,16 +80,24 @@ case "$1" in
;;
esac
set -x
FVP_BIN=VHT-Corstone-300.x
case "$TARGET" in
Corstone-300 )
FVP_BIN="VHT_Corstone_SSE-300_Ethos-U55"
;;
Corstone-310 )
TARGET_OPTIONS="-C cpu0.CFGDTCMSZ=10 -C cpu0.CFGITCMSZ=10 -C cpu0.INITNSVTOR=0x00000000 -C cpu0.INITSVTOR=0x10000000"
FVP_BIN="VHT_Corstone-Polaris"
;;
*)
echo "Invalid target <Corstone-300|Corstone-310>"
show_usage
exit 2
;;
esac
# for AMI compatibility check if model exists in known location
if test -f "/opt/VHT/VHT_Corstone_SSE-300_Ethos-U55"; then
FVP_BIN=/opt/VHT/VHT_Corstone_SSE-300_Ethos-U55
fi
set -x
VSI_PY_PATH=$PWD/lib/VHT/interface/audio/python
OPTIONS="-V $VSI_PY_PATH -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.smsc_91c111.enabled=1 -C mps3_board.hostbridge.userNetworking=1 -C cpu0.semihosting-enable=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file="-" -C mps3_board.uart0.unbuffered_output=1 --stat -C mps3_board.DISABLE_GATING=1"
$FVP_BIN $OPTIONS -a cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@0x38000000 --data "$BUILD_PATH/$1/$1_signed.bin"@0x28060000
$FVP_BIN $OPTIONS $TARGET_OPTIONS -a cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@0x38000000 --data "$BUILD_PATH/$1/$1_signed.bin"@0x28060000
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment