blob: b6cc07b32a46af7419d2c32f6fa9840b20c2debe [file] [log] [blame]
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +05301#!/usr/bin/env bash
2#
3# Copyright (c) 2021 Arm Limited. All rights reserved.
4#
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
Maksims Svecovs46858702021-10-21 12:14:31 +010011 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
Maksims Svecovs46858702021-10-21 12:14:31 +010015 url="$scp_mcp_prebuilts/scp_bl1.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
Maksims Svecovs46858702021-10-21 12:14:31 +010019 url="$scp_mcp_prebuilts/scp_bl2.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
Maksims Svecovs46858702021-10-21 12:14:31 +010023 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
sah01acb23942021-09-07 03:56:51 +000028 "$fiptool" create --soc-fw "$tf_root/build/n1sdp/$bin_mode/bl31.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"
34}