diff mbox series

[3/3] sunxi: fel: drop redundant "control register" save/restore

Message ID 20220713152758.56929-4-andre.przywara@arm.com
State Accepted
Commit 7f0938eac5d867b202d74b2a734ac3f924411bc9
Delegated to: Andre Przywara
Headers show
Series sunxi: FEL boot fixes | expand

Commit Message

Andre Przywara July 13, 2022, 3:27 p.m. UTC
For some reasons shrouded in mystery, the code saving the FEL state was
saving the SCTLR register twice, with the second copy trying to justify
itself by using its ancient "control register" alias name.

Drop the redundant second copy, both from the fel_stash data structure,
and also the code saving and restoring it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/cpu/armv7/sunxi/fel_utils.S | 4 ----
 arch/arm/mach-sunxi/board.c          | 1 -
 2 files changed, 5 deletions(-)

Comments

Samuel Holland Jan. 8, 2023, 8:40 p.m. UTC | #1
On 7/13/22 10:27, Andre Przywara wrote:
> For some reasons shrouded in mystery, the code saving the FEL state was
> saving the SCTLR register twice, with the second copy trying to justify
> itself by using its ancient "control register" alias name.
> 
> Drop the redundant second copy, both from the fel_stash data structure,
> and also the code saving and restoring it.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm/cpu/armv7/sunxi/fel_utils.S | 4 ----
>  arch/arm/mach-sunxi/board.c          | 1 -
>  2 files changed, 5 deletions(-)

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
diff mbox series

Patch

diff --git a/arch/arm/cpu/armv7/sunxi/fel_utils.S b/arch/arm/cpu/armv7/sunxi/fel_utils.S
index b2310751d9..78bb1657fc 100644
--- a/arch/arm/cpu/armv7/sunxi/fel_utils.S
+++ b/arch/arm/cpu/armv7/sunxi/fel_utils.S
@@ -20,8 +20,6 @@  ENTRY(save_boot_params)
 	str	lr, [r0, #12]
 	mrc	p15, 0, lr, c12, c0, 0	@ Read VBAR
 	str	lr, [r0, #16]
-	mrc	p15, 0, lr, c1, c0, 0	@ Read CP15 Control Register
-	str	lr, [r0, #20]
 	b	save_boot_params_ret
 ENDPROC(save_boot_params)
 
@@ -29,8 +27,6 @@  ENTRY(return_to_fel)
 	mov	sp, r0
 	mov	lr, r1
 	ldr	r0, =fel_stash
-	ldr	r1, [r0, #20]
-	mcr	p15, 0, r1, c1, c0, 0	@ Write CP15 Control Register
 	ldr	r1, [r0, #16]
 	mcr	p15, 0, r1, c12, c0, 0	@ Write VBAR
 	ldr	r1, [r0, #12]
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 8f7c894286..385eac7a61 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -35,7 +35,6 @@  struct fel_stash {
 	uint32_t cpsr;
 	uint32_t sctlr;
 	uint32_t vbar;
-	uint32_t cr;
 };
 
 struct fel_stash fel_stash __section(".data");