Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 3 | # Copyright (c) 2019-2024, Arm Limited. All rights reserved. |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 7 | source "$ci_root/run_config/tc_rse_utils.sh" |
laurenw-arm | b568410 | 2023-03-14 11:25:45 -0500 | [diff] [blame] | 8 | |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 9 | fetch_tf_resource() { |
Harrison Mutai | 6f4fd6c | 2023-03-27 13:22:41 +0100 | [diff] [blame] | 10 | image="kernel" type="tc-kernel" get_boot_image |
| 11 | image="initrd" type="tc-ramdisk" get_boot_image |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 12 | |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 13 | url="$tc_prebuilts/tc_fitimage.bin" saveas="tc_fitimage.bin" fetch_file |
| 14 | archive_file "tc_fitimage.bin" |
| 15 | |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 16 | # Use SCP binary from SCP build if it exists, or fetch pre-built ones. |
Nicola Mazzucato | d15f713 | 2021-10-27 14:56:34 +0100 | [diff] [blame] | 17 | if [ ! -f "$archive/scp_rom.bin" ]; then |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 18 | # Pick the appropriate binary based on target platform variant |
David Vincze | b38fefa | 2024-10-28 11:56:28 +0000 | [diff] [blame] | 19 | if [ $plat_variant -eq 3 ] || [ $plat_variant -eq 4 ]; then |
Leo Yan | 5b73ad9 | 2024-06-20 15:15:36 +0100 | [diff] [blame] | 20 | url="$tfa_downloads/total_compute/tc$plat_variant/scp/tc$plat_variant-bl1.bin" saveas="scp_rom.bin" fetch_file |
| 21 | fi |
| 22 | |
Nicola Mazzucato | d15f713 | 2021-10-27 14:56:34 +0100 | [diff] [blame] | 23 | archive_file "scp_rom.bin" |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 24 | fi |
| 25 | |
David Vincze | b38fefa | 2024-10-28 11:56:28 +0000 | [diff] [blame] | 26 | # RSE is applicable to TC3 and TC4 |
| 27 | if [ $plat_variant -eq 3 ] || [ $plat_variant -eq 4 ]; then |
Rupinderjit Singh | 8d4e1e4 | 2022-08-18 14:51:41 +0100 | [diff] [blame] | 28 | |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 29 | # Hold RSE terminal_uart_ap |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 30 | uart="1" port="5003" file="hold_uart.exp" track_expect |
| 31 | |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 32 | get_rse_prov_bins |
Sandrine Bailleux | 67bf650 | 2022-09-07 15:41:18 +0200 | [diff] [blame] | 33 | |
David Vincze | b38fefa | 2024-10-28 11:56:28 +0000 | [diff] [blame] | 34 | # sign AP bl1 |
Rupinderjit Singh | 8d4e1e4 | 2022-08-18 14:51:41 +0100 | [diff] [blame] | 35 | sign_image bl1.bin $ap_bl1_flash_load_addr $ap_bl1_flash_size |
| 36 | |
David Vincze | d8ed562 | 2024-02-23 17:00:12 +0100 | [diff] [blame] | 37 | # Update FIP with pre-built RSE binaries and signed AP BL1 to create host flash fip image |
laurenw-arm | 60de274 | 2023-03-08 10:50:15 -0600 | [diff] [blame] | 38 | update_fip |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 39 | |
| 40 | # Create GPT image |
| 41 | gen_gpt_bin $archive/host_flash_fip.bin 12582912 16 |
Rupinderjit Singh | 8d4e1e4 | 2022-08-18 14:51:41 +0100 | [diff] [blame] | 42 | fi |
Madhukar Pappireddy | 2f284e1 | 2021-08-30 16:06:14 -0500 | [diff] [blame] | 43 | } |
Chris Kay | 4e8aaf1 | 2022-09-01 15:21:55 +0100 | [diff] [blame] | 44 | |
David Vincze | f876bb6 | 2024-02-21 16:34:52 +0100 | [diff] [blame] | 45 | pre_tf_build() { |
| 46 | local qcbor_release_archive="qcbor-v1_2.tar.gz" |
| 47 | local qcbor_folder="qcbor" |
| 48 | |
Tamas Ban | 036c08d | 2024-10-10 18:03:37 +0200 | [diff] [blame] | 49 | pushd "$workspace" |
David Vincze | f876bb6 | 2024-02-21 16:34:52 +0100 | [diff] [blame] | 50 | |
Tamas Ban | 036c08d | 2024-10-10 18:03:37 +0200 | [diff] [blame] | 51 | if [ ! -d "qcbor" ]; then |
| 52 | saveas="${qcbor_release_archive}" \ |
| 53 | url="https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.2.tar.gz" \ |
| 54 | fetch_file |
| 55 | mkdir $qcbor_folder |
| 56 | tar -xzf "${qcbor_release_archive}" --directory=$qcbor_folder --strip-component=1 |
David Vincze | f876bb6 | 2024-02-21 16:34:52 +0100 | [diff] [blame] | 57 | fi |
Tamas Ban | 036c08d | 2024-10-10 18:03:37 +0200 | [diff] [blame] | 58 | |
| 59 | echo "Set QCBOR_DIR to $workspace/qcbor" |
| 60 | set_hook_var "QCBOR_DIR" "$workspace/qcbor" |
| 61 | |
| 62 | popd "$workspace" |
David Vincze | f876bb6 | 2024-02-21 16:34:52 +0100 | [diff] [blame] | 63 | } |
| 64 | |
Chris Kay | 4e8aaf1 | 2022-09-01 15:21:55 +0100 | [diff] [blame] | 65 | generate_lava_job_template() { |
| 66 | # Hold scp terminal_s0 |
Chris Kay | 24d039f | 2022-11-23 12:53:30 +0000 | [diff] [blame] | 67 | uart="0" port="5002" file="hold_uart.exp" track_expect |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 68 | uart="2" port="5000" file="tc-fitimage-busybox.exp" set_primary="1" \ |
Mohamed Omar Asaker | b19a52f | 2024-03-07 11:49:18 +0000 | [diff] [blame] | 69 | timeout="1200" track_expect |
Chris Kay | 24d039f | 2022-11-23 12:53:30 +0000 | [diff] [blame] | 70 | |
Manish V Badarkhe | db92983 | 2024-01-29 19:56:01 +0000 | [diff] [blame] | 71 | set_uart_port "${archive:?}" 1 5003 |
Chris Kay | 24d039f | 2022-11-23 12:53:30 +0000 | [diff] [blame] | 72 | set_uart_port "${archive:?}" 3 5001 |
Chris Kay | 4e8aaf1 | 2022-09-01 15:21:55 +0100 | [diff] [blame] | 73 | |
Harrison Mutai | a6d6e68 | 2023-03-27 13:20:33 +0100 | [diff] [blame] | 74 | payload_type="linux" gen_yaml_template |
Chris Kay | 4e8aaf1 | 2022-09-01 15:21:55 +0100 | [diff] [blame] | 75 | } |