aboutsummaryrefslogtreecommitdiff
path: root/include/dm/fdtaddr.h
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas2018-12-03 19:37:09 +0100
committerSimon Glass2018-12-05 06:06:44 -0700
commit7959882049a9b389c131eff9a128437ee8ebe08e (patch)
treea0b31f0e5dbf3d95ae731918a675c075614db3be /include/dm/fdtaddr.h
parentbb48470df21c0ce4ebed47f5dc3ea25ff02fd4dd (diff)
dm: core: add functions to get/remap I/O addresses by name
This functions allow us to get and remap I/O addresses by name, which is useful when there are multiple reg addresses indexed by reg-names property. This is needed in bmips dma/eth patch series, but can also be used on many other drivers. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/fdtaddr.h')
-rw-r--r--include/dm/fdtaddr.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h
index 49a6ffd5f83..c171d9bc2f4 100644
--- a/include/dm/fdtaddr.h
+++ b/include/dm/fdtaddr.h
@@ -56,6 +56,19 @@ void *devfdt_remap_addr(struct udevice *dev);
void *devfdt_remap_addr_index(struct udevice *dev, int index);
/**
+ * devfdt_remap_addr_name() - Get the reg property of a device, indexed by
+ * name, as a memory-mapped I/O pointer
+ * @name: the 'reg' property can hold a list of <addr, size> pairs, with the
+ * 'reg-names' property providing named-based identification. @index
+ * indicates the value to search for in 'reg-names'.
+ *
+ * @dev: Pointer to a device
+ *
+ * @return Pointer to addr, or NULL if there is no such property
+ */
+void *devfdt_remap_addr_name(struct udevice *dev, const char *name);
+
+/**
* devfdt_map_physmem() - Read device address from reg property of the
* device node and map the address into CPU address
* space.