blob: d22b0101264e2b88db878e0e26bd872e1aacd0d5 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Zelaleme9e81482020-07-10 15:18:46 -05002#
David Vinczed37d2912024-10-16 12:03:50 +00003# Copyright (c) 2020-2024, Arm Limited. All rights reserved.
Zelaleme9e81482020-07-10 15:18:46 -05004#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8post_tf_build() {
9 url="$tc_prebuilts/u-boot.bin" fetch_file
10 archive_file "u-boot.bin"
11
David Vinczed37d2912024-10-16 12:03:50 +000012 if [ $plat_variant -eq 2 ] || [ $plat_variant -eq 3 ]; then
13 if [ $plat_variant -eq 2 ]; then
14 # Use SCP binary from SCP build if it exists, or fetch pre-built ones.
15 if [ ! -f "$archive/scp_ram.bin" ]; then
Leo Yan2acb9022024-07-26 17:29:32 +010016 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 +010017 fi
David Vinczed37d2912024-10-16 12:03:50 +000018 elif [ $plat_variant -eq 3 ]; then
19 # Use pre-built SCP BL2 binary
20 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 +010021 fi
David Vinczed37d2912024-10-16 12:03:50 +000022 archive_file "scp_ram.bin"
Zelaleme9e81482020-07-10 15:18:46 -050023 fi
24
Leo Yan2acb9022024-07-26 17:29:32 +010025 if [ $plat_variant -eq 2 ] || [ $plat_variant -eq 3 ]; then
26 build_fip BL33="$archive/u-boot.bin" SCP_BL2="$archive/scp_ram.bin"
27 elif [ $plat_variant -eq 4 ]; then
28 build_fip BL33="$archive/u-boot.bin"
29 fi
Zelaleme9e81482020-07-10 15:18:46 -050030}