blob: 7405378452be698beb24a024f2bc0ac48ee3a0e0 [file] [log] [blame]
Manish Pandey270ee152020-03-16 22:25:40 +00001#!/bin/bash
2
3#
4# Copyright (c) 2020, Arm Limited. All rights reserved.
5#
6# SPDX-License-Identifier: BSD-3-Clause
7#
8
9# Generate a JSON file which will be fed to TF-A as SPM_LAYOUT_FILE to package
10# Secure Partitions as part of FIP.
11
12# $1 = Secure Partition (cactus)
13# $2 = Platform (fvp)
14# $3 = Build Type
15# Output = build/plat/<Build Type>/sp_layout.json
16
17GENERATED_JSON=build/$2/$3/sp_layout.json
18
19# To demonstrate communication between SP's, two cactus S-EL1 instances used.
20# cactus-primary and cactus-secondary has same binary but different
21# partition manifest.
22if [ "$1" == "cactus" ]; then
23 echo -e "{\n\t\"$1-primary\" : {\n \
24 \t\"image\": \"$1.bin\",\n \
Ruari Phipps67593f22020-07-24 16:21:35 +010025 \t\"pm\": \"../../../spm/$1/$1.dts\",\n \
26 \t\"owner\": \"SiP\"\n\t},\n\n\t\"$1-secondary\" : {\n \
Manish Pandey270ee152020-03-16 22:25:40 +000027 \t\"image\": \"$1.bin\",\n \
Ruari Phipps67593f22020-07-24 16:21:35 +010028 \t\"pm\": \"../../../spm/$1/$1-secondary.dts\",\n \
29 \t\"owner\": \"Plat\"\n \
Manish Pandey270ee152020-03-16 22:25:40 +000030 }\n}" \
31 > "$GENERATED_JSON"
32else
33 echo -e "\nWarning: Only Cactus is supported as Secure Partition\n"
34fi