Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 3 | # Copyright (c) 2023-2024, Arm Limited. All rights reserved. |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 8 | source "$ci_root/run_config/tc_rse_utils.sh" |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 9 | |
| 10 | post_tf_build() { |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 11 | 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 Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 15 | url="$scp_mcp_downloads/totalcompute/tc$plat_variant/platform_variant_0/release/tc$plat_variant-bl2.bin" saveas="scp_ram.bin" fetch_file |
Leo Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 16 | fi |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 17 | 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 Yan | 5b73ad9 | 2024-06-20 15:15:36 +0100 | [diff] [blame] | 20 | fi |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 21 | archive_file "scp_ram.bin" |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 22 | fi |
| 23 | |
Leo Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 24 | 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 Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | fetch_tf_resource() { |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 32 | # RSE output is printed to UART 2 so track it. |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 33 | uart="1" port="5003" file="hold_uart.exp" track_expect |
| 34 | |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 35 | get_rse_prov_bins |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 36 | |
| 37 | sign_image bl1.bin $ap_bl1_flash_load_addr $ap_bl1_flash_size |
| 38 | |
| 39 | update_fip |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 40 | |
| 41 | # Create GPT image |
| 42 | gen_gpt_bin $archive/host_flash_fip.bin 12582912 16 |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | generate_lava_job_template() { |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 46 | 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 Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 48 | |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 49 | set_uart_port "${archive:?}" 0 5002 |
| 50 | set_uart_port "${archive:?}" 1 5003 |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 51 | |
| 52 | payload_type="tftf" memory_tagging_support_level="2" gen_yaml_template |
| 53 | } |