diff options
author | Thierry Reding <treding@nvidia.com> | 2019-03-26 16:33:02 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-03-29 13:31:16 +1100 |
commit | 730875016a6a94bd43e4e88b34a73a814e1051e7 (patch) | |
tree | d786799f8a7e687e17117f476d8cf310d687ed22 /tests/references.dts | |
parent | 7dfb61ba96b130ab12afa24c7d15f4706ecbb619 (diff) | |
download | dtc-730875016a6a94bd43e4e88b34a73a814e1051e7.zip dtc-730875016a6a94bd43e4e88b34a73a814e1051e7.tar.gz dtc-730875016a6a94bd43e4e88b34a73a814e1051e7.tar.bz2 |
libfdt: Add phandle generation helper
The new fdt_generate_phandle() function can be used to generate a new,
unused phandle given a specific device tree blob. The implementation is
somewhat naive in that it simply walks the entire device tree to find
the highest phandle value and then returns a phandle value one higher
than that. A more clever implementation might try to find holes in the
current set of phandle values and fill them. But this implementation is
relatively simple and works reliably.
Also add a test that validates that phandles generated by this new API
are indeed unique.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Message-Id: <20190326153302.17109-3-thierry.reding@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/references.dts')
-rw-r--r-- | tests/references.dts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/references.dts b/tests/references.dts index f783e8b..b390639 100644 --- a/tests/references.dts +++ b/tests/references.dts @@ -33,4 +33,9 @@ linux,phandle = <&n5>; phandle = <&n5>; }; + + node6 { + linux,phandle = <0xfffffffe>; + phandle = <0xfffffffe>; + }; }; |