aboutsummaryrefslogtreecommitdiff
path: root/tests/references.dts
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2019-03-26 16:33:02 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2019-03-29 13:31:16 +1100
commit730875016a6a94bd43e4e88b34a73a814e1051e7 (patch)
treed786799f8a7e687e17117f476d8cf310d687ed22 /tests/references.dts
parent7dfb61ba96b130ab12afa24c7d15f4706ecbb619 (diff)
downloaddtc-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.dts5
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>;
+ };
};