diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-15 13:32:18 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-15 13:32:18 +0000 |
commit | ea40403e1c493848ed30a433550b564191be46bd (patch) | |
tree | f15c5441a81a9c9baa66861cccd277777bf6cc48 /xen/include/xen/device_tree.h | |
parent | 92b31a9099c3ba4ce7910e5a2ee5f36dbb8b336e (diff) | |
download | xen-ea40403e1c493848ed30a433550b564191be46bd.tar.gz xen-ea40403e1c493848ed30a433550b564191be46bd.tar.bz2 xen-ea40403e1c493848ed30a433550b564191be46bd.zip |
xen/device_tree: introduce find_compatible_node
Introduce a find_compatible_node function that can be used by device
drivers to find the node corresponding to their device in the device
tree.
Initialize device_tree_flattened early in start_xen, so that it is
available before setup_mm. Get rid of fdt in the process.
Also add device_tree_node_compatible to device_tree.h, that is currently
missing.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc - s/atag_paddr/fdt_paddr ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/include/xen/device_tree.h')
-rw-r--r-- | xen/include/xen/device_tree.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 52ef258584..1d04e4f011 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -68,6 +68,9 @@ void device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells, u64 start, u64 size); u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name); bool_t device_tree_node_matches(const void *fdt, int node, const char *match); +bool_t device_tree_node_compatible(const void *fdt, int node, const char *match); +int find_compatible_node(const char *compatible, int *node, int *depth, + u32 *address_cells, u32 *size_cells); int device_tree_for_each_node(const void *fdt, device_tree_node_func func, void *data); const char *device_tree_bootargs(const void *fdt); |