feat(boot): manifest parsing for boot info

Parsing partition's manifest list of info instances the partition
expects to receive at boot.
Same function that parses the manifest will be used for writing the
arguments.

Change-Id: I8dd1cc79dd08d1806e6fff58dbaf5bcb79ec1c0e
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/boot_info.h b/inc/hf/boot_info.h
new file mode 100644
index 0000000..0be30e5
--- /dev/null
+++ b/inc/hf/boot_info.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2022 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/fdt.h"
+#include "hf/ffa.h"
+#include "hf/sp_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);
diff --git a/inc/hf/manifest.h b/inc/hf/manifest.h
index 0bee77d..bcdd628 100644
--- a/inc/hf/manifest.h
+++ b/inc/hf/manifest.h
@@ -30,6 +30,7 @@
 
 /* Highest possible value for the boot-order field. */
 #define DEFAULT_BOOT_ORDER 0xFFFF
+#define DEFAULT_BOOT_GP_REGISTER UINT32_C(-1)
 
 enum run_time_el {
 	EL1 = 0,
@@ -131,6 +132,13 @@
 	size_t ep_offset;
 	/**  4/16/64KB - optional */
 	enum xlat_granule xlat_granule;
+	/** Register id from w0/x0-w3/x3 - optional. */
+	uint32_t gp_register_num;
+	/**
+	 *  Flags the presence of the optional IMPDEF node to define Partition's
+	 *  Boot Info.
+	 */
+	bool boot_info;
 	/** optional */
 	uint16_t boot_order;
 
@@ -211,6 +219,7 @@
 	MANIFEST_ERROR_INTEGER_OVERFLOW,
 	MANIFEST_ERROR_MALFORMED_INTEGER_LIST,
 	MANIFEST_ERROR_MALFORMED_BOOLEAN,
+	MANIFEST_ERROR_ARGUMENTS_LIST_EMPTY,
 	MANIFEST_ERROR_MEMORY_REGION_NODE_EMPTY,
 	MANIFEST_ERROR_DEVICE_REGION_NODE_EMPTY,
 	MANIFEST_ERROR_RXTX_SIZE_MISMATCH,
@@ -223,7 +232,9 @@
 					struct mpool *ppool);
 
 enum manifest_return_code parse_ffa_manifest(struct fdt *fdt,
-					     struct manifest_vm *vm);
+					     struct manifest_vm *vm,
+					     struct fdt_node *boot_info);
+
 enum manifest_return_code sanity_check_ffa_manifest(struct manifest_vm *vm);
 void manifest_dump(struct manifest_vm *vm);