refactor: change format of sp pkg
Hafnium supports 1-to-1 mapping of PAs to IPAs. According to the boot
protocol from FF-A v1.1 EAC0 spec, the boot information blob should be
provided in a continuous memory segment.
In order to simplify Hafnium's memory operations at boot stage, the SP
Package has been refactored to allocate space for the boot information
blob.
The change made to 'manifest.c' and to test SPs configuration is to
prevent this change from breaking the tests. The SP package
initialization in hafnium is revised in a subsequent patch.
Change-Id: I1d0a0b0aad3e305b3a33cd2bde55fc1f096586ca
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/manifest.c b/src/manifest.c
index b514472..502d412 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -797,14 +797,9 @@
goto exit_unmap;
}
- /* Expect DTB to immediately follow header */
- if (sp_pkg->pm_offset != sizeof(struct sp_pkg_header)) {
- dlog_error("Invalid package manifest offset.\n");
- goto exit_unmap;
- }
+ /* TODO: Do not map 2 pages. */
+ sp_header_dtb_size = align_up(sp_pkg->pm_size, 2 * PAGE_SIZE);
- sp_header_dtb_size = align_up(
- sp_pkg->pm_size + sizeof(struct sp_pkg_header), PAGE_SIZE);
if ((vm_id != HF_PRIMARY_VM_ID) &&
(sp_header_dtb_size >= vm->secondary.mem_size)) {
dlog_error("Invalid package header or DT size.\n");