blob: 9a8c3e2a814f063376334648f906882542914a95 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Manish Pandey3c435582020-07-15 12:14:26 +01002#
Madhukar Pappireddye08bc352021-04-23 16:11:20 -05003# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
Manish Pandey3c435582020-07-15 12:14:26 +01004#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8post_tf_build() {
9 #
10 # To build SP packages in TF-A we need to build FIP.
11 # The resulting FIP has valid SP Packages mentioned in SP_LAYOUT_FILE
12 # but dummy BL33 and BL32.
13 #
14 local dummy_file="$(mktempfile)"
15 echo "hello world" > "$dummy_file"
16
17 build_fip BL33="$dummy_file" BL32="$dummy_file"
18
Manish Pandey3c435582020-07-15 12:14:26 +010019 url="${tf_build_root}/${plat}/${mode}/fdts/fvp_spmc_manifest.dtb" fetch_file
20 url="${tf_build_root}/${plat}/${mode}/cactus-primary.pkg" fetch_file
21 url="${tf_build_root}/${plat}/${mode}/cactus-secondary.pkg" fetch_file
Olivier Deprez0b834092020-08-21 08:36:01 +020022 url="${tf_build_root}/${plat}/${mode}/cactus-tertiary.pkg" fetch_file
Olivier Deprezdd9ed332021-07-02 12:07:17 +020023 url="${tf_build_root}/${plat}/${mode}/ivy.pkg" fetch_file
Manish Pandey3c435582020-07-15 12:14:26 +010024
Manish Pandey3c435582020-07-15 12:14:26 +010025 archive_file "fvp_spmc_manifest.dtb"
26 archive_file "cactus-primary.pkg"
27 archive_file "cactus-secondary.pkg"
Olivier Deprez0b834092020-08-21 08:36:01 +020028 archive_file "cactus-tertiary.pkg"
Olivier Deprezdd9ed332021-07-02 12:07:17 +020029 archive_file "ivy.pkg"
Manish Pandey3c435582020-07-15 12:14:26 +010030}
31
Olivier Deprezaa4d1262020-10-30 15:02:17 +010032fetch_tf_resource() {
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060033 url="$tfa_downloads/spm/02-05-2021/initrd.img" saveas="initrd.bin" fetch_file
Olivier Deprezd6ec5652021-02-10 07:47:34 +010034 url="$tfa_downloads/spm/02-05-2021/manifest.dtb" fetch_file
Olivier Deprezaa4d1262020-10-30 15:02:17 +010035
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060036 archive_file "initrd.bin"
Olivier Deprezaa4d1262020-10-30 15:02:17 +010037 archive_file "manifest.dtb"
38
39 # Expect scripts
40 uart="0" file="spm-linux-uart0.exp" track_expect
41 uart="2" file="spm-uart2.exp" track_expect
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060042
43 payload_type="linux" gen_fvp_yaml_template
Olivier Deprezaa4d1262020-10-30 15:02:17 +010044}
45
Manish Pandey3c435582020-07-15 12:14:26 +010046post_fetch_tf_resource() {
Leonardo Sandoval00ced1f2020-12-07 12:55:08 -060047 local model="base-aemv8a"
48
49 model="$model" \
Olivier Deprez18101ca2021-04-23 19:42:04 +020050 arch_version="8.5" \
51 has_branch_target_exception="1" \
52 restriction_on_speculative_execution="2" \
Manish Pandey3c435582020-07-15 12:14:26 +010053 reset_to_bl31="1" \
54 preload_bl33="1" \
Manish Pandey1e7be852020-11-09 16:04:48 +000055 preload_bl33_bin="$archive/hafnium.bin" \
Manish Pandey3c435582020-07-15 12:14:26 +010056 spmc_manifest="fvp_spmc_manifest.dtb" \
Manish Pandey1e7be852020-11-09 16:04:48 +000057 spm_bin="$archive/secure_hafnium.bin" \
Manish Pandey3c435582020-07-15 12:14:26 +010058 sp1_pkg="cactus-primary.pkg" \
59 sp2_pkg="cactus-secondary.pkg" \
Olivier Deprez0b834092020-08-21 08:36:01 +020060 sp3_pkg="cactus-tertiary.pkg" \
Olivier Deprezdd9ed332021-07-02 12:07:17 +020061 sp4_pkg="ivy.pkg" \
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060062 initrd_bin="initrd.bin" \
Manish Pandey3c435582020-07-15 12:14:26 +010063 el3_payload_bin="manifest.dtb" \
Madhukar Pappireddye08bc352021-04-23 16:11:20 -050064 has_smmuv3_params="1" \
Manish Pandey3c435582020-07-15 12:14:26 +010065 gen_model_params
Olivier Deprez18101ca2021-04-23 19:42:04 +020066
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060067 model="$model" model_dtb="manifest.dtb" gen_fvp_yaml
Manish Pandey3c435582020-07-15 12:14:26 +010068}