* [PATCH v2] ARM: map ATAGs when not in first 1MB of RAM
@ 2011-01-28 14:00 Rob Herring
2011-01-28 14:10 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2011-01-28 14:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@calxeda.com>
If ATAGs or DTB pointer is not within first 1MB of RAM, then the boot params
will not be mapped early enough, so map the 1MB region that r2 points to. Only
map the first 1MB when r2 is 0.
Some assembly improvements from Nicolas Pitre.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
Applies to Russell's p2v branch
arch/arm/kernel/head.S | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 17a97b5..d4efa71 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -206,11 +206,17 @@ __create_page_tables:
#endif
/*
- * Then map first 1MB of ram in case it contains our boot params.
+ * Then map boot params address in r2 or
+ * the first 1MB of ram if boot params address is not specified.
*/
- add r0, r4, #PAGE_OFFSET >> 18
- orr r6, r7, r8
- str r6, [r0]
+ mov r0, r2, lsr #20
+ movs r0, r0, lsl #20
+ moveq r0, r8
+ sub r3, r0, r8
+ add r3, r3, #PAGE_OFFSET
+ add r3, r4, r3, lsr #18
+ orr r6, r7, r0
+ str r6, [r3]
#ifdef CONFIG_DEBUG_LL
#ifndef CONFIG_DEBUG_ICEDCC
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] ARM: map ATAGs when not in first 1MB of RAM
2011-01-28 14:00 [PATCH v2] ARM: map ATAGs when not in first 1MB of RAM Rob Herring
@ 2011-01-28 14:10 ` Russell King - ARM Linux
2011-01-28 15:10 ` Rob Herring
0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2011-01-28 14:10 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jan 28, 2011 at 08:00:46AM -0600, Rob Herring wrote:
> @@ -206,11 +206,17 @@ __create_page_tables:
> #endif
>
> /*
> - * Then map first 1MB of ram in case it contains our boot params.
> + * Then map boot params address in r2 or
> + * the first 1MB of ram if boot params address is not specified.
> */
> - add r0, r4, #PAGE_OFFSET >> 18
> - orr r6, r7, r8
> - str r6, [r0]
> + mov r0, r2, lsr #20
> + movs r0, r0, lsl #20
> + moveq r0, r8
> + sub r3, r0, r8
> + add r3, r3, #PAGE_OFFSET
> + add r3, r4, r3, lsr #18
> + orr r6, r7, r0
> + str r6, [r3]
Wouldn't:
str r6, [r4, r3, lsr #18]
work here?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] ARM: map ATAGs when not in first 1MB of RAM
2011-01-28 14:10 ` Russell King - ARM Linux
@ 2011-01-28 15:10 ` Rob Herring
2011-02-07 16:23 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2011-01-28 15:10 UTC (permalink / raw)
To: linux-arm-kernel
Russell,
On 01/28/2011 08:10 AM, Russell King - ARM Linux wrote:
> On Fri, Jan 28, 2011 at 08:00:46AM -0600, Rob Herring wrote:
>> @@ -206,11 +206,17 @@ __create_page_tables:
>> #endif
>>
>> /*
>> - * Then map first 1MB of ram in case it contains our boot params.
>> + * Then map boot params address in r2 or
>> + * the first 1MB of ram if boot params address is not specified.
>> */
>> - add r0, r4, #PAGE_OFFSET>> 18
>> - orr r6, r7, r8
>> - str r6, [r0]
>> + mov r0, r2, lsr #20
>> + movs r0, r0, lsl #20
>> + moveq r0, r8
>> + sub r3, r0, r8
>> + add r3, r3, #PAGE_OFFSET
>> + add r3, r4, r3, lsr #18
>> + orr r6, r7, r0
>> + str r6, [r3]
>
> Wouldn't:
> str r6, [r4, r3, lsr #18]
> work here?
Not on Thumb2:
arch/arm/kernel/head.S:218: Error: Thumb supports only LSL in shifted
register indexing -- `str r6,[r4,r3,lsr#18]'
Rob
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] ARM: map ATAGs when not in first 1MB of RAM
2011-01-28 15:10 ` Rob Herring
@ 2011-02-07 16:23 ` Tony Lindgren
0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2011-02-07 16:23 UTC (permalink / raw)
To: linux-arm-kernel
* Rob Herring <robherring2@gmail.com> [110128 07:10]:
> Russell,
>
> On 01/28/2011 08:10 AM, Russell King - ARM Linux wrote:
> >On Fri, Jan 28, 2011 at 08:00:46AM -0600, Rob Herring wrote:
> >>@@ -206,11 +206,17 @@ __create_page_tables:
> >> #endif
> >>
> >> /*
> >>- * Then map first 1MB of ram in case it contains our boot params.
> >>+ * Then map boot params address in r2 or
> >>+ * the first 1MB of ram if boot params address is not specified.
> >> */
> >>- add r0, r4, #PAGE_OFFSET>> 18
> >>- orr r6, r7, r8
> >>- str r6, [r0]
> >>+ mov r0, r2, lsr #20
> >>+ movs r0, r0, lsl #20
> >>+ moveq r0, r8
> >>+ sub r3, r0, r8
> >>+ add r3, r3, #PAGE_OFFSET
> >>+ add r3, r4, r3, lsr #18
> >>+ orr r6, r7, r0
> >>+ str r6, [r3]
> >
> >Wouldn't:
> > str r6, [r4, r3, lsr #18]
> >work here?
>
> Not on Thumb2:
>
> arch/arm/kernel/head.S:218: Error: Thumb supports only LSL in
> shifted register indexing -- `str r6,[r4,r3,lsr#18]'
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-07 16:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 14:00 [PATCH v2] ARM: map ATAGs when not in first 1MB of RAM Rob Herring
2011-01-28 14:10 ` Russell King - ARM Linux
2011-01-28 15:10 ` Rob Herring
2011-02-07 16:23 ` Tony Lindgren
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).