Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 1 | #!/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 | |
| 17 | GENERATED_JSON=build/$2/$3/sp_layout.json |
| 18 | |
| 19 | # To demonstrate communication between SP's, two cactus S-EL1 instances used. |
Max Shvetsov | 93119e3 | 2020-07-01 14:09:48 +0100 | [diff] [blame^] | 20 | # To also test mapping of the RXTX region a third cactus S-EL1 instance is used. |
| 21 | # cactus-primary, cactus-secondary and cactus-tertiary have same binary but |
| 22 | # different partition manifests. |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 23 | if [ "$1" == "cactus" ]; then |
| 24 | echo -e "{\n\t\"$1-primary\" : {\n \ |
| 25 | \t\"image\": \"$1.bin\",\n \ |
Ruari Phipps | 67593f2 | 2020-07-24 16:21:35 +0100 | [diff] [blame] | 26 | \t\"pm\": \"../../../spm/$1/$1.dts\",\n \ |
| 27 | \t\"owner\": \"SiP\"\n\t},\n\n\t\"$1-secondary\" : {\n \ |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 28 | \t\"image\": \"$1.bin\",\n \ |
Ruari Phipps | 67593f2 | 2020-07-24 16:21:35 +0100 | [diff] [blame] | 29 | \t\"pm\": \"../../../spm/$1/$1-secondary.dts\",\n \ |
Max Shvetsov | 93119e3 | 2020-07-01 14:09:48 +0100 | [diff] [blame^] | 30 | \t\"owner\": \"Plat\"\n\t},\n\n\t\"$1-tertiary\" : {\n \ |
| 31 | \t\"image\": \"$1.bin\",\n \ |
| 32 | \t\"pm\": \"../../../spm/$1/$1-tertiary.dts\" \n \ |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 33 | }\n}" \ |
| 34 | > "$GENERATED_JSON" |
| 35 | else |
| 36 | echo -e "\nWarning: Only Cactus is supported as Secure Partition\n" |
| 37 | fi |