linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY
Date: Wed, 5 Oct 2011 15:06:19 -0700	[thread overview]
Message-ID: <20111005220619.GC6324@atomide.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1110042059110.9106@xanadu.home>

* Nicolas Pitre <nico@fluxnic.net> [111004 17:26]:
> On Tue, 4 Oct 2011, Tony Lindgren wrote:
> 
> > This allows mapping external memory such as SRAM for use.
> > 
> > This is needed for some small chunks of code, such as reprogramming
> > SDRAM memory source clocks that can't be executed in SDRAM. Other
> > use cases include some PM related code.
> > 
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> 
> As mentioned, you might consider dropping the export until needed.

Here's this one updated to drop the export.

Tony


From: Tony Lindgren <tony@atomide.com>
Date: Tue, 4 Oct 2011 18:26:27 -0700
Subject: [PATCH] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY

This allows mapping external memory such as SRAM for use.

This is needed for some small chunks of code, such as reprogramming
SDRAM memory source clocks that can't be executed in SDRAM. Other
use cases include some PM related code.

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index d66605d..4ff152e 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -80,6 +80,7 @@ extern void __iomem *__arm_ioremap_caller(unsigned long, size_t, unsigned int,
 
 extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
 extern void __iomem *__arm_ioremap(unsigned long, size_t, unsigned int);
+extern void __iomem *__arm_ioremap_exec(unsigned long, size_t, int cached);
 extern void __iounmap(volatile void __iomem *addr);
 
 /*
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ab50627..a2d94ac 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -289,6 +289,27 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
 }
 EXPORT_SYMBOL(__arm_ioremap);
 
+/*
+ * Remap an arbitrary physical address space into the kernel virtual
+ * address space as memory. Needed when the kernel wants to execute
+ * code in external memory. This is needed for reprogramming source
+ * clocks that would affect normal memory for example. Please see
+ * CONFIG_GENERIC_ALLOCATOR for allocating external memory.
+ */
+void __iomem *
+__arm_ioremap_exec(unsigned long phys_addr, size_t size, int cached)
+{
+	unsigned int mtype;
+
+	if (cached)
+		mtype = MT_MEMORY;
+	else
+		mtype = MT_MEMORY_NONCACHED;
+
+	return __arm_ioremap_caller(phys_addr, size, mtype,
+			__builtin_return_address(0));
+}
+
 void __iounmap(volatile void __iomem *io_addr)
 {
 	void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);

  reply	other threads:[~2011-10-05 22:06 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05  0:45 [PATCH 0/4] initialize omap SRAM later on with __arm_ioremap_exec() Tony Lindgren
2011-10-05  0:45 ` [PATCH 1/4] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY Tony Lindgren
2011-10-05  1:00   ` Nicolas Pitre
2011-10-05 22:06     ` Tony Lindgren [this message]
2011-10-05 22:08       ` [PATCH 1.5/4] ARM: OMAP1: Use generic map_io, init_early and init_irq Tony Lindgren
2011-10-07  6:40       ` [PATCH 1/4] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY Santosh Shilimkar
2011-10-07 14:43         ` Tony Lindgren
2011-10-07 15:03           ` Santosh Shilimkar
2011-10-07 15:11             ` Tony Lindgren
2011-10-07 17:39               ` Santosh Shilimkar
2011-10-07 18:16                 ` Tony Lindgren
2011-10-07 18:20                   ` Santosh Shilimkar
2011-10-07 18:27                     ` Tony Lindgren
2011-10-05  0:45 ` [PATCH 2/4] ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done Tony Lindgren
2011-10-07  6:47   ` Santosh Shilimkar
2011-10-05  0:45 ` [PATCH 3/4] ARM: OMAP: Remove calls to SRAM allocations for framebuffer Tony Lindgren
2011-10-05  6:45   ` Tomi Valkeinen
2011-10-05 22:41     ` Tony Lindgren
2011-10-06  8:38       ` Tomi Valkeinen
2011-10-06 16:22         ` Tony Lindgren
2011-10-05  0:45 ` [PATCH 4/4] ARM: OMAP: Map SRAM later on with ioremap_exec() Tony Lindgren
2011-10-05  1:07   ` Nicolas Pitre
2011-10-05 22:13     ` Tony Lindgren
2011-10-05 23:01       ` Nicolas Pitre
2011-10-07  6:52       ` Santosh Shilimkar
2011-10-07 14:55         ` Tony Lindgren
2011-10-05  1:40 ` [PATCH 5/4] ARM: OMAP: Move set_globals initialization to happen in init_early Tony Lindgren
2011-10-05  1:51   ` Nicolas Pitre
2011-10-06  1:36     ` Tony Lindgren
2011-10-07  6:56       ` Santosh Shilimkar
2011-10-07 14:54         ` Tony Lindgren
2011-10-07 23:26           ` Nicolas Pitre
2011-10-05  7:03 ` [PATCH 0/4] initialize omap SRAM later on with __arm_ioremap_exec() Santosh Shilimkar
2011-10-06  1:42   ` Tony Lindgren
2011-10-07  6:59     ` Santosh Shilimkar
2011-10-07 14:45       ` Tony Lindgren
2011-10-07 20:23       ` Nicolas Pitre

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=20111005220619.GC6324@atomide.com \
    --to=tony@atomide.com \
    --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).