From: thomas.abraham@linaro.org (Thomas Abraham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: Exynos4: Add ioremap interceptor for statically remapped regions
Date: Mon, 10 Oct 2011 13:41:28 +0530 [thread overview]
Message-ID: <1318234289-22041-3-git-send-email-thomas.abraham@linaro.org> (raw)
In-Reply-To: <1318234289-22041-1-git-send-email-thomas.abraham@linaro.org>
ioremap() request for statically remapped regions are intercepted and the
statically assigned virtual address is returned. For requests for which
there are no statically remapped regions, the requests are let through.
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
arch/arm/mach-exynos4/cpu.c | 16 ++++++++++++++++
arch/arm/mach-exynos4/include/mach/io.h | 4 ++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 5b1765b..358624d 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -137,6 +137,22 @@ static struct map_desc exynos4_iodesc1[] __initdata = {
},
};
+/*
+ * For all ioremap requests of statically mapped regions, intercept ioremap and
+ * return virtual address from the iodesc table.
+ */
+void __iomem *exynos4_ioremap(unsigned long phy, size_t size, unsigned int type)
+{
+ struct map_desc *desc = exynos4_iodesc;
+ unsigned int idx;
+
+ for (idx = 0; idx < ARRAY_SIZE(exynos4_iodesc); idx++, desc++)
+ if (desc->pfn == __phys_to_pfn(phy) && desc->type == type)
+ return (void __iomem *)desc->virtual;
+
+ return __arm_ioremap(phy, size, type);
+}
+
static void exynos4_idle(void)
{
if (!need_resched())
diff --git a/arch/arm/mach-exynos4/include/mach/io.h b/arch/arm/mach-exynos4/include/mach/io.h
index d5478d2..33c2890 100644
--- a/arch/arm/mach-exynos4/include/mach/io.h
+++ b/arch/arm/mach-exynos4/include/mach/io.h
@@ -22,5 +22,10 @@
#define __mem_pci(a) (a)
#define IO_SPACE_LIMIT (0xFFFFFFFF)
+#define __arch_ioremap exynos4_ioremap
+#define __arch_iounmap __iounmap
+
+void __iomem *exynos4_ioremap(unsigned long phy, size_t size,
+ unsigned int type);
#endif /* __ASM_ARM_ARCH_IO_H */
--
1.6.6.rc2
next prev parent reply other threads:[~2011-10-10 8:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 8:11 [PATCH 0/3] ARM: Samsung: Add device tree support for GIC and Interrupt Combiner Thomas Abraham
2011-10-10 8:11 ` [PATCH 1/3] ARM: Samsung: Move timer irq numbers to end of linux irq space Thomas Abraham
2011-10-12 16:10 ` Rob Herring
2011-10-12 16:29 ` Thomas Abraham
2011-10-13 0:41 ` Grant Likely
2011-10-18 8:10 ` Changhwan Youn
2011-10-21 9:56 ` Kukjin Kim
2011-10-21 19:45 ` Grant Likely
2011-10-24 8:09 ` Kukjin Kim
2011-10-21 16:54 ` Thomas Abraham
2011-10-10 8:11 ` Thomas Abraham [this message]
2011-10-12 16:13 ` [PATCH 2/3] ARM: Exynos4: Add ioremap interceptor for statically remapped regions Rob Herring
2011-10-12 16:30 ` Thomas Abraham
2011-10-13 3:28 ` Thomas Abraham
2011-10-13 3:29 ` Grant Likely
2011-10-13 18:52 ` Nicolas Pitre
2011-10-10 8:11 ` [PATCH 3/3] ARM: Exynos4: Add support for dt irq specifier to linux virq conversion Thomas Abraham
2011-10-13 0:54 ` 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=1318234289-22041-3-git-send-email-thomas.abraham@linaro.org \
--to=thomas.abraham@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 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).