blob: f8ec343d3014e2fc11c2a4922eb56fd905b02901 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001#! /bin/bash
2
3#
4# Script to run the EL3 payload on the Foundation FVP.
5#
6# /!\ The EL3 payload is not supported on the Foundation FVP without tweaking
7# the code. You need to modify the number of expected cores in
8# plat/fvp/platform.h:
9# -#define CPUS_COUNT 8
10# +#define CPUS_COUNT 4
11#
12
13set -e
14
15# usage: check_file_is_present <filename>
16# Check that <filename> exists in the current directory.
17# If not, print an error message and exit.
18function check_file_is_present
19{
20 BIN_FILE=$1
21 if [ ! -e "$BIN_FILE" ]; then
22 echo "ERROR: Can't find \"$BIN_FILE\" file"
23 echo "Please copy $BIN_FILE into the current working directory."
24 echo "Alternatively, a symbolic link might be created."
25 echo
26 exit 1
27 fi
28}
29
30check_file_is_present "bl1.bin"
31check_file_is_present "fip.bin"
32
33# Create an 8-byte file containing all zero bytes.
34# It will be loaded at the beginning of the Trusted SRAM to zero the mailbox.
35MAILBOX_FILE=mailbox.dat
36rm -f $MAILBOX_FILE
37dd if=/dev/zero of=$MAILBOX_FILE bs=1 count=8
38
39# The path to the Foundation model must be provided by the user.
40MODEL_EXEC="${MODEL_EXEC:?}"
41MODEL_PARAMETERS=" \
42 --cores=4 \
43 --visualization \
44 --data=bl1.bin@0x0 \
45 --data=fip.bin@0x08000000 \
46 --data=$MAILBOX_FILE@0x04000000 \
47 --data=build/fvp/el3_payload.bin@0x80000000 \
48"
49
50echo $MODEL_EXEC $MODEL_PARAMETERS
51$MODEL_EXEC $MODEL_PARAMETERS