diff mbox series

[U-Boot,07/12] arm: spear: Use PUSH/POP mnemonics when relevant

Message ID 20190507121854.18575-8-miquel.raynal@bootlin.com
State Accepted
Commit f30765b74896bcd604decc46e341035f7f3b4961
Delegated to: Tom Rini
Headers show
Series Enable returning back to BootROM from spear SPL | expand

Commit Message

Miquel Raynal May 7, 2019, 12:18 p.m. UTC
Quoting ARM "RealView Compilation Tools Assembler Guide v4.0":

        PUSH and POP are synonyms for STMDB and LDM (or LDMIA), with
        the base register sp (r13), and the adjusted address written
        back to the base register.
	PUSH and POP are the preferred mnemonic in these cases.

Let's follow this recommandation to ease the reading and substitute
LDMIA/STMDB operations with PUSH/POP mnemonics.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 arch/arm/cpu/arm926ejs/spear/start.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stefan Roese May 7, 2019, 12:42 p.m. UTC | #1
On 07.05.19 14:18, Miquel Raynal wrote:
> Quoting ARM "RealView Compilation Tools Assembler Guide v4.0":
> 
>          PUSH and POP are synonyms for STMDB and LDM (or LDMIA), with
>          the base register sp (r13), and the adjusted address written
>          back to the base register.
> 	PUSH and POP are the preferred mnemonic in these cases.
> 
> Let's follow this recommandation to ease the reading and substitute
> LDMIA/STMDB operations with PUSH/POP mnemonics.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Tom Rini July 11, 2019, 10:05 p.m. UTC | #2
On Tue, May 07, 2019 at 02:18:49PM +0200, Miquel Raynal wrote:

> Quoting ARM "RealView Compilation Tools Assembler Guide v4.0":
> 
>         PUSH and POP are synonyms for STMDB and LDM (or LDMIA), with
>         the base register sp (r13), and the adjusted address written
>         back to the base register.
> 	PUSH and POP are the preferred mnemonic in these cases.
> 
> Let's follow this recommandation to ease the reading and substitute
> LDMIA/STMDB operations with PUSH/POP mnemonics.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Stefan Roese <sr@denx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/cpu/arm926ejs/spear/start.S b/arch/arm/cpu/arm926ejs/spear/start.S
index 566cf668b7..25895f01ac 100644
--- a/arch/arm/cpu/arm926ejs/spear/start.S
+++ b/arch/arm/cpu/arm926ejs/spear/start.S
@@ -35,9 +35,9 @@  reset:
 	* SPL has to return back to BootROM in a few cases (eg. Ethernet boot,
 	* UART boot, USB boot): save registers in BootROM's stack.
 	*/
-	stmdb	sp!, {r0-r12,r14}
+	push	{r0-r12,r14}
 	bl	cpu_init_crit
-	ldmia	sp!, {r0-r12,pc}
+	pop	{r0-r12,pc}
 
 /*
  *************************************************************************
@@ -67,6 +67,6 @@  cpu_init_crit:
 	/*
 	 * Go setup Memory and board specific bits prior to relocation.
 	 */
-	stmdb	sp!, {lr}
+	push	{lr}
 	bl	_main	/* _main will call board_init_f */
-	ldmia	sp!, {pc}
+	pop	{pc}