refactor: introduce the partition_pkg type

To be able to load partition packages with the format
of transfer lists, introduce intermediate representation,
which holds all the ranges relevant for the loading of the
SP.

The SP Package is translated into this intermediate
representation.

Subsequent patches do the same for the transfer list structure.

The mapping of SPs artefacts (i.e. partition manifest, and
area of boot information) are mapped and unmapped as necessary,
using the structure partition_pkg.

The memory ranges introduced so far:
- Partition Manager.
- SPs image.
- Hob range(though it remains unused).

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Ic9d0850202617a88070953f0f9075f78a1c8d7b6
diff --git a/inc/hf/boot_info.h b/inc/hf/boot_info.h
index 0be30e5..f1b0095 100644
--- a/inc/hf/boot_info.h
+++ b/inc/hf/boot_info.h
@@ -10,10 +10,10 @@
 
 #include "hf/fdt.h"
 #include "hf/ffa.h"
-#include "hf/sp_pkg.h"
+#include "hf/partition_pkg.h"
 
 #define FFA_BOOT_INFO_SIG 0xFFAU
 #define FFA_BOOT_INFO_VERSION 0x10001U
 
-bool ffa_boot_info_node(struct fdt_node *boot_info_node, vaddr_t pkg_address,
-			struct sp_pkg_header *pkg_header);
+bool ffa_boot_info_node(struct fdt_node *boot_info_node,
+			struct partition_pkg *pkg);
diff --git a/inc/hf/partition_pkg.h b/inc/hf/partition_pkg.h
new file mode 100644
index 0000000..bdc03b8
--- /dev/null
+++ b/inc/hf/partition_pkg.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 The Hafnium Authors.
+ *
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file or at
+ * https://opensource.org/licenses/BSD-3-Clause.
+ */
+
+#pragma once
+
+#include "hf/addr.h"
+#include "hf/boot_params.h"
+#include "hf/types.h"
+
+/**
+ * Aggregates all the necessary ranges needed for Hafnium to
+ * load an SP.
+ */
+struct partition_pkg {
+	/* Memory range for the partition manifest. */
+	struct mem_range pm;
+	/* Memory range for the image. */
+	struct mem_range img;
+	/* Memory range for the HOB list. - optional, if absent set to 0. */
+	struct mem_range hob;
+	/* Memory range for the FF-A boot info descriptors. */
+	struct mem_range boot_info;
+	/* Memory range for the totality of the package. */
+	struct mem_range total;
+};
+
+bool partition_pkg_init(struct mm_stage1_locked stage1_locked,
+			paddr_t pkg_start, struct partition_pkg *pkg,
+			struct mpool *ppool);
+
+void partition_pkg_deinit(struct mm_stage1_locked stage1_locked,
+			  struct partition_pkg *pkg, struct mpool *ppool);