Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # |
Ruari Phipps | 8747ed2 | 2020-09-01 13:32:17 +0100 | [diff] [blame] | 4 | # Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 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) |
Arunachalam Ganapathy | 51be1fe | 2020-09-22 13:25:21 +0100 | [diff] [blame] | 13 | # $2 = Platform built path |
| 14 | # Output = $2/sp_layout.json |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 15 | |
Arunachalam Ganapathy | 51be1fe | 2020-09-22 13:25:21 +0100 | [diff] [blame] | 16 | GENERATED_JSON=$2/sp_layout.json |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 17 | |
| 18 | # To demonstrate communication between SP's, two cactus S-EL1 instances used. |
Max Shvetsov | 93119e3 | 2020-07-01 14:09:48 +0100 | [diff] [blame] | 19 | # 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 Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 22 | if [ "$1" == "cactus" ]; then |
| 23 | echo -e "{\n\t\"$1-primary\" : {\n \ |
| 24 | \t\"image\": \"$1.bin\",\n \ |
Arunachalam Ganapathy | 51be1fe | 2020-09-22 13:25:21 +0100 | [diff] [blame] | 25 | \t\"pm\": \"$1.dts\",\n \ |
Ruari Phipps | 67593f2 | 2020-07-24 16:21:35 +0100 | [diff] [blame] | 26 | \t\"owner\": \"SiP\"\n\t},\n\n\t\"$1-secondary\" : {\n \ |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 27 | \t\"image\": \"$1.bin\",\n \ |
Arunachalam Ganapathy | 51be1fe | 2020-09-22 13:25:21 +0100 | [diff] [blame] | 28 | \t\"pm\": \"$1-secondary.dts\",\n \ |
Max Shvetsov | 93119e3 | 2020-07-01 14:09:48 +0100 | [diff] [blame] | 29 | \t\"owner\": \"Plat\"\n\t},\n\n\t\"$1-tertiary\" : {\n \ |
| 30 | \t\"image\": \"$1.bin\",\n \ |
Olivier Deprez | 2765ebf | 2020-12-16 15:46:14 +0100 | [diff] [blame] | 31 | \t\"pm\": \"$1-tertiary.dts\", \n \ |
| 32 | \t\"owner\": \"Plat\"\n\t},\n\n\t\"ivy\" : {\n \ |
Ruari Phipps | 8747ed2 | 2020-09-01 13:32:17 +0100 | [diff] [blame] | 33 | \t\"image\": \"ivy.bin\",\n \ |
Olivier Deprez | 2765ebf | 2020-12-16 15:46:14 +0100 | [diff] [blame] | 34 | \t\"pm\": \"ivy.dts\", \n \ |
| 35 | \t\"owner\": \"Plat\"\n \ |
Manish Pandey | 270ee15 | 2020-03-16 22:25:40 +0000 | [diff] [blame] | 36 | }\n}" \ |
| 37 | > "$GENERATED_JSON" |
| 38 | else |
| 39 | echo -e "\nWarning: Only Cactus is supported as Secure Partition\n" |
| 40 | fi |