blob: 948bd024ef5e2b71876f6b12106be8e4915ffada [file] [log] [blame]
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +05301#!/usr/bin/env bash
2#
Harrison Mutai5cf82fa2023-03-27 13:22:41 +01003# Copyright (c) 2021-2023 Arm Limited. All rights reserved.
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +05304#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8post_tf_build() {
sah01acb23942021-09-07 03:56:51 +00009 #Fetch pre-built SCP/MCP binaries if they haven't been built
10 if [ ! -f "$archive/mcp_rom.bin" ]; then
sahil46218482022-07-26 12:53:17 +053011 url="$scp_mcp_prebuilts/mcp_romfw.bin" saveas="mcp_rom.bin" fetch_file
sah01acb23942021-09-07 03:56:51 +000012 archive_file "mcp_rom.bin"
13 fi
14 if [ ! -f "$archive/scp_rom.bin" ]; then
sahil46218482022-07-26 12:53:17 +053015 url="$scp_mcp_prebuilts/scp_romfw.bin" saveas="scp_rom.bin" fetch_file
sah01acb23942021-09-07 03:56:51 +000016 archive_file "scp_rom.bin"
17 fi
18 if [ ! -f "$archive/scp_ram.bin" ]; then
sahil46218482022-07-26 12:53:17 +053019 url="$scp_mcp_prebuilts/scp_ramfw.bin" saveas="scp_ram.bin" fetch_file
sah01acb23942021-09-07 03:56:51 +000020 archive_file "scp_ram.bin"
21 fi
22 if [ ! -f "$archive/mcp_ram.bin" ]; then
sahil46218482022-07-26 12:53:17 +053023 url="$scp_mcp_prebuilts/mcp_ramfw.bin" saveas="mcp_ram.bin" fetch_file
sah01acb23942021-09-07 03:56:51 +000024 archive_file "mcp_ram.bin"
25 fi
26
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +053027 # Create FIP for SCP
sahil46218482022-07-26 12:53:17 +053028 "$fiptool" create --blob uuid=cfacc2c4-15e8-4668-82be-430a38fad705,file="$tf_root/build/n1sdp/$bin_mode/bl1.bin" --scp-fw "$archive/scp_ram.bin" "scp_fw.bin"
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +053029 archive_file "scp_fw.bin"
30
31 # Create FIP for MCP, this needs fixed uuid for now
sah01acb23942021-09-07 03:56:51 +000032 "$fiptool" create --blob uuid=54464222-a4cf-4bf8-b1b6-cee7dade539e,file="$archive/mcp_ram.bin" "mcp_fw.bin"
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +053033 archive_file "mcp_fw.bin"
sahil46218482022-07-26 12:53:17 +053034
35 # Fetch BL33 [uefi.bin] for N1SDP
Harrison Mutai5cf82fa2023-03-27 13:22:41 +010036 url="$n1sdp_prebuilts/uefi.bin" filename="uefi.bin" fetch_and_archive
sahil46218482022-07-26 12:53:17 +053037
38 # Create FIP for BL2, BL31, and BL33
39 build_fip BL31="$bl31" BL2="$bl2" BL33="$archive/uefi.bin"
40
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +053041}