summaryrefslogtreecommitdiff
path: root/tools/dtoc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-11-23 21:03:38 +0300
committerSimon Glass <sjg@chromium.org>2021-12-02 19:15:43 +0300
commitff139b6c70ff452df7f231627c796bdd259f6bbc (patch)
tree90093619ba2d90f178e0dba3d76e43472cbc0eef /tools/dtoc
parent34bee10e00bc77bbe4287abe15a16f3048085424 (diff)
downloadu-boot-ff139b6c70ff452df7f231627c796bdd259f6bbc.tar.xz
dtoc: Bring in the libfdt module automatically
Use the same technique as with binman to load this module from the U-Boot tree if available. This allows running tests without having to specify the PYTHONPATH variable. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc')
-rwxr-xr-xtools/dtoc/test_fdt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index d104f3c774..d86fc86187 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -16,6 +16,12 @@ import unittest
our_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, os.path.join(our_path, '..'))
+# Bring in the libfdt module
+sys.path.insert(2, 'scripts/dtc/pylibfdt')
+sys.path.insert(2, os.path.join(our_path, '../../scripts/dtc/pylibfdt'))
+sys.path.insert(2, os.path.join(our_path,
+ '../../build-sandbox_spl/scripts/dtc/pylibfdt'))
+
from dtoc import fdt
from dtoc import fdt_util
from dtoc.fdt_util import fdt32_to_cpu