diff options
author | Shawn Shan <Shawn.Shan@arm.com> | 2021-06-16 17:18:33 +0800 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2021-07-07 05:16:08 +0200 |
commit | 6a92631917fcd30e78d68fbb2d579c8af7c18e95 (patch) | |
tree | d8a75f1331a7719cfd3b21a52966db2a21b3a818 /secure_fw/partitions/manifestfilename.template | |
parent | a4f23f8377b857dd9c4f69f43716baa1dfc38520 (diff) | |
download | trusted-firmware-m-6a92631917fcd30e78d68fbb2d579c8af7c18e95.tar.gz |
Tools: Deprecate the attribute 'tfm_partition_ipc'
'tfm_partition_ipc' was introduced to distinguish if partitions support
library model only. The FF-M v1.1 introduces a new SFN Model which is
an alternative of IPC Model. This attribute becomes confusing to
indicate the models. Made some changes to remove the attribute
'tfm_partition_ipc'.
Change-Id: Ifba5778caf87bb716993db3dc19986bbde3653c3
Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
Diffstat (limited to 'secure_fw/partitions/manifestfilename.template')
-rw-r--r-- | secure_fw/partitions/manifestfilename.template | 70 |
1 files changed, 30 insertions, 40 deletions
diff --git a/secure_fw/partitions/manifestfilename.template b/secure_fw/partitions/manifestfilename.template index a1a5f1510e..6211ef34e6 100644 --- a/secure_fw/partitions/manifestfilename.template +++ b/secure_fw/partitions/manifestfilename.template @@ -14,34 +14,36 @@ extern "C" { #endif -{% if attr.tfm_partition_ipc %} - {% set ns = namespace(iterator_counter=0) %} - {% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %} +{% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %} #define {{"%-55s"|format(manifest.name + "_MODEL_IPC")}} 0 #define {{"%-55s"|format(manifest.name + "_MODEL_SFN")}} 1 - {% else %} +{% else %} #define {{"%-55s"|format(manifest.name + "_MODEL_IPC")}} 1 #define {{"%-55s"|format(manifest.name + "_MODEL_SFN")}} 0 - {% endif %} +{% endif %} - {% if manifest.services %} - {% for service in manifest.services %} - {% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %} -psa_status_t {{service.name|lower}}_sfn(const psa_msg_t* msg); - {% else %} -#define {{"%-55s"|format(service.name + "_SIGNAL")}} (1U << ({{"%d"|format(ns.iterator_counter)}} + 4)) - {% set ns.iterator_counter = ns.iterator_counter + 1 %} - {% endif %} - {% endfor %} - {% endif %} - {% if ns.iterator_counter > 28 %} +{# Service and IRQ at least one must be declared. #} +{% if (manifest.services | length) == 0 and (manifest.irqs | length) == 0 %} +#error "Service and IRQ at least one must be declared!" +{% endif %} -#error "Too many signals!" - {% endif %} +{% set service_signal = namespace(bit=4) %} +{% if manifest.services %} + {% for service in manifest.services %} + {% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %} +psa_status_t {{service.name|lower}}_sfn(const psa_msg_t* msg); + {% else %} +#define {{"%-55s"|format(service.name + "_SIGNAL")}} (1U << {{"%d"|format(service_signal.bit)}}) + {% set service_signal.bit = service_signal.bit + 1 %} + {% endif %} + {% endfor %} +{% endif %} +{% if service_signal.bit > 32 %} +#error "Too many services!" {% endif %} -{% if manifest.irqs %} - {% set irq_ns = namespace(irq_iterator_counter=27) %} +{% set irq_signal = namespace(bit=31) %} +{% if manifest.irqs %} {% for irq in manifest.irqs %} {% set irq_data = namespace() %} {% if manifest.psa_framework_version == 1.0 %} @@ -49,20 +51,9 @@ psa_status_t {{service.name|lower}}_sfn(const psa_msg_t* msg); {% else %} {% set irq_data.signal = irq.name + "_SIGNAL" %} {% endif %} -#define {{"%-55s"|format(irq_data.signal)}} (1U << ({{"%d"|format(irq_ns.irq_iterator_counter)}} + 4)) - {% set irq_ns.irq_iterator_counter = irq_ns.irq_iterator_counter - 1 %} +#define {{"%-55s"|format(irq_data.signal)}} (1U << {{"%d"|format(irq_signal.bit)}}) + {% set irq_signal.bit = irq_signal.bit - 1 %} {% endfor %} - {% if attr.tfm_partition_ipc %} - {% if (ns.iterator_counter - 1) >= (irq_ns.irq_iterator_counter + 1) %} - -#error "Secure service and IRQ signal values overlap!" - {% endif %} - {% else %} - {% if (irq_ns.irq_iterator_counter + 1) < 0 %} - -#error "Too many IRQ signals!" - {% endif %} - {% endif %} {% if manifest.psa_framework_version == 1.1 %} {% for irq in manifest.irqs %} {% if irq.handling == "FLIH" %} @@ -70,13 +61,12 @@ psa_flih_result_t {{irq.name|lower}}_flih(void); {% endif %} {% endfor %} {% endif %} -{% else %} - {# If no RoT Service is defined in the services attribute, then at least one IRQ must be declared. #} - {% if attr.tfm_partition_ipc %} - {% if (manifest.services is not defined) or ((manifest.services | length()) == 0) %} -#error "At least one IRQ must be declared!" - {% endif %} - {% endif %} +{% endif %} +{% if (irq_signal.bit + 1) < 4 %} +#error "Too many IRQ signals!" +{% endif %} +{% if (service_signal.bit - 1) >= (irq_signal.bit + 1) %} +#error "Total number of services and irqs exceeds 28." {% endif %} #ifdef __cplusplus |