SPM: Define Ivy partition manifest

Define the partition properties for Ivy and add the Ivy
partition to the default generated sp layout JSON.

Signed-off-by: Ruari Phipps <ruari.phipps@arm.com>
Change-Id: Ic7a1269890c32c587c86cc59917a7e045aaa52e8
diff --git a/spm/ivy/ivy.dts b/spm/ivy/ivy.dts
index 4c5a11a..aa2324b 100644
--- a/spm/ivy/ivy.dts
+++ b/spm/ivy/ivy.dts
@@ -1,95 +1,32 @@
 /*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * This file is a Partition Manifest (PM) for a minimal Secure Partition (SP)
+ * that has additional optional properties defined.
  */
 
-#include <sp_res_desc_def.h>
-
-#include "ivy_def.h"
-
-/* 4 KiB pages */
-#define PAGE_SIZE			U(0x1000)
-
-/*
- * FVP platform layout. The defines are hardcoded here because including the
- * platform headers have too many dependencies.
- * TODO: Move this to the platform layer.
- */
-#define V2M_IOFPGA_BASE			ULL(0x1c000000)
-#define V2M_IOFPGA_SIZE			ULL(0x03000000)
-
-/* Aggregate of all devices in the first GB. */
-#define DEVICE0_BASE			ULL(0x20000000)
-#define DEVICE0_SIZE			ULL(0x0c200000)
 
 /dts-v1/;
 
 / {
-	compatible = "arm,sp_rd";
+	compatible = "arm,ffa-manifest-1.0";
 
-	attribute {
-		version = <0x00000001>;
-		sp_type = <RD_ATTR_TYPE_UP_MIGRATABLE>;
-		pe_mpidr = <0>; /* Unused */
-		runtime_el = <RD_ATTR_RUNTIME_SEL0>;
-		exec_type = <RD_ATTR_RUNTIME>;
-		panic_policy = <RD_ATTR_PANIC_ONESHOT>;
-		xlat_granule = <RD_ATTR_XLAT_GRANULE_4KB>;
-		binary_size = <IVY_IMAGE_SIZE>;
-		load_address = <0x00000000 IVY_IMAGE_BASE>;
-		entrypoint = <0x00000000 IVY_IMAGE_BASE>;
-	};
+	/* Properties */
+	description = "ivy-1";
+	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+	uuid = <0xeaba83d8 0xbaaf4eaf 0x8144f7fd 0xcbe544a7>;
+	execution-ctx-count = <1>;
+	exception-level = <2>; /* S-EL1 */
+	execution-state = <0>; /* AARCH64 */
+	load-address = <0x7600000>;
+	entrypoint-offset = <0x00001000>;
+	xlat-granule = <0>; /* 4KiB */
+	boot-order = <0>;
+	messaging-method = <0>; /* Direct messaging only */
+	run-time-model = <0>; /* Run to completion */
 
-	memory_regions {
-		v2m_iofpga {
-			str = "V2M IOFPGA";
-			base = <0x00000000 V2M_IOFPGA_BASE>;
-			size = <0x00000000 V2M_IOFPGA_SIZE>;
-			attr = <RD_MEM_DEVICE>;
-		};
-
-		device0 {
-			str = "Device 0";
-			base = <0x00000000 DEVICE0_BASE>;
-			size = <0x00000000 DEVICE0_SIZE>;
-			attr = <RD_MEM_DEVICE>;
-		};
-
-		spm_buffer {
-			str = "SPM buffer";
-			base = <0x00000000 IVY_SPM_BUF_BASE>;
-			size = <0x00000000 IVY_SPM_BUF_SIZE>;
-			attr = <RD_MEM_NORMAL_SPM_SP_SHARED_MEM>;
-		};
-
-		ns_buffer {
-			str = "NS buffer";
-			base = <0x00000000 IVY_NS_BUF_BASE>;
-			size = <0x00000000 IVY_NS_BUF_SIZE>;
-			attr = <RD_MEM_NORMAL_CLIENT_SHARED_MEM>;
-		};
-	};
-
-	notifications {
-		notification_0 {
-			attr = <0>;
-			pe = <0>;
-		};
-	};
-
-	services {
-		test_service_1 {
-			uuid = <IVY_SERVICE1_UUID_RD>;
-
-			accessibility = <(RD_SERV_ACCESS_SECURE |
-					  RD_SERV_ACCESS_EL3 |
-					  RD_SERV_ACCESS_NORMAL)>;
-			request_type = <(RD_SERV_SUPPORT_BLOCKING |
-					 RD_SERV_SUPPORT_NON_BLOCKING)>;
-			connection_quota = <10>;
-			sec_mem_size = <0>;
-			interrupt_num = <0>;
-		};
-	};
+	/* Boot protocol */
+	gp-register-num = <0x0>;
 };
diff --git a/spm/ivy/ivy_def.h b/spm/ivy/ivy_def.h
index 729c46d..815a59e 100644
--- a/spm/ivy/ivy_def.h
+++ b/spm/ivy/ivy_def.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -12,7 +12,7 @@
  */
 
 /* Up to 2 MiB at an arbitrary address that doesn't overlap the devices. */
-#define IVY_IMAGE_BASE			ULL(0x90000000)
+#define IVY_IMAGE_BASE			ULL(0x1000)
 #define IVY_IMAGE_SIZE			ULL(0x200000)
 
 /* Memory reserved for stacks */
diff --git a/tools/generate_json/generate_json.sh b/tools/generate_json/generate_json.sh
index f46cf15..30d901e 100755
--- a/tools/generate_json/generate_json.sh
+++ b/tools/generate_json/generate_json.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 #
-# Copyright (c) 2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -29,6 +29,9 @@
 	\t\"owner\": \"Plat\"\n\t},\n\n\t\"$1-tertiary\" : {\n \
 	\t\"image\": \"$1.bin\",\n \
 	\t\"pm\": \"$1-tertiary.dts\" \n \
+	},\n\n\t\"ivy\" : {\n \
+	\t\"image\": \"ivy.bin\",\n \
+	\t\"pm\": \"ivy.dts\" \n \
 	}\n}" \
 	> "$GENERATED_JSON"
 else