diff options
author | Mingyang Sun <mingyang.sun@arm.com> | 2021-07-27 14:29:25 +0800 |
---|---|---|
committer | Ken Liu <ken.liu@arm.com> | 2021-09-01 06:22:45 +0200 |
commit | df02b857e311954bd2b0eb50eca0c8825b963cce (patch) | |
tree | c20e131b83321e99a138124c92943c43aea11725 /tools | |
parent | 2e8a549dd54f7bed3def0ef0dc2503df5e00b07c (diff) | |
download | trusted-firmware-m-df02b857e311954bd2b0eb50eca0c8825b963cce.tar.gz |
SPM: Add support for numbered mmio object
FF-M defines "Named region object" and "Numbered region
object" for mmio. This patch adds:
- Support for "Numbered region object" information parsing
in the template.
- Refine of mmio attribute definitions.
Change-Id: I3e1fd10a4a08fe03b5c0715cc20f134120a58677
Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/templates/partition_load_info.template | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/tools/templates/partition_load_info.template b/tools/templates/partition_load_info.template index ca9161ab1d..767d9dbaec 100644 --- a/tools/templates/partition_load_info.template +++ b/tools/templates/partition_load_info.template @@ -164,18 +164,30 @@ const struct partition_{{manifest.name|lower}}_load_info_t {{manifest.name|lower #if TFM_LVL == 3 .assets = { { - .mem.addr_x = PART_REGION_ADDR(PT_{{manifest.name}}_PRIVATE, _DATA_START$$Base), - .mem.addr_y = PART_REGION_ADDR(PT_{{manifest.name}}_PRIVATE, _DATA_END$$Base), - .attr = ASSET_MEM_RD_BIT | ASSET_MEM_WR_BIT, + .mem.start = PART_REGION_ADDR(PT_{{manifest.name}}_PRIVATE, _DATA_START$$Base), + .mem.limit = PART_REGION_ADDR(PT_{{manifest.name}}_PRIVATE, _DATA_END$$Base), + .attr = ASSET_ATTR_READ_WRITE, }, {% if counter.asset_counter > 0 %} {% for region in manifest.mmio_regions %} {% if region.conditional %} #ifdef {{region.conditional}} {% endif %} + {% if region.base and region.size %} { - .dev.addr_ref = PTR_TO_REFERENCE({{region.name}}), - .attr = ASSET_DEV_REF_BIT, + .mem.start = {{region.base}}, + .mem.limit = {{region.base}} + {{region.size}}, + .attr = ASSET_ATTR_NUMBERED_MMIO + {% elif region.name %} + { + .dev.dev_ref = PTR_TO_REFERENCE({{region.name}}), + .attr = ASSET_ATTR_NAMED_MMIO + {% endif %} + {% if region.permission == "READ-WRITE" %} + | ASSET_ATTR_READ_WRITE, + {% else %} + | ASSET_ATTR_READ_ONLY, + {% endif %} }, {% if region.conditional %} #endif @@ -190,9 +202,21 @@ const struct partition_{{manifest.name|lower}}_load_info_t {{manifest.name|lower {% if region.conditional %} #ifdef {{region.conditional}} {% endif %} + {% if region.base and region.size %} { - .dev.addr_ref = PTR_TO_REFERENCE({{region.name}}), - .attr = ASSET_DEV_REF_BIT, + .mem.start = {{region.base}}, + .mem.limit = {{region.base}} + {{region.size}}, + .attr = ASSET_ATTR_NUMBERED_MMIO + {% elif region.name %} + { + .dev.dev_ref = PTR_TO_REFERENCE({{region.name}}), + .attr = ASSET_ATTR_NAMED_MMIO + {% endif %} + {% if region.permission == "READ-WRITE" %} + | ASSET_ATTR_READ_WRITE, + {% else %} + | ASSET_ATTR_READ_ONLY, + {% endif %} }, {% if region.conditional %} #endif |