Hello Bohdan,

 

As you read, FFM does not give a straight example for Named MMIO regions, hence this item leads to an implementation-defined item for implementation convenience. And, Numbered MMIO region is a straight item for address-based assets - mainly the memory and some other memory-mapped devices.

 

In TF-M, the named MMIO region is regarded as a ‘symbolic name’, which is a global variable name or function name that can be referenced by the linker. It is the platform that decides how to extract data from this symbol, SPM does not care about the encoding scheme behind this symbol - it treats it as a platform-specific value and delivery this value back to the platform (as a member of partition info) and requires platform manipulation.

 

The preprocessor 'ASSET_ATTR_NAMED_MMIO' is defined but not used as there are no named regions get used in the reference platform. But for the numbered region, it is used as we treat it as a memory segment descriptor for the MPU setting. But now there is no partition that binds a real private peripherals device address - they are running as PRoT with privileged hence they directly access the memory. It is a shortcut that most of the partitions are doing - which is improper and brings misunderstanding. We encourage those partitions with private peripheral devices can access these peripheral addresses directly, and leave these mapping/unmapping operations to the HAL operations - through the asset descriptions you mentioned.

 

BR

 

/Ken

 

From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Thursday, September 29, 2022 5:40 AM
To: tf-m@lists.trustedfirmware.org
Subject: [TF-M] Partition assets attributes

 

Hi everyone,

 

I have several questions related to partition assets attributes.

 

FFM specifies 2 types of assets (mmio_regions):

 

FFM does not really specify the use cases for these 2 different types.

I expect that Named region is only used for peripherals and numbered region is only used for memory regions.

Am I right here? If no, then what the use cases for these 2 types are and what is currently supported in TFM?

 

Also I see that in tools/templates/partition_load_info.template lines 221-224   ASSET_ATTR_NUMBERED_MMIO or ASSET_ATTR_NAMED_MMIO are assigned for assets from manifest files depending on their type, but  tools/templates/partition_load_info.template#187 does not assign any of these attributes for “PART_REGION_ADDR(PT_{{manifest.name}}_PRIVATE, _DATA_START$$Base)” at isolation level 3.

Is this some a bug or I am missing some knowledge on this mmio_regions stuff?

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com