blob: d1b861fdff11f03f1976244b0aa1613dad62e89b [file] [log] [blame]
Manish Pandey270ee152020-03-16 22:25:40 +00001#!/bin/bash
2
3#
Ruari Phipps8747ed22020-09-01 13:32:17 +01004# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
Manish Pandey270ee152020-03-16 22:25:40 +00005#
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)
Arunachalam Ganapathy51be1fe2020-09-22 13:25:21 +010013# $2 = Platform built path
14# Output = $2/sp_layout.json
Manish Pandey270ee152020-03-16 22:25:40 +000015
Arunachalam Ganapathy51be1fe2020-09-22 13:25:21 +010016GENERATED_JSON=$2/sp_layout.json
Manish Pandey270ee152020-03-16 22:25:40 +000017
18# To demonstrate communication between SP's, two cactus S-EL1 instances used.
Max Shvetsov93119e32020-07-01 14:09:48 +010019# To also test mapping of the RXTX region a third cactus S-EL1 instance is used.
20# cactus-primary, cactus-secondary and cactus-tertiary have same binary but
21# different partition manifests.
Manish Pandey270ee152020-03-16 22:25:40 +000022if [ "$1" == "cactus" ]; then
23 echo -e "{\n\t\"$1-primary\" : {\n \
J-Alves31d87952022-04-04 12:34:16 +010024 \t\"image\": {\n \
25 \t\t\"file\": \"$1.bin\",\n \
26 \t\t\"offset\":\"0x2000\"\n\
27 \t},\n \
28 \t\"pm\": {\n \
29 \t\t\"file\": \"$1.dts\",\n \
30 \t\t\"offset\":\"0x1000\"\n\
31 \t},\n
Ruari Phipps67593f22020-07-24 16:21:35 +010032 \t\"owner\": \"SiP\"\n\t},\n\n\t\"$1-secondary\" : {\n \
Manish Pandey270ee152020-03-16 22:25:40 +000033 \t\"image\": \"$1.bin\",\n \
Arunachalam Ganapathy51be1fe2020-09-22 13:25:21 +010034 \t\"pm\": \"$1-secondary.dts\",\n \
Max Shvetsov93119e32020-07-01 14:09:48 +010035 \t\"owner\": \"Plat\"\n\t},\n\n\t\"$1-tertiary\" : {\n \
36 \t\"image\": \"$1.bin\",\n \
J-Alves31d87952022-04-04 12:34:16 +010037 \t\"pm\": \"$1-tertiary.dts\",\n \
Olivier Deprez2765ebf2020-12-16 15:46:14 +010038 \t\"owner\": \"Plat\"\n\t},\n\n\t\"ivy\" : {\n \
Ruari Phipps8747ed22020-09-01 13:32:17 +010039 \t\"image\": \"ivy.bin\",\n \
Olivier Deprez2765ebf2020-12-16 15:46:14 +010040 \t\"pm\": \"ivy.dts\", \n \
41 \t\"owner\": \"Plat\"\n \
Manish Pandey270ee152020-03-16 22:25:40 +000042 }\n}" \
43 > "$GENERATED_JSON"
44else
45 echo -e "\nWarning: Only Cactus is supported as Secure Partition\n"
46fi