blob: 803bbdba6301b341fbf266d7e819f02ce7c4b9ef [file] [log] [blame]
Daniel Boulby5f295982023-05-17 12:03:05 +01001#!/usr/bin/env bash
2#
Manish V Badarkhedb929832024-01-29 19:56:01 +00003# Copyright (c) 2023-2024, Arm Limited. All rights reserved.
Daniel Boulby5f295982023-05-17 12:03:05 +01004#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
David Vinczed8ed5622024-02-23 17:00:12 +01008source "$ci_root/run_config/tc_rse_utils.sh"
Daniel Boulby5f295982023-05-17 12:03:05 +01009
10post_tf_build() {
David Vinczed37d2912024-10-16 12:03:50 +000011 if [ $plat_variant -eq 2 ] || [ $plat_variant -eq 3 ]; then
12 if [ $plat_variant -eq 2 ]; then
13 # Use SCP binary from SCP build if it exists, or fetch pre-built ones.
14 if [ ! -f "$archive/scp_ram.bin" ]; then
Leo Yan2acb9022024-07-26 17:29:32 +010015 url="$scp_mcp_downloads/totalcompute/tc$plat_variant/platform_variant_0/release/tc$plat_variant-bl2.bin" saveas="scp_ram.bin" fetch_file
Leo Yan2acb9022024-07-26 17:29:32 +010016 fi
David Vinczed37d2912024-10-16 12:03:50 +000017 elif [ $plat_variant -eq 3 ]; then
18 # Use pre-built SCP BL2 binary
19 url="$tfa_downloads/total_compute/tc$plat_variant/scp/$scp_revision/tc$plat_variant-bl2.bin" saveas="scp_ram.bin" fetch_file
Leo Yan5b73ad92024-06-20 15:15:36 +010020 fi
David Vinczed37d2912024-10-16 12:03:50 +000021 archive_file "scp_ram.bin"
Daniel Boulby5f295982023-05-17 12:03:05 +010022 fi
23
Leo Yan2acb9022024-07-26 17:29:32 +010024 if [ $plat_variant -eq 2 ] || [ $plat_variant -eq 3 ]; then
25 build_fip BL33="$archive/tftf.bin" BL32="$archive/secure_hafnium.bin" SCP_BL2="$archive/scp_ram.bin"
26 elif [ $plat_variant -eq 4 ]; then
27 build_fip BL33="$archive/tftf.bin" BL32="$archive/secure_hafnium.bin"
28 fi
Daniel Boulby5f295982023-05-17 12:03:05 +010029}
30
31fetch_tf_resource() {
David Vinczed8ed5622024-02-23 17:00:12 +010032 # RSE output is printed to UART 2 so track it.
Manish V Badarkhedb929832024-01-29 19:56:01 +000033 uart="1" port="5003" file="hold_uart.exp" track_expect
34
David Vinczed8ed5622024-02-23 17:00:12 +010035 get_rse_prov_bins
Daniel Boulby5f295982023-05-17 12:03:05 +010036
37 sign_image bl1.bin $ap_bl1_flash_load_addr $ap_bl1_flash_size
38
39 update_fip
Manish V Badarkhedb929832024-01-29 19:56:01 +000040
41 # Create GPT image
42 gen_gpt_bin $archive/host_flash_fip.bin 12582912 16
Daniel Boulby5f295982023-05-17 12:03:05 +010043}
44
45generate_lava_job_template() {
Manish V Badarkhedb929832024-01-29 19:56:01 +000046 uart="2" port="5000" set_primary="1" file="tftf-non-primary.exp" track_expect
47 uart="3" port="5001" file="spm-cactus-sp-uart1.exp" track_expect
Daniel Boulby5f295982023-05-17 12:03:05 +010048
Manish V Badarkhedb929832024-01-29 19:56:01 +000049 set_uart_port "${archive:?}" 0 5002
50 set_uart_port "${archive:?}" 1 5003
Daniel Boulby5f295982023-05-17 12:03:05 +010051
52 payload_type="tftf" memory_tagging_support_level="2" gen_yaml_template
53}