Skip to contentSkip to conversation

mpc86xx: use r4 instead of r2 in lock_ram_in_cache and unlock_ram_in_cache

PATCH New Nick Spence 2 participants 3 messages Aug 28, 2008 – Oct 13, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc86xx: use r4 instead of r2 in lock_ram_in_cache and unlock_ram_in_cache

This is needed in unlock_ram_in_cache() because it is called from C and will corrupt the small data area anchor that is kept in R2.

lock_ram_in_cache() is modified similarly as good coding practice, but is not called from C.

---
 cpu/mpc86xx/start.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
cpu/mpc86xx/start.S +4 -4
index 03f2128..90a1b83 100644
@@ -895,9 +895,9 @@ lock_ram_in_cache:
 	 */
 	lis	r3, (CFG_INIT_RAM_ADDR & ~31)@h
 	ori	r3, r3, (CFG_INIT_RAM_ADDR & ~31)@l
-	li	r2, ((CFG_INIT_RAM_END & ~31) + \
+	li	r4, ((CFG_INIT_RAM_END & ~31) + \
 		     (CFG_INIT_RAM_ADDR & 31) + 31) / 32
-	mtctr	r2
+	mtctr	r4
 1:
 	dcbz	r0, r3
 	addi	r3, r3, 32
@@ -930,9 +930,9 @@ unlock_ram_in_cache:
 	/* invalidate the INIT_RAM section */
 	lis	r3, (CFG_INIT_RAM_ADDR & ~31)@h
 	ori	r3, r3, (CFG_INIT_RAM_ADDR & ~31)@l
-	li	r2, ((CFG_INIT_RAM_END & ~31) + \
+	li	r4, ((CFG_INIT_RAM_END & ~31) + \
 		     (CFG_INIT_RAM_ADDR & 31) + 31) / 32
-	mtctr	r2
+	mtctr	r4
 1:	icbi	r0, r3
 	addi	r3, r3, 32
 	bdnz	1b
Signature · 1 line
1.5.2.2
#1 lore raw

PATCH 1/1 mpc86xx: use r4 instead of r2 in lock_ram_in_cache and unlock_ram_in_cache

Dear Jon,

Quoted 10 lines · in message <[email protected]> Nick…

This is needed in unlock_ram_in_cache() because it is called from C and will corrupt the small data area anchor that is kept in R2.

lock_ram_in_cache() is modified similarly as good coding practice, but is not called from C.

---
 cpu/mpc86xx/start.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

I think this patch was not added, nor was any feedback sent?

Please comment.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There are three principal ways to lose money: wine, women,  and  en-
gineers.  While  the first two are more pleasant, the third is by far
the more certain."                      -- Baron Rothschild, ca. 1800
#2 lore raw

PATCH 1/1 mpc86xx: use r4 instead of r2 in lock_ram_in_cache and unlock_ram_in_cache

In reply to Nick Spence

Dear Nick Spence,

Quoted 10 lines · In message <[email protected]> you wrote:

This is needed in unlock_ram_in_cache() because it is called from C and will corrupt the small data area anchor that is kept in R2.

lock_ram_in_cache() is modified similarly as good coding practice, but is not called from C.

---
 cpu/mpc86xx/start.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
GUIs  are  virtually  useless.  Learn  tools.  They're  configurable,
scriptable, automatable, cron-able, interoperable, etc. We don't need
no brain-dead winslurping monolithic claptrap.
                               -- Tom Christiansen in 371140df at csnews