Merge changes from topic "nrd1_refactor" into integration

* changes:
  feat(rdn1edge): remove RD-N1-Edge from deprecated list
  feat(sgi575): remove SGI-575 from deprecated list
  fix(rdn1edge): update RD-N1-Edge's changelog title
  feat(neoverse-rd): add scope for RD-V1-MC
  feat(neoverse-rd): add scope for RD-V1
  feat(neoverse-rd): add scope for SGI-575
  feat(neoverse-rd): disable SPMD_SPM_AT_SEL2 for A75/V1/N1 platforms
  feat(neoverse-rd): enable AMU if supported by the platform
  refactor(neoverse-rd): clean-up nrd_plat_arm_def1.h file
  refactor(neoverse-rd): remove unused defines from platform_def.h
  refactor(neoverse-rd): move defines out of platform_def.h
  refactor(neoverse-rd): rename definitions in nrd_ros_fw_def1.h file
  refactor(neoverse-rd): rename definitions in nrd_ros_def1.h file
  refactor(neoverse-rd): rename definitions in nrd_css_fw_def1.h file
  refactor(neoverse-rd): rename definitions in nrd_css_def1.h file
  refactor(neoverse-rd): rewrite CSS and RoS device mmap macros
  refactor(neoverse-rd): refactor mmap macro for RoS device memory region
  refactor(neoverse-rd): refactor mmap macro for CSS device memory region
  refactor(neoverse-rd): migrate mmap entry from nrd_plat1.c
  refactor(neoverse-rd): rename nrd_plat.c file
  refactor(neoverse-rd): refactor nrd_soc_css_def.h file
  refactor(neoverse-rd): refactor nrd_soc_platform_def.h file
  refactor(neoverse-rd): move away from nrd_base_platform_def.h
  refactor(neoverse-rd): remove inclusion of nrd_base_platform_def.h
  refactor(neoverse-rd): header files for first generation platforms
  refactor(neoverse-rd): refactor scope for Neoverse RD platforms
diff --git a/services/spd/opteed/opteed_main.c b/services/spd/opteed/opteed_main.c
index 83b001a..d6c0040 100644
--- a/services/spd/opteed/opteed_main.c
+++ b/services/spd/opteed/opteed_main.c
@@ -87,6 +87,13 @@
 	uint32_t linear_id;
 	optee_context_t *optee_ctx;
 
+#if OPTEE_ALLOW_SMC_LOAD
+	if (optee_vector_table == NULL) {
+		/* OPTEE is not loaded yet, ignore this interrupt */
+		SMC_RET0(handle);
+	}
+#endif
+
 	/* Check the security state when the exception was generated */
 	assert(get_interrupt_src_ss(flags) == NON_SECURE);
 
@@ -115,6 +122,24 @@
 	SMC_RET1(&optee_ctx->cpu_ctx, read_elr_el3());
 }
 
+/*
+ * Registers an interrupt handler for S-EL1 interrupts when generated during
+ * code executing in the non-secure state. Panics if it fails to do so.
+ */
+static void register_opteed_interrupt_handler(void)
+{
+	u_register_t flags;
+	uint64_t rc;
+
+	flags = 0;
+	set_interrupt_rm_flag(flags, NON_SECURE);
+	rc = register_interrupt_type_handler(INTR_TYPE_S_EL1,
+			opteed_sel1_interrupt_handler,
+			flags);
+	if (rc)
+		panic();
+}
+
 /*******************************************************************************
  * OPTEE Dispatcher setup. The OPTEED finds out the OPTEE entrypoint and type
  * (aarch32/aarch64) if not already known and initialises the context for entry
@@ -125,6 +150,11 @@
 #if OPTEE_ALLOW_SMC_LOAD
 	opteed_allow_load = true;
 	INFO("Delaying OP-TEE setup until we receive an SMC call to load it\n");
+	/*
+	 * We must register the interrupt handler now so that the interrupt
+	 * priorities are not changed after starting the linux kernel.
+	 */
+	register_opteed_interrupt_handler();
 	return 0;
 #else
 	entry_point_info_t *optee_ep_info;
@@ -575,7 +605,6 @@
 	cpu_context_t *ns_cpu_context;
 	uint32_t linear_id = plat_my_core_pos();
 	optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
-	uint64_t rc;
 
 	/*
 	 * Determine which security state this SMC originated from
@@ -709,18 +738,9 @@
 			 */
 			psci_register_spd_pm_hook(&opteed_pm);
 
-			/*
-			 * Register an interrupt handler for S-EL1 interrupts
-			 * when generated during code executing in the
-			 * non-secure state.
-			 */
-			flags = 0;
-			set_interrupt_rm_flag(flags, NON_SECURE);
-			rc = register_interrupt_type_handler(INTR_TYPE_S_EL1,
-						opteed_sel1_interrupt_handler,
-						flags);
-			if (rc)
-				panic();
+#if !OPTEE_ALLOW_SMC_LOAD
+			register_opteed_interrupt_handler();
+#endif
 		}
 
 		/*