Skip to contentSkip to conversation

ARM: map ATAGs when not in first 1MB of RAM

PATCH Superseded Rob Herring 3 participants 4 messages Jan 28, 2011 – Feb 7, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: map ATAGs when not in first 1MB of RAM

From: Rob Herring <[email protected]>

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.

---

Applies to Russell's p2v branch

 arch/arm/kernel/head.S |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
arch/arm/kernel/head.S +10 -4
index 17a97b5..d4efa71 100644
@@ -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
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/1 ARM: map ATAGs when not in first 1MB of RAM

Quoted 9 lines · Rob Herring
arch/arm/kernel/head.S +2 -2
@@ -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

arch/arm/kernel/head.S __create_page_tables: · line 219

Quoted 10 lines
arch/arm/kernel/head.S +8 -2
-	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?

#2 lore raw

PATCH v2 1/1 ARM: map ATAGs when not in first 1MB of RAM

Russell,

Quoted 22 lines · Russell King - ARM Linux
Quoted 9 lines · Rob Herring
arch/arm/kernel/head.S +2 -2
@@ -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

arch/arm/kernel/head.S __create_page_tables: · line 219

Quoted 10 lines
arch/arm/kernel/head.S +8 -2
-	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:

Quoted 2 lines
	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

#3 lore raw

PATCH v2 1/1 ARM: map ATAGs when not in first 1MB of RAM

Quoted 28 lines · Rob Herring

Russell,

Quoted 22 lines · Russell King - ARM Linux
Quoted 9 lines · Rob Herring
arch/arm/kernel/head.S +2 -2
@@ -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

arch/arm/kernel/head.S __create_page_tables: · line 219

Quoted 10 lines
arch/arm/kernel/head.S +8 -2
-	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:

Quoted 2 lines
	str	r6, [r4, r3, lsr #18]

work here?

Quoted 4 lines

Not on Thumb2:

arch/arm/kernel/head.S:218: Error: Thumb supports only LSL in shifted register indexing -- `str r6,[r4,r3,lsr#18]'