aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMingyang Sun <mingyang.sun@arm.com>2020-10-15 14:53:12 +0800
committerMingyang Sun <mingyang.sun@arm.com>2020-12-29 13:49:07 +0800
commitd20999f6172ba7a08584ec6208d17b3b8f6e4859 (patch)
tree82948268eee13961d9449eea55080feda2dc0b80 /tools
parent1d2329a88cf0d6437d3a3545f68bfb19203118fe (diff)
downloadtrusted-firmware-m-d20999f6172ba7a08584ec6208d17b3b8f6e4859.tar.gz
Build: Add global array used as stacks
This patch adds global array as partition stacks. Global stack arrays are generated automatically in the build process. Using a global array as partition stack would wrap stack into partition private data, which skips allocating specific space by the linker. The related tools and templates are modified together in this patch. The 'psa_ff_test' related partitions also need new generated intermedia files, before feedback this change to 'psa_ff_test', put those test partitions intermedia files under build directory. Change-Id: Ibcc79bdee0c3d4db7cd060bb92861ce3aa5e4437 Signed-off-by: Ken Liu <ken.liu@arm.com> Co-authored-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/tfm_parse_manifest_list.py19
-rw-r--r--tools/tfm_psa_ff_test_manifest_list.yaml9
2 files changed, 25 insertions, 3 deletions
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py
index b346f6f33..795d90a04 100644
--- a/tools/tfm_parse_manifest_list.py
+++ b/tools/tfm_parse_manifest_list.py
@@ -73,8 +73,8 @@ def process_manifest(manifest_list_files):
manifest_dic = yaml.safe_load(manifest_list_yaml_file)
manifest_list.extend(manifest_dic["manifest_list"])
- templatefile_name = 'secure_fw/partitions/manifestfilename.template'
- template = ENV.get_template(templatefile_name)
+ manifesttemplate = ENV.get_template('secure_fw/partitions/manifestfilename.template')
+ memorytemplate = ENV.get_template('secure_fw/partitions/partition_intermedia.template')
print("Start to generate PSA manifests:")
for manifest_item in manifest_list:
@@ -95,6 +95,7 @@ def process_manifest(manifest_list_files):
outfile_name = manifest_name.replace('yaml', 'h').replace('json', 'h')
context['file_name'] = outfile_name.replace('.h', '')
outfile_name = os.path.join(manifest_dir, "psa_manifest", outfile_name).replace('\\', '/')
+ intermediafile_name = os.path.join(manifest_dir, "auto_generated", 'intermedia_' + context['file_name'] + '.c').replace('\\', '/')
"""
Remove the `source_path` portion of the filepaths, so that it can be
@@ -104,11 +105,13 @@ def process_manifest(manifest_list_files):
# Replace environment variables in the source path
source_path = os.path.expandvars(manifest_item['source_path'])
outfile_name = os.path.relpath(outfile_name, start = source_path)
+ intermediafile_name = os.path.relpath(intermediafile_name, start = source_path)
db.append({"manifest": manifest, "attr": manifest_item, "header_file": outfile_name})
if OUT_DIR is not None:
outfile_name = os.path.join(OUT_DIR, outfile_name)
+ intermediafile_name = os.path.join(OUT_DIR, intermediafile_name)
outfile_path = os.path.dirname(outfile_name)
if not os.path.exists(outfile_path):
@@ -117,9 +120,19 @@ def process_manifest(manifest_list_files):
print ("Generating " + outfile_name)
outfile = io.open(outfile_name, "w", newline=None)
- outfile.write(template.render(context))
+ outfile.write(manifesttemplate.render(context))
outfile.close()
+ intermediafile_path = os.path.dirname(intermediafile_name)
+ if not os.path.exists(intermediafile_path):
+ os.makedirs(intermediafile_path)
+
+ print ("Generating " + intermediafile_name)
+
+ memoutfile = io.open(intermediafile_name, "w", newline=None)
+ memoutfile.write(memorytemplate.render(context))
+ memoutfile.close()
+
return db
def gen_files(context, gen_file_lists):
diff --git a/tools/tfm_psa_ff_test_manifest_list.yaml b/tools/tfm_psa_ff_test_manifest_list.yaml
index cba0c5ca4..9eb1f9c55 100644
--- a/tools/tfm_psa_ff_test_manifest_list.yaml
+++ b/tools/tfm_psa_ff_test_manifest_list.yaml
@@ -24,6 +24,9 @@
"linker_pattern": {
"library_list":[
"*client_partition.a"
+ ],
+ "object_list":[
+ "*intermedia_client_partition_psa.*"
]
}
},
@@ -40,6 +43,9 @@
"linker_pattern": {
"library_list":[
"*server_partition.a"
+ ],
+ "object_list":[
+ "*intermedia_server_partition_psa.*"
]
}
},
@@ -56,6 +62,9 @@
"linker_pattern": {
"library_list":[
"*driver_partition.a"
+ ],
+ "object_list":[
+ "*intermedia_driver_partition_psa.*"
]
}
}