aboutsummaryrefslogtreecommitdiff
path: root/tools/generate_json/generate_json.sh
blob: 449733ce85e0d4d26d4e310f86a4da00ca913cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

#
# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

# Generate a JSON file which will be fed to TF-A as SPM_LAYOUT_FILE to package
# Secure Partitions as part of FIP.

# $1 = Secure Partition (cactus)
# $2 = Platform (fvp)
# $3 = Build Type
# Output = build/plat/<Build Type>/sp_layout.json

GENERATED_JSON=build/$2/$3/sp_layout.json

# To demonstrate communication between SP's, two cactus S-EL1 instances used.
# To also test mapping of the RXTX region a third cactus S-EL1 instance is used.
# cactus-primary, cactus-secondary and cactus-tertiary have same binary but
# different partition manifests.
if [ "$1" == "cactus" ]; then
	echo -e "{\n\t\"$1-primary\" : {\n \
	\t\"image\": \"$1.bin\",\n \
	\t\"pm\": \"../../../spm/$1/$1.dts\",\n \
	\t\"owner\": \"SiP\"\n\t},\n\n\t\"$1-secondary\" : {\n \
	\t\"image\": \"$1.bin\",\n \
	\t\"pm\": \"../../../spm/$1/$1-secondary.dts\",\n \
	\t\"owner\": \"Plat\"\n\t},\n\n\t\"$1-tertiary\" : {\n \
	\t\"image\": \"$1.bin\",\n \
	\t\"pm\": \"../../../spm/$1/$1-tertiary.dts\" \n \
	}\n}" \
	> "$GENERATED_JSON"
else
	echo -e "\nWarning: Only Cactus is supported as Secure Partition\n"
fi