ci(n1sdp): refactor fip fragment for specificity
The ``n1sdp-fip`` fragment builds the fip image with UEFI. Replace the
fragment to target this specific use case as we also want to generate
fip images with other NS workloads i.e. TFTF. Move parts of the code for
creating a fip image with xCP firmware to a generic location so it may
be used by other fragments.
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: I37433e32f1bc235e4c524ceed5730b0bc4c63ddd
diff --git a/run_config/n1sdp-fip b/run_config/n1sdp-fip
deleted file mode 100644
index 948bd02..0000000
--- a/run_config/n1sdp-fip
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright (c) 2021-2023 Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-
-post_tf_build() {
- #Fetch pre-built SCP/MCP binaries if they haven't been built
- if [ ! -f "$archive/mcp_rom.bin" ]; then
- url="$scp_mcp_prebuilts/mcp_romfw.bin" saveas="mcp_rom.bin" fetch_file
- archive_file "mcp_rom.bin"
- fi
- if [ ! -f "$archive/scp_rom.bin" ]; then
- url="$scp_mcp_prebuilts/scp_romfw.bin" saveas="scp_rom.bin" fetch_file
- archive_file "scp_rom.bin"
- fi
- if [ ! -f "$archive/scp_ram.bin" ]; then
- url="$scp_mcp_prebuilts/scp_ramfw.bin" saveas="scp_ram.bin" fetch_file
- archive_file "scp_ram.bin"
- fi
- if [ ! -f "$archive/mcp_ram.bin" ]; then
- url="$scp_mcp_prebuilts/mcp_ramfw.bin" saveas="mcp_ram.bin" fetch_file
- archive_file "mcp_ram.bin"
- fi
-
- # Create FIP for SCP
- "$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"
- archive_file "scp_fw.bin"
-
- # Create FIP for MCP, this needs fixed uuid for now
- "$fiptool" create --blob uuid=54464222-a4cf-4bf8-b1b6-cee7dade539e,file="$archive/mcp_ram.bin" "mcp_fw.bin"
- archive_file "mcp_fw.bin"
-
- # Fetch BL33 [uefi.bin] for N1SDP
- url="$n1sdp_prebuilts/uefi.bin" filename="uefi.bin" fetch_and_archive
-
- # Create FIP for BL2, BL31, and BL33
- build_fip BL31="$bl31" BL2="$bl2" BL33="$archive/uefi.bin"
-
-}
diff --git a/run_config/n1sdp-fip.uefi b/run_config/n1sdp-fip.uefi
new file mode 100644
index 0000000..4849238
--- /dev/null
+++ b/run_config/n1sdp-fip.uefi
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2023 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+post_tf_build() {
+ # Fetch BL33 [uefi.bin] for N1SDP
+ url="$n1sdp_prebuilts/uefi.bin" filename="uefi.bin" fetch_and_archive
+
+ # Create FIP for BL2, BL31, and BL33
+ build_fip BL31="$bl31" BL2="$bl2" BL33="$archive/uefi.bin"
+}
diff --git a/run_config/n1sdp-firmware b/run_config/n1sdp-firmware
index 02bcf3a..e7c1a40 100644
--- a/run_config/n1sdp-firmware
+++ b/run_config/n1sdp-firmware
@@ -1,10 +1,14 @@
#!/usr/bin/env bash
#
-# Copyright (c) 2021 Arm Limited. All rights reserved.
+# Copyright (c) 2021-2023 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
fetch_tf_resource() {
- n1sdp_firmware_bin_url="$n1sdp_prebuilts/n1sdp-board-firmware.zip" get_n1sdp_firmware
+ fetch_prebuilt_fw_images
+}
+
+post_fetch_tf_resource() {
+ gen_recovery_image
}
diff --git a/run_config/n1sdp-linux b/run_config/n1sdp-linux
index b50417a..364982d 100644
--- a/run_config/n1sdp-linux
+++ b/run_config/n1sdp-linux
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
#
-# Copyright (c) 2021 Arm Limited. All rights reserved.
+# Copyright (c) 2021-2023 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
-post_fetch_tf_resource() {
- gen_recovery_image_n1sdp "$archive/n1sdp-board-firmware.zip"
- payload_type="linux" gen_n1sdp_yaml
+generate_lava_job(){
+ target="n1sdp" payload_type="linux" gen_yaml_template
+ gen_n1sdp_yaml
}