Merge changes from topic "nrd2_refactor" into integration

* changes:
  feat(docs): update maintainer list for neoverse_rd
  refactor(neoverse-rd): remove soc_css.mk from common makefile
  refactor(neoverse-rd): unify GIC SPI range macros
  refactor(neoverse-rd): clean-up nrd_plat_arm_def2.h file
  feat(neoverse-rd): disable SPMD_SPM_AT_SEL2 for N2/V2 platforms
  feat(rdn2): enable AMU if present on the platform
  feat(rdn2): enable MTE2 if present on the platform
  refactor(neoverse-rd): move defines out of platform_def.h
  refactor(neoverse-rd): add defines for ROM, SRAM and DRAM2
  refactor(neoverse-rd): define naming convention for RoS macros
  refactor(neoverse-rd): define naming convention for CSS 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): set mmap naming convention
  refactor(neoverse-rd): rename nrd_plat_v2.c to align with convention
  refactor(neoverse-rd): refactor nrd_soc_css_def_v2.h file
  refactor(neoverse-rd): refactor nrd_soc_platform_def_v2.h file
  refactor(neoverse-rd): refactor nrd_base_platform_def.h
  refactor(neoverse-rd): header files for second generation 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
 		}
 
 		/*