From 04e7f80823e8a083138dd25963a5509bacd93257 Mon Sep 17 00:00:00 2001 From: J-Alves Date: Thu, 11 Jan 2024 13:35:52 +0000 Subject: [PATCH] fix(spm): not defining load-address in SP config The FF-A specification has made it such that SPs may optionally specify their load address in the manifest. This info was being retrieved to generate some information for the SPMC manifest. However, it is not a mandatory utility. This change relaxes the case in which the SP manifest doesn't have a load address. Signed-off-by: J-Alves Change-Id: Ic4c1b1ec6666522900c113903be45ba0eb5d0bf6 --- tools/sptool/sp_mk_generator.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/sptool/sp_mk_generator.py b/tools/sptool/sp_mk_generator.py index c69e0a73d..06fa520dd 100644 --- a/tools/sptool/sp_mk_generator.py +++ b/tools/sptool/sp_mk_generator.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -# Copyright (c) 2020-2023, Arm Limited. All rights reserved. +# Copyright (c) 2020-2024, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause @@ -136,7 +136,10 @@ def get_load_address(sp_layout, sp, args :dict): ''' Helper to fetch load-address from pm file listed in sp_layout.json''' with open(get_sp_manifest_full_path(sp_layout[sp], args), "r") as pm_f: load_address_lines = [l for l in pm_f if 'load-address' in l] - assert(len(load_address_lines) == 1) + + if len(load_address_lines) is not 1: + return None + load_address_parsed = re.search("(0x[0-9a-f]+)", load_address_lines[0]) return load_address_parsed.group(0) @@ -240,7 +243,8 @@ def gen_fconf_fragment(sp_layout, sp, args: dict): else: load_address = get_load_address(sp_layout, sp, args) - f.write( + if load_address is not None: + f.write( f'''\ {sp} {{ uuid = "{uuid}"; @@ -249,6 +253,9 @@ f'''\ }}; ''') + else: + print("Warning: No load-address was found in the SP manifest.") + return args def init_sp_actions(sys):