From: Julian Haller <[email protected]>

Allow overriding fit,engine and fit,engine-keydir via arguments,
enabling engine selection at build time without modifying the device
tree.

Signed-off-by: Julian Haller <[email protected]>
---
 Makefile                  |  2 ++
 tools/binman/etype/fit.py | 13 +++----------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 49d9740327e..ffcc639382b 100644
--- a/Makefile
+++ b/Makefile
@@ -1701,6 +1701,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if 
$(BINMAN_DEBUG),-D) \
                -a vpl-dtb=$(CONFIG_VPL_OF_REAL) \
                -a pre-load-key-path=${PRE_LOAD_KEY_PATH} \
                -a of-spl-remove-props=$(CONFIG_OF_SPL_REMOVE_PROPS) \
+               $(if $(FIT_ENGINE),-a fit$(comma)engine=$(FIT_ENGINE)) \
+               $(if $(FIT_ENGINE_KEYDIR),-a 
fit$(comma)engine-keydir=$(FIT_ENGINE_KEYDIR)) \
                $(BINMAN_$(@F))
 
 OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index f28b1e6b4cb..4f429261ccf 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -646,17 +646,10 @@ class Entry_fit(Entry_section):
                              OpenSSL API, as second element of the Tuple. None
                              if no keydir to pass.
         """
-        engine = None
+        engine = self.GetArg('fit,engine', str)
         engine_keydir = None
-
-        prop = self._fit_props.get('fit,engine')
-        if prop is not None:
-            engine = prop.value
-
-            prop = self._fit_props.get('fit,engine-keydir')
-            if prop is not None:
-                engine_keydir = prop.value
-
+        if engine is not None:
+            engine_keydir = self.GetArg('fit,engine-keydir', str)
         return engine, engine_keydir
 
     def BuildSectionData(self, required):
-- 
2.43.0

Reply via email to