blob: 36031b5d7fffe21cd255636122a2e2392a47162c [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
Manish Pandey3c435582020-07-15 12:14:26 +010023
Manish Pandey3c435582020-07-15 12:14:26 +010024 archive_file "fvp_spmc_manifest.dtb"
25 archive_file "cactus-primary.pkg"
26 archive_file "cactus-secondary.pkg"
Olivier Deprez0b834092020-08-21 08:36:01 +020027 archive_file "cactus-tertiary.pkg"
Manish Pandey3c435582020-07-15 12:14:26 +010028}
29
Olivier Deprezaa4d1262020-10-30 15:02:17 +010030fetch_tf_resource() {
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060031 url="$tfa_downloads/spm/02-05-2021/initrd.img" saveas="initrd.bin" fetch_file
Olivier Deprezd6ec5652021-02-10 07:47:34 +010032 url="$tfa_downloads/spm/02-05-2021/manifest.dtb" fetch_file
Olivier Deprezaa4d1262020-10-30 15:02:17 +010033
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060034 archive_file "initrd.bin"
Olivier Deprezaa4d1262020-10-30 15:02:17 +010035 archive_file "manifest.dtb"
36
37 # Expect scripts
38 uart="0" file="spm-linux-uart0.exp" track_expect
39 uart="2" file="spm-uart2.exp" track_expect
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060040
41 payload_type="linux" gen_fvp_yaml_template
Olivier Deprezaa4d1262020-10-30 15:02:17 +010042}
43
Manish Pandey3c435582020-07-15 12:14:26 +010044post_fetch_tf_resource() {
Leonardo Sandoval00ced1f2020-12-07 12:55:08 -060045 local model="base-aemv8a"
46
47 model="$model" \
Olivier Deprez18101ca2021-04-23 19:42:04 +020048 arch_version="8.5" \
49 has_branch_target_exception="1" \
50 restriction_on_speculative_execution="2" \
Manish Pandey3c435582020-07-15 12:14:26 +010051 reset_to_bl31="1" \
52 preload_bl33="1" \
Manish Pandey1e7be852020-11-09 16:04:48 +000053 preload_bl33_bin="$archive/hafnium.bin" \
Manish Pandey3c435582020-07-15 12:14:26 +010054 spmc_manifest="fvp_spmc_manifest.dtb" \
Manish Pandey1e7be852020-11-09 16:04:48 +000055 spm_bin="$archive/secure_hafnium.bin" \
Manish Pandey3c435582020-07-15 12:14:26 +010056 sp1_pkg="cactus-primary.pkg" \
57 sp2_pkg="cactus-secondary.pkg" \
Olivier Deprez0b834092020-08-21 08:36:01 +020058 sp3_pkg="cactus-tertiary.pkg" \
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060059 initrd_bin="initrd.bin" \
Manish Pandey3c435582020-07-15 12:14:26 +010060 el3_payload_bin="manifest.dtb" \
Madhukar Pappireddye08bc352021-04-23 16:11:20 -050061 has_smmuv3_params="1" \
Manish Pandey3c435582020-07-15 12:14:26 +010062 gen_model_params
Olivier Deprez18101ca2021-04-23 19:42:04 +020063
Leonardo Sandoval4f0c7912021-03-17 11:35:07 -060064 model="$model" model_dtb="manifest.dtb" gen_fvp_yaml
Manish Pandey3c435582020-07-15 12:14:26 +010065}