blob: 4f031a6f829d056676c460efab06b0bd22c51042 [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
11 url="$n1sdp_prebuilts/mcp_romfw.bin" saveas="mcp_rom.bin" fetch_file
12 archive_file "mcp_rom.bin"
13 fi
14 if [ ! -f "$archive/scp_rom.bin" ]; then
15 url="$n1sdp_prebuilts/scp_romfw.bin" saveas="scp_rom.bin" fetch_file
16 archive_file "scp_rom.bin"
17 fi
18 if [ ! -f "$archive/scp_ram.bin" ]; then
19 url="$n1sdp_prebuilts/scp_ramfw.bin" saveas="scp_ram.bin" fetch_file
20 archive_file "scp_ram.bin"
21 fi
22 if [ ! -f "$archive/mcp_ram.bin" ]; then
23 url="$n1sdp_prebuilts/mcp_ramfw.bin" saveas="mcp_ram.bin" fetch_file
24 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}