diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-04-26 17:28:21 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-05-13 11:59:57 +0100 |
commit | 227c02f8a627734761da130327d42b4c55aec1f4 (patch) | |
tree | bd4a746fbc170fe909ede5267305c0579510de50 /xen/include/xen/device_tree.h | |
parent | dbd1243248298014f47f88ad43f592133f4fc82f (diff) | |
download | xen-227c02f8a627734761da130327d42b4c55aec1f4.tar.gz xen-227c02f8a627734761da130327d42b4c55aec1f4.tar.bz2 xen-227c02f8a627734761da130327d42b4c55aec1f4.zip |
xen/arm: Add helpers to retrieve an address from the device tree
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-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 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 7a6adc7c4b..cc3a070e10 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -272,6 +272,28 @@ struct dt_device_node *dt_find_node_by_path(const char *path); const struct dt_device_node *dt_get_parent(const struct dt_device_node *node); /** + * dt_device_get_address - Resolve an address for a device + * @device: the device whose address is to be resolved + * @index: index of the address to resolve + * @addr: address filled by this function + * @size: size filled by this function + * + * This function resolves an address, walking the tree, for a give + * device-tree node. It returns 0 on success. + */ +int dt_device_get_address(const struct dt_device_node *dev, int index, + u64 *addr, u64 *size); + +/** + * dt_number_of_address - Get the number of addresses for a device + * @device: the device whose number of address is to be retrieved + * + * Return the number of address for this device or 0 if there is no + * address or an error occurred. + */ +unsigned int dt_number_of_address(const struct dt_device_node *device); + +/** * dt_n_size_cells - Helper to retrieve the number of cell for the size * @np: node to get the value * |