/* * Copyright (c) 2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * */ #include #include "common_target_cfg.h" #include "tfm_hal_platform.h" #include "region.h" #include "region_defs.h" /* The section names come from the scatter file */ REGION_DECLARE(Load$$LR$$, LR_NS_PARTITION, $$Base); REGION_DECLARE(Image$$, ER_VENEER, $$Base); REGION_DECLARE(Image$$, VENEER_ALIGN, $$Limit); #ifdef BL2 REGION_DECLARE(Load$$LR$$, LR_SECONDARY_PARTITION, $$Base); #endif /* BL2 */ const struct memory_region_limits memory_regions = { .non_secure_code_start = (uint32_t)®ION_NAME(Load$$LR$$, LR_NS_PARTITION, $$Base) + BL2_HEADER_SIZE, .non_secure_partition_base = (uint32_t)®ION_NAME(Load$$LR$$, LR_NS_PARTITION, $$Base), .non_secure_partition_limit = (uint32_t)®ION_NAME(Load$$LR$$, LR_NS_PARTITION, $$Base) + NS_PARTITION_SIZE - 1, .veneer_base = (uint32_t)®ION_NAME(Image$$, ER_VENEER, $$Base), .veneer_limit = (uint32_t)®ION_NAME(Image$$, VENEER_ALIGN, $$Limit) - 1, #ifdef BL2 .secondary_partition_base = (uint32_t)®ION_NAME(Load$$LR$$, LR_SECONDARY_PARTITION, $$Base), .secondary_partition_limit = (uint32_t)®ION_NAME(Load$$LR$$, LR_SECONDARY_PARTITION, $$Base) + SECONDARY_PARTITION_SIZE - 1, #endif /* BL2 */ }; uint32_t tfm_hal_get_ns_VTOR(void) { return memory_regions.non_secure_code_start; } uint32_t tfm_hal_get_ns_MSP(void) { return *((uint32_t *)memory_regions.non_secure_code_start); } uint32_t tfm_hal_get_ns_entry_point(void) { return *((uint32_t *)(memory_regions.non_secure_code_start + 4)); }