mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-08 12:45:29 -05:00
dtc: Handle linux,phandle properties which self-reference
Currently, dtc will generate phandles for nodes which are referenced
elsewhere in the tree. phandles can also be explicitly assigned by
defining the linux,phandle property. However, there is no way,
currently to tell dtc to generate a phandle for a node if it is not
referenced elsewhere. This is inconvenient when it's expected that
later processing on the flat tree might add nodes which _will_
the node in question.
One way one might attempt to do this is with the construct:
mynode: mynode {
linux,phandle = <&mynode>;
/* ... */
};
Though it's a trifle odd, there's really only one sensible meaning
which can be assigned to this construct: allocate a unique phandle to
"mynode" and put that in its linux,phandle property (as always).
Currently, however, dtc will choke on this self-reference. This patch
corrects this, making the construct above give the expected results.
It also ensures a more meaningful error message is given if you
attempt to process the nonsensical construct:
mynode: mynode {
linux,phandle = <&someothernode>;
/* ... */
};
The 'references' testcase is extended to cover this case, as well.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
2f766233c2
commit
9878f30f31
6 changed files with 52 additions and 9 deletions
|
|
@ -229,7 +229,8 @@ dtc_tests () {
|
|||
run_test dtbs_equal_ordered boot_cpuid_preserved_test_tree1.test.dtb boot_cpuid_test_tree1.test.dtb
|
||||
|
||||
# Check -Odts mode preserve all dtb information
|
||||
for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb ; do
|
||||
for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb \
|
||||
dtc_references.test.dtb; do
|
||||
run_dtc_test -I dtb -O dts -o odts_$tree.test.dts $tree
|
||||
run_dtc_test -I dts -O dtb -o odts_$tree.test.dtb odts_$tree.test.dts
|
||||
run_test dtbs_equal_ordered $tree odts_$tree.test.dtb
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue