blob: 05333be95c5c7f96d983cc8b6b9243123ddd40a9 [file] [log] [blame]
#!/usr/bin/env bash
#
# Copyright (c) 2019-2024, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
source "$ci_root/run_config/tc_rse_utils.sh"
fetch_tf_resource() {
image="kernel" type="tc-kernel" get_boot_image
image="initrd" type="tc-ramdisk" get_boot_image
url="$tc_prebuilts/tc_fitimage.bin" saveas="tc_fitimage.bin" fetch_file
archive_file "tc_fitimage.bin"
# Use SCP binary from SCP build if it exists, or fetch pre-built ones.
if [ ! -f "$archive/scp_rom.bin" ]; then
# Pick the appropriate binary based on target platform variant
if [ $plat_variant -eq 3 ] || [ $plat_variant -eq 4 ]; then
url="$tfa_downloads/total_compute/tc$plat_variant/scp/tc$plat_variant-bl1.bin" saveas="scp_rom.bin" fetch_file
fi
archive_file "scp_rom.bin"
fi
# RSE is applicable to TC3 and TC4
if [ $plat_variant -eq 3 ] || [ $plat_variant -eq 4 ]; then
# Hold RSE terminal_uart_ap
uart="1" port="5003" file="hold_uart.exp" track_expect
get_rse_prov_bins
# sign AP bl1
sign_image bl1.bin $ap_bl1_flash_load_addr $ap_bl1_flash_size
# Update FIP with pre-built RSE binaries and signed AP BL1 to create host flash fip image
update_fip
# Create GPT image
gen_gpt_bin $archive/host_flash_fip.bin 12582912 16
fi
}
pre_tf_build() {
local qcbor_release_archive="qcbor-v1_2.tar.gz"
local qcbor_folder="qcbor"
pushd "$workspace"
if [ ! -d "qcbor" ]; then
saveas="${qcbor_release_archive}" \
url="https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.2.tar.gz" \
fetch_file
mkdir $qcbor_folder
tar -xzf "${qcbor_release_archive}" --directory=$qcbor_folder --strip-component=1
fi
echo "Set QCBOR_DIR to $workspace/qcbor"
set_hook_var "QCBOR_DIR" "$workspace/qcbor"
popd "$workspace"
}
generate_lava_job_template() {
# Hold scp terminal_s0
uart="0" port="5002" file="hold_uart.exp" track_expect
uart="2" port="5000" file="tc-fitimage-busybox.exp" set_primary="1" \
timeout="1200" track_expect
set_uart_port "${archive:?}" 1 5003
set_uart_port "${archive:?}" 3 5001
payload_type="linux" gen_yaml_template
}