Skip to content

Commit

Permalink
blinky: Add tf-m provisioning support
Browse files Browse the repository at this point in the history
In addition, refactor `Tools/scripts/run.sh` to provide tf-m
provisioning bundle at the correct memory address based on target
selected.

Signed-off-by: Devaraj Ranganna <[email protected]>
  • Loading branch information
urutva committed Oct 11, 2023
1 parent 5b44cdf commit 953d5cc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions Projects/blinky/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ endif()
# Extra arguments for TF-M and ML
set(TFM_CMAKE_ARGS
-DPROJECT_CONFIG_HEADER_FILE=${PRJ_DIR}/Config/tfm-config/project_config.h
-DPLATFORM_DEFAULT_PROVISIONING=OFF
-DTFM_DUMMY_PROVISIONING=OFF
-DCONFIG_TFM_ENABLE_CP10CP11=ON
-DTFM_EXCEPTION_INFO_DUMP=ON
-DNS=ON;
Expand Down
40 changes: 24 additions & 16 deletions Tools/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,20 @@ do
esac
done


case "$1" in
blinky)
EXAMPLE="$1"
;;
aws-iot-example)
EXAMPLE="$1"
;;
*)
echo "Usage: $0 <blinky,aws-iot-example>" >&2
exit 1
;;
esac

case "$TARGET" in
corstone300 )
FVP_BIN="VHT_Corstone_SSE-300_Ethos-U55"
FVP_S_IMAGE_LOAD_ADDRESS=0x11000000
FVP_NS_IMAGE_LOAD_ADDRESS=0x01060000
FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x10022000
FVP_NS_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x210FF000
;;
corstone310 )
FVP_BIN="VHT_Corstone_SSE-310"
FVP_S_IMAGE_LOAD_ADDRESS=0x38000000
FVP_NS_IMAGE_LOAD_ADDRESS=0x28080000
FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x11022000
FVP_NS_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x213FF000
;;
*)
echo "Invalid target <Ccorstone300|corstone310>"
Expand All @@ -84,8 +78,22 @@ case "$TARGET" in
;;
esac

set -x
case "$1" in
blinky)
EXAMPLE="$1"
FVP_IMAGE_OPTIONS="cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@$FVP_S_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Projects/$1/$1_signed.bin"@$FVP_NS_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Middleware/ARM/TF-M/tf-m-build-prefix/src/tf-m-build-build/install/outputs/encrypted_provisioning_bundle.bin"@$FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS"
;;
aws-iot-example)
EXAMPLE="$1"
FVP_IMAGE_OPTIONS="cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@$FVP_S_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Projects/$1/$1_signed.bin"@$FVP_NS_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Projects/$EXAMPLE/provisioning_data/provisioning_data.bin"@$FVP_NS_PROVISIONING_BUNDLE_LOAD_ADDRESS --data "$BUILD_PATH/Middleware/ARM/TF-M/tf-m-build-prefix/src/tf-m-build-build/install/outputs/encrypted_provisioning_bundle.bin"@$FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS"
;;
*)
echo "Usage: $0 <blinky,aws-iot-example>" >&2
exit 1
;;
esac

OPTIONS="-C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.smsc_91c111.enabled=1 -C mps3_board.hostbridge.userNetworking=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"@0x11000000 --data "$BUILD_PATH/Projects/$1/$1_signed.bin"@0x01060000 --data "$BUILD_PATH/Projects/aws-iot-example/provisioning_data/provisioning_data.bin"@0x210FF000 --data "$BUILD_PATH/Middleware/ARM/TF-M/tf-m-build-prefix/src/tf-m-build-build/install/outputs/encrypted_provisioning_bundle.bin"@0x10022000
# Start the FVP
$FVP_BIN $OPTIONS -a $FVP_IMAGE_OPTIONS

0 comments on commit 953d5cc

Please sign in to comment.