From: Tony Lindgren <tony@atomide.com>
To: Andres Salomon <dilinger@queued.net>
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/7] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY
Date: Tue, 11 Oct 2011 16:58:27 -0700 [thread overview]
Message-ID: <20111011235827.GB2293@atomide.com> (raw)
In-Reply-To: <20111011134048.28b9b19b@queued.net>
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
* Andres Salomon <dilinger@queued.net> [111011 14:11]:
> On Fri, 07 Oct 2011 12:45:43 -0700
> Tony Lindgren <tony@atomide.com> 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.
>
>
> Acked-by: Andres Salomon <dilinger@queued.net>
>
> Looks good to me, thanks for doing this. I only have one very minor
> quibble below, which could be addressed in a later patch..
> > +void __iomem *
> > +__arm_ioremap_exec(unsigned long phys_addr, size_t size, int cached)
>
> I'd rather see this as 'bool cached', so it's clear we're talking
> about a simple boolean (rather than bits).
Sure, thanks, updated version below. Will also update the patch in
Russell's patch system.
Tony
[-- Attachment #2: ioremap-exec.patch --]
[-- Type: text/x-diff, Size: 1937 bytes --]
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 5 Oct 2011 15:14:01 -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>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- 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, bool cached);
extern void __iounmap(volatile void __iomem *addr);
/*
--- 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, bool 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);
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY
Date: Tue, 11 Oct 2011 16:58:27 -0700 [thread overview]
Message-ID: <20111011235827.GB2293@atomide.com> (raw)
In-Reply-To: <20111011134048.28b9b19b@queued.net>
* Andres Salomon <dilinger@queued.net> [111011 14:11]:
> On Fri, 07 Oct 2011 12:45:43 -0700
> Tony Lindgren <tony@atomide.com> 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.
>
>
> Acked-by: Andres Salomon <dilinger@queued.net>
>
> Looks good to me, thanks for doing this. I only have one very minor
> quibble below, which could be addressed in a later patch..
> > +void __iomem *
> > +__arm_ioremap_exec(unsigned long phys_addr, size_t size, int cached)
>
> I'd rather see this as 'bool cached', so it's clear we're talking
> about a simple boolean (rather than bits).
Sure, thanks, updated version below. Will also update the patch in
Russell's patch system.
Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ioremap-exec.patch
Type: text/x-diff
Size: 1937 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20111011/a970586f/attachment-0001.bin>
next prev parent reply other threads:[~2011-10-11 23:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 19:45 [PATCH 0/7] Repost of omap SRAM map_io changes Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 1/7] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:59 ` Tony Lindgren
2011-10-07 19:59 ` Tony Lindgren
2011-10-11 20:40 ` Andres Salomon
2011-10-11 20:40 ` Andres Salomon
2011-10-11 23:58 ` Tony Lindgren [this message]
2011-10-11 23:58 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 2/7] ARM: OMAP1: Use generic map_io, init_early and init_irq Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 3/7] ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 4/7] ARM: OMAP: Remove calls to SRAM allocations for framebuffer Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 5/7] ARM: OMAP: Map SRAM later on with ioremap_exec() Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 6/7] ARM: OMAP: Move set_globals initialization to happen in init_early Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 19:45 ` [PATCH 7/7] ARM: OMAP: Warn if omap_ioremap is called before SoC detection Tony Lindgren
2011-10-07 19:45 ` Tony Lindgren
2011-10-07 20:36 ` Nicolas Pitre
2011-10-07 20:36 ` 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=20111011235827.GB2293@atomide.com \
--to=tony@atomide.com \
--cc=dilinger@queued.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@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.