Hi Bohdan,
For the Load$$LR$$LR_NS_PARTITION$$Base, it equals to the macro defined in region_defs.h. But not all the load region can simply defined in the region_defs.h. For example, the Load$$LR$$LR_VENEER$$Limit can be only derived by the compiler. So a unify format for different load regions makes it more clear.
Also I think using the REGION_NAME macro unify the code on different compilers.
On the armclang compiler, the Load$$LR$$LR_NS_PARTITION$$Base is automatically generated by the compiler for the "LR_NS_PARTITION" load region.
But this is not automatically generated for the gnu compiler. So in the link script for gcc, it defined the variable explicitly.
For the iar compiler, they defined specific macros to make it compatible. See the code herehttps://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/include/region.h#n23.
Regards, Sherry Zhang
From: TF-M tf-m-bounces@lists.trustedfirmware.org On Behalf Of Bohdan Hunko via TF-M Sent: Wednesday, September 15, 2021 4:24 PM To: tf-m@lists.trustedfirmware.org Subject: [TF-M] memory_region_limits structure contents
Hi everyone,
I was wondering is there any reasons to use REGION_NAME(Load$$LR$$, LR_NS_PARTITION, $$Base) declared in this codehttps://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ext/target/arm/musca_b1/sse_200/target_cfg.c#n27 and used herehttps://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ext/target/arm/musca_b1/sse_200/target_cfg.c#n36?
From code in common linker scripthttps://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ext/common/gcc/tfm_isolation_l3.ld.template#n529 I can see: Load$$LR$$LR_NS_PARTITION$$Base = NS_PARTITION_START.
So the question is: why regions are used instead of simply using NS_PARTITION_START? And the follow up questions is: do platforms that are built in IPC model (not library model) really need REGION_NAME(Load$$LR$$, LR_VENEER, $$Base)in memory_region_limits memory_regions struct, or that could be just dummy value?
Best regards, Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com