feat: add option to input text instead of tag id number
Change-Id: I6d1b1a20d1cd5b073d7d614da102b9e6bd8ea522
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
diff --git a/tools/tlc/tests/test_cli.py b/tools/tlc/tests/test_cli.py
index 5c1035c..6d50ab7 100644
--- a/tools/tlc/tests/test_cli.py
+++ b/tools/tlc/tests/test_cli.py
@@ -240,13 +240,18 @@
"tag_id": 0x100,
"pp_addr": 100,
},
+ {
+ "tag_id": "optee_pageable_part",
+ "pp_addr": 100,
+ },
],
)
def test_create_from_yaml_check_sum_bytes(tlcrunner, tmpyamlconfig, tmptlstr, entry):
"""Test creating a TL from a yaml file, but only check that the sum of the
data in the yaml file matches the sum of the data in the TL. This means
you don't have to type the exact sequence of expected bytes. All the data
- in the yaml file must be integers.
+ in the yaml file must be integers (except for the tag IDs, which can be
+ strings).
"""
# create yaml config file
config = {
diff --git a/tools/tlc/tlc/tl.py b/tools/tlc/tlc/tl.py
index dae7e14..eec5db0 100644
--- a/tools/tlc/tlc/tl.py
+++ b/tools/tlc/tlc/tl.py
@@ -259,7 +259,10 @@
:param entry: Dictionary containing the data described above.
"""
+ # Tag_id is either a tag name or a tag id. Use it to get the TE format.
tag_id = entry["tag_id"]
+ if tag_id in tag_name_to_tag_id:
+ tag_id = tag_name_to_tag_id[tag_id]
te_format = transfer_entry_formats[tag_id]
tag_name = te_format["tag_name"]