diff options
author | Tom Rini | 2020-04-28 09:52:01 -0400 |
---|---|---|
committer | Tom Rini | 2020-04-28 09:52:01 -0400 |
commit | 545c747447706d9601cc5c65a85ec44e688bfe08 (patch) | |
tree | 398a874161673df9656e271a6dbb4b127a45f725 /tools/dtoc | |
parent | 08977f873f4034307796173784fc17a11188a0cb (diff) | |
parent | c1f39edc62adc81775e750957aa557bcf994e607 (diff) |
Merge tag 'dm-pull-27apr20' of git://git.denx.de/u-boot-dm
Move Python tools to use absolute paths
Minor buildman fixes for new features
Make libfdt code more similar to upsteam
Diffstat (limited to 'tools/dtoc')
-rw-r--r-- | tools/dtoc/dtb_platdata.py | 6 | ||||
l--------- | tools/dtoc/dtoc | 2 | ||||
-rw-r--r-- | tools/dtoc/fdt.py | 4 | ||||
-rw-r--r-- | tools/dtoc/fdt_util.py | 4 | ||||
-rwxr-xr-x | tools/dtoc/main.py (renamed from tools/dtoc/dtoc.py) | 10 | ||||
-rwxr-xr-x | tools/dtoc/test_dtoc.py | 12 | ||||
-rwxr-xr-x | tools/dtoc/test_fdt.py | 17 |
7 files changed, 24 insertions, 31 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 90a9e1a6269..ecfe0624d10 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -15,9 +15,9 @@ import collections import copy import sys -import fdt -import fdt_util -import tools +from dtoc import fdt +from dtoc import fdt_util +from patman import tools # When we see these properties we ignore them - i.e. do not create a structure member PROP_IGNORE_LIST = [ diff --git a/tools/dtoc/dtoc b/tools/dtoc/dtoc index 896ca44e62f..11a5d8e18ab 120000 --- a/tools/dtoc/dtoc +++ b/tools/dtoc/dtoc @@ -1 +1 @@ -dtoc.py
\ No newline at end of file +main.py
\ No newline at end of file diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 1b7b730359a..188490b728f 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -8,10 +8,10 @@ import struct import sys -import fdt_util +from dtoc import fdt_util import libfdt from libfdt import QUIET_NOTFOUND -import tools +from patman import tools # This deals with a device tree, presenting it as an assortment of Node and # Prop objects, representing nodes and properties, respectively. This file diff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py index b105faec749..b0407937723 100644 --- a/tools/dtoc/fdt_util.py +++ b/tools/dtoc/fdt_util.py @@ -13,8 +13,8 @@ import struct import sys import tempfile -import command -import tools +from patman import command +from patman import tools def fdt32_to_cpu(val): """Convert a device tree cell to an integer diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/main.py index f31cba900e5..b94d9c301f4 100755 --- a/tools/dtoc/dtoc.py +++ b/tools/dtoc/main.py @@ -25,8 +25,6 @@ options. For more information about the use of this options and tool please see doc/driver-model/of-plat.rst """ -from __future__ import print_function - from optparse import OptionParser import os import sys @@ -34,15 +32,15 @@ import unittest # Bring in the patman libraries our_path = os.path.dirname(os.path.realpath(__file__)) -sys.path.append(os.path.join(our_path, '../patman')) +sys.path.append(os.path.join(our_path, '..')) # Bring in the libfdt module sys.path.insert(0, 'scripts/dtc/pylibfdt') sys.path.insert(0, os.path.join(our_path, '../../build-sandbox_spl/scripts/dtc/pylibfdt')) -import dtb_platdata -import test_util +from dtoc import dtb_platdata +from patman import test_util def run_tests(args): """Run all the test we have for dtoc @@ -79,7 +77,7 @@ def run_tests(args): def RunTestCoverage(): """Run the tests and check that we get 100% coverage""" sys.argv = [sys.argv[0]] - test_util.RunTestCoverage('tools/dtoc/dtoc.py', '/dtoc.py', + test_util.RunTestCoverage('tools/dtoc/dtoc', '/main.py', ['tools/patman/*.py', '*/fdt*', '*test*'], options.build_dir) diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index d733b706558..8498e8303c2 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -9,22 +9,20 @@ This includes unit tests for some functions and functional tests for the dtoc tool. """ -from __future__ import print_function - import collections import os import struct import unittest -import dtb_platdata +from dtoc import dtb_platdata from dtb_platdata import conv_name_to_c from dtb_platdata import get_compat_name from dtb_platdata import get_value from dtb_platdata import tab_to -import fdt -import fdt_util -import test_util -import tools +from dtoc import fdt +from dtoc import fdt_util +from patman import test_util +from patman import tools our_path = os.path.dirname(os.path.realpath(__file__)) diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 3316757e61e..375e906424c 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -4,8 +4,6 @@ # Written by Simon Glass <sjg@chromium.org> # -from __future__ import print_function - from optparse import OptionParser import glob import os @@ -16,17 +14,16 @@ import unittest # Bring in the patman libraries our_path = os.path.dirname(os.path.realpath(__file__)) -for dirname in ['../patman', '..']: - sys.path.insert(0, os.path.join(our_path, dirname)) +sys.path.insert(1, os.path.join(our_path, '..')) -import command -import fdt +from dtoc import fdt +from dtoc import fdt_util +from dtoc.fdt_util import fdt32_to_cpu from fdt import TYPE_BYTE, TYPE_INT, TYPE_STRING, TYPE_BOOL, BytesToValue -import fdt_util -from fdt_util import fdt32_to_cpu import libfdt -import test_util -import tools +from patman import command +from patman import test_util +from patman import tools def _GetPropertyValue(dtb, node, prop_name): """Low-level function to get the property value based on its offset |