From fb9bec8e8a7378d921478d5fbcc941e0fa80c01e Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 12 Sep 2021 11:15:12 +0800 Subject: 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 pair in the 'reg' property. Add a new API devfdt_get_addr_index_ptr() to return the indexed pointer. Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- include/dm/fdtaddr.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h index a4fda581a77..d2c19942916 100644 --- a/include/dm/fdtaddr.h +++ b/include/dm/fdtaddr.h @@ -92,6 +92,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 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 * -- cgit v1.2.3