diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2009-11-26 15:37:13 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@jdl.com> | 2009-11-26 15:06:17 -0600 |
commit | d75b33af676d0beac8398651a7f09037555a550b (patch) | |
tree | 94337c43fe3dd4e70c487833cc3ecbb370baaadc /tests/trees.S | |
parent | 0ef21055ee414697aac7226c171d921214ef3981 (diff) | |
download | dtc-d75b33af676d0beac8398651a7f09037555a550b.zip dtc-d75b33af676d0beac8398651a7f09037555a550b.tar.gz dtc-d75b33af676d0beac8398651a7f09037555a550b.tar.bz2 |
Support ePAPR compliant phandle properties
Currently, the Linux kernel, libfdt and dtc, when using flattened
device trees encode a node's phandle into a property named
"linux,phandle". The ePAPR specification, however - aiming as it is
to not be a Linux specific spec - requires that phandles be encoded in
a property named simply "phandle".
This patch adds support for this newer approach to dtc and libfdt.
Specifically:
- fdt_get_phandle() will now return the correct phandle if it
is supplied in either of these properties
- fdt_node_offset_by_phandle() will correctly find a node with
the given phandle encoded in either property.
- By default, when auto-generating phandles, dtc will encode
it into both properties for maximum compatibility. A new -H
option allows either only old-style or only new-style
properties to be generated.
- If phandle properties are explicitly supplied in the dts
file, dtc will not auto-generate ones in the alternate format.
- If both properties are supplied, dtc will check that they
have the same value.
- Some existing testcases are updated to use a mix of old and
new-style phandles, partially testing the changes.
- A new phandle_format test further tests the libfdt support,
and the -H option.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/trees.S')
-rw-r--r-- | tests/trees.S | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/trees.S b/tests/trees.S index 609cdd6..66adf3f 100644 --- a/tests/trees.S +++ b/tests/trees.S @@ -103,7 +103,7 @@ test_tree1_struct: END_NODE BEGIN_NODE("subnode@2") - PROP_INT(test_tree1, phandle, PHANDLE_1) + PROP_INT(test_tree1, linux_phandle, PHANDLE_1) PROP_INT(test_tree1, prop_int, TEST_VALUE_2) BEGIN_NODE("subsubnode@0") @@ -125,7 +125,8 @@ test_tree1_strings: STRING(test_tree1, compatible, "compatible") STRING(test_tree1, prop_int, "prop-int") STRING(test_tree1, prop_str, "prop-str") - STRING(test_tree1, phandle, "linux,phandle") + STRING(test_tree1, linux_phandle, "linux,phandle") + STRING(test_tree1, phandle, "phandle") test_tree1_strings_end: test_tree1_end: |