aboutsummaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorVignesh R2016-07-06 09:58:55 +0530
committerJagan Teki2016-07-09 20:16:08 +0530
commit7c616862553e37c89ea5db399961018a7367ca33 (patch)
tree9a1a71c35a2e8abc20d882fd0b6358140f32bb2a /include/dm
parentc8864d720926c6b136aa9aa97fd1d4410250d271 (diff)
dm: core: implement dev_map_physmem()
This API helps to map physical register addresss pace of device to virtual address space easily. Its just a wrapper around map_physmem() with MAP_NOCACHE flag. Signed-off-by: Vignesh R <vigneshr@ti.com> Suggested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index f03bcd3b49e..1bfcf3bcbc0 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -467,6 +467,19 @@ fdt_addr_t dev_get_addr(struct udevice *dev);
void *dev_get_addr_ptr(struct udevice *dev);
/**
+ * dev_map_physmem() - Read device address from reg property of the
+ * device node and map the address into CPU address
+ * space.
+ *
+ * @dev: Pointer to device
+ * @size: size of the memory to map
+ *
+ * @return mapped address, or NULL if the device does not have reg
+ * property.
+ */
+void *dev_map_physmem(struct udevice *dev, unsigned long size);
+
+/**
* dev_get_addr_index() - Get the indexed reg property of a device
*
* @dev: Pointer to a device