aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2021-09-12 11:15:12 +0800
committerLeo Yu-Chi Liang <ycliang@andestech.com>2021-10-20 10:59:09 +0800
commitfb9bec8e8a7378d921478d5fbcc941e0fa80c01e (patch)
tree5876e80d9ab8107d72821e93e57df8d7495310ac /include
parent7e22c85918e68e6df50d01d08585f88fbbaf3456 (diff)
downloadu-boot-fb9bec8e8a7378d921478d5fbcc941e0fa80c01e.zip
u-boot-fb9bec8e8a7378d921478d5fbcc941e0fa80c01e.tar.gz
u-boot-fb9bec8e8a7378d921478d5fbcc941e0fa80c01e.tar.bz2
dm: core: Add a new API devfdt_get_addr_index_ptr()
At present there is only devfdt_get_addr_ptr() which only returns the first <addr, size> pair in the 'reg' property. Add a new API devfdt_get_addr_index_ptr() to return the indexed pointer. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Diffstat (limited to 'include')
-rw-r--r--include/dm/fdtaddr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h
index a4fda58..d2c1994 100644
--- a/include/dm/fdtaddr.h
+++ b/include/dm/fdtaddr.h
@@ -93,6 +93,18 @@ void *devfdt_map_physmem(const struct udevice *dev, unsigned long size);
fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index);
/**
+ * devfdt_get_addr_index_ptr() - Return indexed pointer to the address of the
+ * reg property of a device
+ *
+ * @dev: Pointer to a device
+ * @index: the 'reg' property can hold a list of <addr, size> pairs
+ * and @index is used to select which one is required
+ *
+ * @return Pointer to addr, or NULL if there is no such property
+ */
+void *devfdt_get_addr_index_ptr(const struct udevice *dev, int index);
+
+/**
* devfdt_get_addr_size_index() - Get the indexed reg property of a device
*
* Returns the address and size specified in the 'reg' property of a device.