From: Vignesh R <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 01/12] dm: core: implement dev_map_phsymem()
Date: Mon, 25 Apr 2016 16:29:55 +0530 [thread overview]
Message-ID: <1461582006-2065-2-git-send-email-vigneshr@ti.com> (raw)
In-Reply-To: <1461582006-2065-1-git-send-email-vigneshr@ti.com>
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>
---
v2: New patch
drivers/core/device.c | 5 +++++
include/dm/device.h | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 269087a084cf..61af70efcef7 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -673,6 +673,11 @@ fdt_addr_t dev_get_addr(struct udevice *dev)
return dev_get_addr_index(dev, 0);
}
+void *dev_map_physmem(struct udevice *dev, unsigned long size)
+{
+ return map_physmem(dev_get_addr(dev), size, MAP_NOCACHE);
+}
+
bool device_has_children(struct udevice *dev)
{
return !list_empty(&dev->child_head);
diff --git a/include/dm/device.h b/include/dm/device.h
index dad7591dfacb..0d3e3ed34870 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -454,6 +454,16 @@ int device_find_next_child(struct udevice **devp);
fdt_addr_t dev_get_addr(struct udevice *dev);
/**
+ * dev_map_physmem() - Map bus memory into CPU space
+ *
+ * @dev: Pointer to device
+ * @size: size of the memory to map
+ *
+ * @return addr
+ */
+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
--
2.8.1
next prev parent reply other threads:[~2016-04-25 10:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 10:59 [U-Boot] [PATCH v2 00/12] ARM: Keystone2: Convert davinci_spi to DM Vignesh R
2016-04-25 10:59 ` Vignesh R [this message]
2016-04-25 10:59 ` [U-Boot] [PATCH v2 02/12] spi: davinci_spi: Convert to driver to adapt " Vignesh R
2016-04-25 10:59 ` [U-Boot] [PATCH v2 03/12] keystone2: spi: do not define DM_SPI and DM_SPI_FLASH for SPL build Vignesh R
2016-04-25 10:59 ` [U-Boot] [PATCH v2 04/12] ARM: dts: keystone2: add SPI aliases for davinci SPI nodes Vignesh R
2016-04-25 10:59 ` [U-Boot] [PATCH v2 05/12] ARM: dts: k2hk: Enable Davinci SPI controller Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 06/12] defconfig: k2hk_evm_defconfig: enable SPI driver model Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 07/12] ARM: dts: k2e: Enable Davinci SPI controller Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 08/12] defconfig: k2e_evm_defconfig: enable SPI driver model Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 09/12] ARM: dts: k2l: Enable Davinci SPI controller Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 10/12] defconfig: k2l_evm_defconfig: enable SPI driver model Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 11/12] ARM: dts: k2g: add support for Davinci SPI controller Vignesh R
2016-04-25 11:00 ` [U-Boot] [PATCH v2 12/12] defconfig: k2g_evm_defconfig: enable SPI driver model Vignesh R
2016-05-04 11:22 ` [U-Boot] [PATCH v2 00/12] ARM: Keystone2: Convert davinci_spi to DM Vignesh R
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461582006-2065-2-git-send-email-vigneshr@ti.com \
--to=vigneshr@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox