Hi Bohdan,

 

Well, that is a shortcut for implementation convenience – when switching partitions, the private data (program memory) and peripheral address need to be changed both, hence we used a memory regions array there, line 187 is for the program memory, as it is not a peripheral, we did not assign the MMIO flags on it.

 

Yes, you can treat these two types as what you have described: numbered is for address-based peripherals and named for those special devices needs special accessing mechanism other than a direct address.

 

BR

 

/Ken

 

From: Bohdan.Hunko@infineon.com <Bohdan.Hunko@infineon.com>
Sent: Friday, September 30, 2022 6:13 AM
To: Ken Liu <Ken.Liu@arm.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: RE: Partition assets attributes

 

Hi Ken,

 

Several follow up questions:

  1. Why  tools/templates/partition_load_info.template#187 does not assign any attributes (Named or numbered region) to “PART_REGION_ADDR(PT_{{manifest.name}}_PRIVATE_DATA_START$$Base)”? Looks like it should have .attr = ASSET_ATTR_NAMED_MMIO
  2. So if I got your point then:
    1. NAMED region (which has “name” filed) == peripheral
    2. NUMBERED region (which has “base” and “size” fields) == memory

Correct?

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

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

 

From: Ken Liu via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Thursday, 29 September 2022 04:37
To: tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: [TF-M] Re: Partition assets attributes

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.

 

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