blob: a91b74080704682564683bf34d2a2878cb0d753f [file] [log] [blame]
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +05301#!/usr/bin/env bash
2#
Jayanth Dodderi Chidanand49592d02022-04-06 17:49:59 +01003# Copyright (c) 2021-2022 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
Jayanth Dodderi Chidanand49592d02022-04-06 17:49:59 +010011 url="$scp_mcp_prebuilts/n1sdp-mcp-bl1.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
Jayanth Dodderi Chidanand49592d02022-04-06 17:49:59 +010015 url="$scp_mcp_prebuilts/n1sdp-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
Jayanth Dodderi Chidanand49592d02022-04-06 17:49:59 +010019 url="$scp_mcp_prebuilts/n1sdp-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
Jayanth Dodderi Chidanand49592d02022-04-06 17:49:59 +010023 url="$scp_mcp_prebuilts/n1sdp-mcp-bl2.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}