diff options
author | Mingyang Sun <mingyang.sun@arm.com> | 2021-04-02 16:51:05 +0800 |
---|---|---|
committer | Mingyang Sun <mingyang.sun@arm.com> | 2021-05-08 16:23:14 +0800 |
commit | f6a78572d5722a8e08d4e2bc1bcac8736e684eac (patch) | |
tree | a01392c5b3138fc8ef3b28fb4e4e4e02924e643d /tools | |
parent | 00df2357ff73936a6da5e94c41ccf7f9e7f11041 (diff) | |
download | trusted-firmware-m-f6a78572d5722a8e08d4e2bc1bcac8736e684eac.tar.gz |
Build: Build and arrange partition static data
- Add a template to generate partition static data into
dedicated source files. For the ns internal partition,
manually add a source file for it.
- Put these data into a dedicated memory section, to
prepare for partition loading.
Change-Id: Iad988608b04d2db9f5f43e7528f3ef21c1252f31
Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tfm_parse_manifest_list.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py index 1aea3cec17..68b5979425 100644 --- a/tools/tfm_parse_manifest_list.py +++ b/tools/tfm_parse_manifest_list.py @@ -75,6 +75,7 @@ def process_manifest(manifest_list_files): manifesttemplate = ENV.get_template('secure_fw/partitions/manifestfilename.template') memorytemplate = ENV.get_template('secure_fw/partitions/partition_intermedia.template') + infotemplate = ENV.get_template('secure_fw/partitions/partition_static_info.template') pid_list = [] no_pid_manifest_idx = [] @@ -115,6 +116,7 @@ def process_manifest(manifest_list_files): 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('\\', '/') + infofile_name = os.path.join(manifest_dir, "auto_generated", 'static_info_' + context['file_name'] + '.c').replace('\\', '/') """ Remove the `source_path` portion of the filepaths, so that it can be @@ -125,12 +127,14 @@ def process_manifest(manifest_list_files): 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) + infofile_name = os.path.relpath(infofile_name, start = source_path) partition_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) + infofile_name = os.path.join(OUT_DIR, infofile_name) outfile_path = os.path.dirname(outfile_name) if not os.path.exists(outfile_path): @@ -152,6 +156,16 @@ def process_manifest(manifest_list_files): memoutfile.write(memorytemplate.render(context)) memoutfile.close() + infofile_path = os.path.dirname(infofile_name) + if not os.path.exists(infofile_path): + os.makedirs(infofile_path) + + print ("Generating " + infofile_name) + + info_outfile = io.open(infofile_name, "w", newline=None) + info_outfile.write(infotemplate.render(context)) + info_outfile.close() + return partition_db def gen_files(context, gen_file_lists): |