1 /*
2 * Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6 #include <bl31/ehf.h>
7 #include <common/debug.h>
8 #include <plat/common/platform.h>
9 #include <services/sdei.h>
10
11 #include <platform_def.h>
12
arm_validate_ns_entrypoint(uintptr_t entrypoint)13 int arm_validate_ns_entrypoint(uintptr_t entrypoint)
14 {
15 int ret;
16 uintptr_t base = BL31_BASE;
17 uintptr_t limit = BL31_LIMIT;
18
19 ret = ((entrypoint < base) || (entrypoint > limit)) ? 0 : -1;
20 return ret;
21 }
22
23 /* Private event mappings */
24 static sdei_ev_map_t versal_net_sdei_private[] = {
25 SDEI_DEFINE_EVENT_0(VERSAL_NET_SDEI_SGI_PRIVATE),
26 SDEI_PRIVATE_EVENT(VERSAL_NET_SDEI_PRV_EV, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
27 };
28
29 /* Shared event mappings */
30 static sdei_ev_map_t versal_net_sdei_shared[] = {
31 SDEI_SHARED_EVENT(VERSAL_NET_SDEI_SH_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
32 };
33
plat_sdei_setup(void)34 void plat_sdei_setup(void)
35 {
36 INFO("SDEI platform setup\n");
37 }
38
39 /* Export ARM SDEI events */
40 REGISTER_SDEI_MAP(versal_net_sdei_private, versal_net_sdei_shared);
41