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() { |
| 11 | if [ ! -f "$archive/scp_ram.bin" ]; then |
Leo Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 12 | if [ $plat_variant -eq 2 ] || [ $plat_variant -eq 3 ]; then |
| 13 | if [ $plat_variant -eq 2 ]; then |
| 14 | url="$scp_mcp_downloads/totalcompute/tc$plat_variant/platform_variant_0/release/tc$plat_variant-bl2.bin" saveas="scp_ram.bin" fetch_file |
| 15 | elif [ $plat_variant -eq 3 ]; then |
| 16 | url="$tfa_downloads/total_compute/tc$plat_variant/scp/tc$plat_variant-bl2.bin" saveas="scp_ram.bin" fetch_file |
| 17 | fi |
| 18 | archive_file "scp_ram.bin" |
Leo Yan | 5b73ad9 | 2024-06-20 15:15:36 +0100 | [diff] [blame] | 19 | fi |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 20 | fi |
| 21 | |
Leo Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 22 | if [ $plat_variant -eq 2 ] || [ $plat_variant -eq 3 ]; then |
| 23 | build_fip BL33="$archive/tftf.bin" BL32="$archive/secure_hafnium.bin" SCP_BL2="$archive/scp_ram.bin" |
| 24 | elif [ $plat_variant -eq 4 ]; then |
| 25 | build_fip BL33="$archive/tftf.bin" BL32="$archive/secure_hafnium.bin" |
| 26 | fi |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | fetch_tf_resource() { |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 30 | # RSE output is printed to UART 2 so track it. |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 31 | uart="1" port="5003" file="hold_uart.exp" track_expect |
| 32 | |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 33 | get_rse_prov_bins |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 34 | |
| 35 | sign_image bl1.bin $ap_bl1_flash_load_addr $ap_bl1_flash_size |
| 36 | |
| 37 | update_fip |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 38 | |
| 39 | # Create GPT image |
| 40 | gen_gpt_bin $archive/host_flash_fip.bin 12582912 16 |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | generate_lava_job_template() { |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 44 | uart="2" port="5000" set_primary="1" file="tftf-non-primary.exp" track_expect |
| 45 | uart="3" port="5001" file="spm-cactus-sp-uart1.exp" track_expect |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 46 | |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 47 | set_uart_port "${archive:?}" 0 5002 |
| 48 | set_uart_port "${archive:?}" 1 5003 |
Daniel Boulby | 5f29598 | 2023-05-17 12:03:05 +0100 | [diff] [blame] | 49 | |
| 50 | payload_type="tftf" memory_tagging_support_level="2" gen_yaml_template |
| 51 | } |