Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Zelalem | e9e8148 | 2020-07-10 15:18:46 -0500 | [diff] [blame] | 2 | # |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 3 | # Copyright (c) 2020-2024, Arm Limited. All rights reserved. |
Zelalem | e9e8148 | 2020-07-10 15:18:46 -0500 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | post_tf_build() { |
| 9 | url="$tc_prebuilts/u-boot.bin" fetch_file |
| 10 | archive_file "u-boot.bin" |
| 11 | |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 12 | 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 Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 16 | 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] | 17 | fi |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 18 | 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 Yan | 5b73ad9 | 2024-06-20 15:15:36 +0100 | [diff] [blame] | 21 | fi |
David Vincze | d37d291 | 2024-10-16 12:03:50 +0000 | [diff] [blame^] | 22 | archive_file "scp_ram.bin" |
Zelalem | e9e8148 | 2020-07-10 15:18:46 -0500 | [diff] [blame] | 23 | fi |
| 24 | |
Leo Yan | 2acb902 | 2024-07-26 17:29:32 +0100 | [diff] [blame] | 25 | 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 |
Zelalem | e9e8148 | 2020-07-10 15:18:46 -0500 | [diff] [blame] | 30 | } |