feat(boot): load boot info configuration

Store the boot info blob address (same as load address if boot info
configured for the SP) and the general purpose register to pass it
(specified in the SP's FF-A manifest) in the vm structure.

Change-Id: I8d55fd8f382b9fab4b96fc2f957c621ed5178d5b
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index fd7776a..458e9c6 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -208,6 +208,13 @@
 	 */
 	bool initialized;
 	uint16_t boot_order;
+
+	/** Entries to pass boot data to the VM. */
+	struct {
+		uint32_t gp_register_num;
+		ipaddr_t blob_addr;
+	} boot_info;
+
 	uint8_t messaging_method;
 	bool managed_exit;
 	struct vm *next_boot;
@@ -313,3 +320,4 @@
 void vm_notifications_set_npi_injected(struct vm_locked vm_locked,
 				       bool npi_injected);
 bool vm_notifications_is_npi_injected(struct vm_locked vm_locked);
+void vm_set_boot_info_gp_reg(struct vm *vm, struct vcpu *vcpu);
diff --git a/src/load.c b/src/load.c
index 3056769..bcf1730 100644
--- a/src/load.c
+++ b/src/load.c
@@ -212,6 +212,19 @@
 
 		vm_locked.vm->boot_order = manifest_vm->partition.boot_order;
 
+		vm_locked.vm->boot_info.gp_register_num =
+			manifest_vm->partition.gp_register_num;
+
+		if (manifest_vm->partition.boot_info) {
+			/*
+			 * If the partition expects the boot information blob
+			 * per the ff-a v1.1 boot protocol, then its address
+			 * shall match the partition's load address.
+			 */
+			vm_locked.vm->boot_info.blob_addr =
+				ipa_init(manifest_vm->partition.load_addr);
+		}
+
 		/* Updating boot list according to boot_order */
 		vm_update_boot(vm_locked.vm);