[U-Boot] [PATCH 0/2] test: Fixes to allow tests to run on a machine with old dtc

These two patches should fix the problem with u-boot-dm/master where the binman tests fail.
Simon Glass (2): dtoc: Allow DTC environment variable to provide path to dtc test: Set the DTC environment variable
test/run | 8 +++++--- tools/binman/README | 4 ++++ tools/dtoc/fdt_util.py | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-)

The system device-tree compiler may not be new enough to run the tests we use in U-Boot (e.g. with binman). Allow use of a DTC environment variable to point to the correct dtc. If not defined, the dtc on the default PATH is used.
Signed-off-by: Simon Glass sjg@chromium.org ---
tools/binman/README | 4 ++++ tools/dtoc/fdt_util.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/binman/README b/tools/binman/README index 08c3e56bde..7f558ec6a9 100644 --- a/tools/binman/README +++ b/tools/binman/README @@ -536,6 +536,10 @@ entry contents. Most of the time such essoteric behaviour is not needed, but it can be essential for complex images.
+If you need to specify a particular device-tree compiler to use, you can define +the DTC environment variable. This can be useful when the system dtc is too +old. +
History / Credits ----------------- diff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py index ba0b6cc381..ad06245b42 100644 --- a/tools/dtoc/fdt_util.py +++ b/tools/dtoc/fdt_util.py @@ -79,7 +79,8 @@ def EnsureCompiled(fname): '-W', 'no-unit_address_vs_reg'] args.extend(search_list) args.append(dts_input) - command.Run('dtc', *args) + dtc = os.environ.get('DTC') or 'dtc' + command.Run(dtc, *args) return dtb_output
def GetInt(node, propname, default=None):

On 24 December 2017 at 11:12, Simon Glass sjg@chromium.org wrote:
The system device-tree compiler may not be new enough to run the tests we use in U-Boot (e.g. with binman). Allow use of a DTC environment variable to point to the correct dtc. If not defined, the dtc on the default PATH is used.
Signed-off-by: Simon Glass sjg@chromium.org
tools/binman/README | 4 ++++ tools/dtoc/fdt_util.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
Applied to u-boot-dm (and now in mainline). Sorry for the delay.

Set this to our own device-tree compiler since we know it is new enough to run the tests.
Signed-off-by: Simon Glass sjg@chromium.org ---
test/run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/test/run b/test/run index d5631b802a..b2d24e3f8e 100755 --- a/test/run +++ b/test/run @@ -17,17 +17,19 @@ run_test ./test/py/test.py --bd sandbox_spl --build -k \ # Run tests for the flat DT version of sandbox ./test/py/test.py --bd sandbox_flattree --build
-PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test \ +DTC_DIR=build-sandbox_spl/scripts/dtc + +PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ ./tools/binman/binman -t run_test ./tools/patman/patman --test run_test ./tools/buildman/buildman -t -PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test ./tools/dtoc/dtoc -t +PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
# This needs you to set up Python test coverage tools. # To enable Python test coverage on Debian-type distributions (e.g. Ubuntu): # $ sudo apt-get install python-pip python-pytest # $ sudo pip install coverage -PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test \ +PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ ./tools/binman/binman -T
if [ $result == 0 ]; then

On 24 December 2017 at 11:12, Simon Glass sjg@chromium.org wrote:
Set this to our own device-tree compiler since we know it is new enough to run the tests.
Signed-off-by: Simon Glass sjg@chromium.org
test/run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Applied to u-boot-dm (and now in mainline). Sorry for the delay.
participants (1)
-
Simon Glass