summaryrefslogtreecommitdiff
path: root/include/dm/read.h
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2018-04-29 21:56:54 +0200
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2018-06-01 15:56:02 +0200
commit30a90f56c3a20da0456e09e6e665b648719b8935 (patch)
treecb89e7bcd28929b59dc90cb5cced979d9b19b090 /include/dm/read.h
parentc3c863880479edeb5b08226e622d13c91326e4a7 (diff)
dm: core: add functions to get memory-mapped I/O addresses
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/read.h')
-rw-r--r--include/dm/read.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/dm/read.h b/include/dm/read.h
index 4a725bc923..a27b8554fb 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -113,6 +113,18 @@ int dev_read_size(struct udevice *dev, const char *propname);
fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);
/**
+ * dev_remap_addr_index() - Get the indexed reg property of a device
+ * as a memory-mapped I/O pointer
+ *
+ * @dev: Device to read from
+ * @index: the 'reg' property can hold a list of <addr, size> pairs
+ * and @index is used to select which one is required
+ *
+ * @return pointer or NULL if not found
+ */
+void *dev_remap_addr_index(struct udevice *dev, int index);
+
+/**
* dev_read_addr() - Get the reg property of a device
*
* @dev: Device to read from
@@ -132,6 +144,16 @@ fdt_addr_t dev_read_addr(struct udevice *dev);
void *dev_read_addr_ptr(struct udevice *dev);
/**
+ * dev_remap_addr() - Get the reg property of a device as a
+ * memory-mapped I/O pointer
+ *
+ * @dev: Device to read from
+ *
+ * @return pointer or NULL if not found
+ */
+void *dev_remap_addr(struct udevice *dev);
+
+/**
* dev_read_addr_size() - get address and size from a device property
*
* This does no address translation. It simply reads an property that contains
@@ -482,6 +504,16 @@ static inline void *dev_read_addr_ptr(struct udevice *dev)
return devfdt_get_addr_ptr(dev);
}
+static inline void *dev_remap_addr(struct udevice *dev)
+{
+ return devfdt_remap_addr(dev);
+}
+
+static inline void *dev_remap_addr_index(struct udevice *dev, int index)
+{
+ return devfdt_remap_addr_index(dev, index);
+}
+
static inline fdt_addr_t dev_read_addr_size(struct udevice *dev,
const char *propname,
fdt_size_t *sizep)