blob: 788c90cb6a60e1318f148a5edb15009f1026b7f4 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001#! /bin/bash
2
3set -e
4
5UART_OUTPUT_FILE=uart0.log
6
7# usage: check_file_is_present <filename>
8# Check that <filename> exists in the current directory.
9# If not, print an error message and exit.
10function check_file_is_present
11{
12 BIN_FILE=$1
13 if [ ! -e "$BIN_FILE" ]; then
14 echo "ERROR: Can't find \"$BIN_FILE\" file"
15 echo "Please copy $BIN_FILE into the current working directory."
16 echo "Alternatively, a symbolic link might be created."
17 echo
18 exit 1
19 fi
20}
21
22check_file_is_present "bl1.bin"
23check_file_is_present "fip.bin"
24
25# The path to the Foundation model must be provided by the user.
26MODEL_EXEC="${MODEL_EXEC:?}"
27MODEL_PARAMETERS="
28 -C pctl.startup=0.0.*.*,0.1.*.* \
29 -C bp.secureflashloader.fname=bl1.bin \
30 -C bp.flashloader0.fname=fip.bin \
31 --data cluster0.cpu0=build/fvp/el3_payload.bin@0x80000000 \
32 -C bp.secureSRAM.fill1=0x00000000 \
33 -C bp.secureSRAM.fill2=0x00000000 \
34 -C bp.pl011_uart0.out_file=$UART_OUTPUT_FILE \
35 -C bp.pl011_uart0.shutdown_on_eot=1 \
36"
37
38echo $MODEL_EXEC $MODEL_PARAMETERS
39$MODEL_EXEC $MODEL_PARAMETERS
40
41# Print results
42green='\033[1;32;40m'
43no_color='\033[0m'
44echo
45echo -e "$green"
46echo "============"
47echo " COMPLETE!"
48echo "============"
49echo -e "$no_color"
50echo "UART output:"
51echo "--------------------------------8<------------------------------"
52cat $UART_OUTPUT_FILE
53echo "--------------------------------8<------------------------------"
54echo
55echo "Output saved in $UART_OUTPUT_FILE file."
56echo