diff --git a/plat/xilinx/versal/include/platform_def.h b/plat/xilinx/versal/include/platform_def.h index 8cf8de0d4..a3886a4be 100644 --- a/plat/xilinx/versal/include/platform_def.h +++ b/plat/xilinx/versal/include/platform_def.h @@ -63,6 +63,12 @@ # define PLAT_ARM_NS_IMAGE_BASE U(PRELOADED_BL33_BASE) #endif +/******************************************************************************* + * HIGH and LOW DDR MAX definitions + ******************************************************************************/ +#define PLAT_DDR_LOWMEM_MAX U(0x80000000) +#define PLAT_DDR_HIGHMEM_MAX U(0x100000000) + /******************************************************************************* * TSP specific defines. ******************************************************************************/ diff --git a/plat/xilinx/versal/plat_psci.c b/plat/xilinx/versal/plat_psci.c index b9762675f..396d7c725 100644 --- a/plat/xilinx/versal/plat_psci.c +++ b/plat/xilinx/versal/plat_psci.c @@ -194,6 +194,18 @@ static void __dead2 versal_system_reset(void) } } +static int32_t versal_validate_ns_entrypoint(uint64_t ns_entrypoint) +{ + int32_t ret = PSCI_E_SUCCESS; + + if (((ns_entrypoint >= PLAT_DDR_LOWMEM_MAX) && (ns_entrypoint <= PLAT_DDR_HIGHMEM_MAX)) || + ((ns_entrypoint >= BL31_BASE) && (ns_entrypoint <= BL31_LIMIT))) { + ret = PSCI_E_INVALID_ADDRESS; + } + + return ret; +} + /** * versal_pwr_domain_off() - This function performs actions to turn off core. * @target_state: Targated state. @@ -291,6 +303,7 @@ static const struct plat_psci_ops versal_nopmc_psci_ops = { .pwr_domain_suspend_finish = versal_pwr_domain_suspend_finish, .system_off = versal_system_off, .system_reset = versal_system_reset, + .validate_ns_entrypoint = versal_validate_ns_entrypoint, .validate_power_state = versal_validate_power_state, .get_sys_suspend_power_state = versal_get_sys_suspend_power_state, };