feat(gpt): add test to corrupt gpt entries
Corrupt the GPT entries by adding entries parameter to corrupt_gpt_bin(),
which will empty the entries in LBA2 through LBA34. This will force
the use of backup gpt at the last LBA.
Add header parameter to corrupt_gpt_bin() for header option.
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: Ie2ba6d9a081b7f705f7ee689e52bf23bfbb4e5dc
diff --git a/run_config/fvp-tftf.entries_backup_gpt b/run_config/fvp-tftf.entries_backup_gpt
new file mode 100644
index 0000000..51df98e
--- /dev/null
+++ b/run_config/fvp-tftf.entries_backup_gpt
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2024, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+post_tf_build() {
+ build_fip BL33="$archive/tftf.bin"
+}
+
+post_tf_archive() {
+ # Maximum FIP size is 2MiB = 2097152
+ gen_gpt_bin "$archive/fip.bin" 2097152
+
+ # Corrupt primary GPT entries to force TF-A to use the backup
+ corrupt_gpt_bin "$archive/fip_gpt.bin" "partition-entries"
+}
+
+generate_lava_job_template() {
+ uart="0" file="backup_gpt.exp" track_expect
+ uart="1" file="hold_uart.exp" track_expect
+
+ payload_type="tftf" gen_yaml_template
+}