Skip to content
Snippets Groups Projects
Commit d685b74c authored by Dave Liu's avatar Dave Liu Committed by Wolfgang Denk
Browse files

74xx: use r4 instead of r2 in lock_ram_in_cache and unlock_ram_in_cache


The patch is following the commit 39243840

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.

Signed-off-by: default avatarNick Spence <nick.spence@freescale.com>

also, the r2 is used as global data pointer.

Signed-off-by: default avatarDave Liu <daveliu@freescale.com>
parent d344293a
No related branches found
No related tags found
No related merge requests found
...@@ -857,9 +857,9 @@ lock_ram_in_cache: ...@@ -857,9 +857,9 @@ lock_ram_in_cache:
*/ */
lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h
ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l
li r2, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \
(CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32
mtctr r2 mtctr r4
1: 1:
dcbz r0, r3 dcbz r0, r3
addi r3, r3, 32 addi r3, r3, 32
...@@ -878,9 +878,9 @@ unlock_ram_in_cache: ...@@ -878,9 +878,9 @@ unlock_ram_in_cache:
/* invalidate the INIT_RAM section */ /* invalidate the INIT_RAM section */
lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h
ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l
li r2, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \
(CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32
mtctr r2 mtctr r4
1: icbi r0, r3 1: icbi r0, r3
addi r3, r3, 32 addi r3, r3, 32
bdnz 1b bdnz 1b
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment