diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-12 02:10:18 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-01-19 00:55:41 +0300 |
commit | 8f5afe21aed8b8ed4d75678a4e8972e7d8a23a6b (patch) | |
tree | a28c83d09df5ad37e1cbcddb65daa21dbada467c /tools/dtoc/test_fdt.py | |
parent | c1157860c5e9ca45e41859e013ed83919e7397f0 (diff) | |
download | u-boot-8f5afe21aed8b8ed4d75678a4e8972e7d8a23a6b.tar.xz |
dtoc: Add a way to read a phandle with params
Add a function to read a phandle and associated name and offset. This is
useful for binman.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/test_fdt.py')
-rwxr-xr-x | tools/dtoc/test_fdt.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index a3e36ea363..3b8ee00d4e 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -795,6 +795,17 @@ class TestFdtUtil(unittest.TestCase): finally: tools.outdir= old_outdir + def test_get_phandle_name_offset(self): + val = fdt_util.GetPhandleNameOffset(self.node, 'missing') + self.assertIsNone(val) + + dtb = fdt.FdtScan(find_dtb_file('dtoc_test_phandle.dts')) + node = dtb.GetNode('/phandle-source') + node, name, offset = fdt_util.GetPhandleNameOffset(node, + 'phandle-name-offset') + self.assertEqual('phandle3-target', node.name) + self.assertEqual('fred', name) + self.assertEqual(123, offset) def run_test_coverage(build_dir): """Run the tests and check that we get 100% coverage |