From: David Brown <davidb@codeaurora.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: David Brown <davidb@codeaurora.org>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org,
David Miller <davem@davemloft.net>
Subject: [PATCH v2] of/address: Add of_iomap_nocache
Date: Thu, 4 Aug 2011 03:36:36 -0700 [thread overview]
Message-ID: <1312454196-31028-1-git-send-email-davidb@codeaurora.org> (raw)
In-Reply-To: <1312451629-28036-1-git-send-email-davidb@codeaurora.org>
Add uncached mappings from devicetree nodes similar to regular io
mappings.
SPARC is coherent, so there this call is the same as regular of_iomap.
Cc: David Miller <davem@davemloft.net>
Signed-off-by: David Brown <davidb@codeaurora.org>
---
v2 - Add implementation for SPARC
drivers/of/address.c | 19 +++++++++++++++++++
include/linux/of_address.h | 10 ++++++++++
2 files changed, 29 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..0e4734b 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -13,6 +13,16 @@ extern struct device_node *of_find_matching_node_by_address(
u64 base_address);
extern void __iomem *of_iomap(struct device_node *device, int index);
+#ifndef SPARC
+extern void __iomem *of_iomap_nocache(struct device_node *device, int index);
+#else
+static inline void __iomem *of_iomap_nocache(struct device_node *device,
+ int index)
+{
+ return of_iomap(device, index);
+}
+#endif
+
/* Extract an address from a device, returns the region size and
* the address space flags too. The PCI version uses a BAR number
* instead of an absolute index
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2011-08-04 10:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` David Brown [this message]
[not found] ` <1312454196-31028-1-git-send-email-davidb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-08-04 11:51 ` [PATCH v2] " David Miller
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:56 ` Scott Wood
2011-08-04 16:58 ` Grant Likely
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=1312454196-31028-1-git-send-email-davidb@codeaurora.org \
--to=davidb@codeaurora.org \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.