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 here.

 

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 code and used here?

From code  in common linker script 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.com