devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/address: Add of_iomap_nocache
@ 2011-08-04  9:53 David Brown
  2011-08-04 10:12 ` David Miller
  2011-08-04 10:36 ` [PATCH v2] " David Brown
  0 siblings, 2 replies; 12+ messages in thread
From: David Brown @ 2011-08-04  9:53 UTC (permalink / raw)
  To: Grant Likely; +Cc: David Brown, linux-kernel, linux-arm-msm, devicetree-discuss

Add uncached mappings from devicetree nodes similar to regular io
mappings.

Signed-off-by: David Brown <davidb@codeaurora.org>
---
 drivers/of/address.c       |   19 +++++++++++++++++++
 include/linux/of_address.h |    1 +
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/of/address.c b/drivers/of/address.c
index 72c33fb..9bee7f8 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -613,3 +613,22 @@ void __iomem *of_iomap(struct device_node *np, int index)
 	return ioremap(res.start, resource_size(&res));
 }
 EXPORT_SYMBOL(of_iomap);
+
+/**
+ * of_iomap_nocache - Maps the memory mapped IO for a given
+ *                    device_node, using ioremap_nocache.
+ * @device:	the device whose io range will be mapped
+ * @index:	index of the io range
+ *
+ * Returns a pointer to the mapped memory
+ */
+void __iomem *of_iomap_nocache(struct device_node *np, int index)
+{
+	struct resource res;
+
+	if (of_address_to_resource(np, index, &res))
+		return NULL;
+
+	return ioremap_nocache(res.start, 1 + res.end - res.start);
+}
+EXPORT_SYMBOL(of_iomap_nocache);
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 3118623..3ce1277 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -12,6 +12,7 @@ extern struct device_node *of_find_matching_node_by_address(
 					const struct of_device_id *matches,
 					u64 base_address);
 extern void __iomem *of_iomap(struct device_node *device, int index);
+extern void __iomem *of_iomap_nocache(struct device_node *device, int index);
 
 /* Extract an address from a device, returns the region size and
  * the address space flags too. The PCI version uses a BAR number
-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-08-04 23:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04  9:53 [PATCH] of/address: Add of_iomap_nocache David Brown
2011-08-04 10:12 ` David Miller
2011-08-04 15:52   ` Rob Herring
2011-08-04 16:17     ` David Brown
2011-08-04 23:08     ` David Miller
2011-08-04 10:36 ` [PATCH v2] " David Brown
     [not found]   ` <1312454196-31028-1-git-send-email-davidb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-08-04 11:51     ` David Miller
2011-08-04 12:53       ` Grant Likely
2011-08-04 12:44   ` Kumar Gala
2011-08-04 13:10     ` David Brown
2011-08-04 16:56   ` Scott Wood
2011-08-04 16:58     ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).