diff mbox series

powerpc/mpc8xx: Zero boot_flags arg for calling board_init_f()

Message ID b2b0f2ba5e96dafed5e499fba8f53b3c709c442d.1675068528.git.christophe.leroy@csgroup.eu
State Accepted
Commit 2eed0c25f613b707a36600496fe0219d235238bb
Delegated to: Tom Rini
Headers show
Series powerpc/mpc8xx: Zero boot_flags arg for calling board_init_f() | expand

Commit Message

Christophe Leroy Jan. 30, 2023, 9:46 a.m. UTC
Copied from e83a7e94532 ("powerpc/mpc83xx: Zero boot_flags arg for
calling board_init_f()")

The argument boot_flags of board_init_f() is not used at all in the
powerpc specific board.c init sequence. Now with the generic init
sequence, this boot_flags arg is used by board_init_f().

This patch sets the r3 register that is used to pass the boot_flags
argument from the start.S board_init_f() call to 0 prior to the function
call to avoid unknown content to end up in gd->flags.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Fixes: 09f3ca3dd53 ("arm, powerpc: select SYS_GENERIC_BOARD")
---
 arch/powerpc/cpu/mpc8xx/start.S | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index 0ebb7b33a8b..51b5f5068ef 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -171,6 +171,7 @@  in_flash:
 	lis	r3, CONFIG_SYS_IMMR@h
 	bl	cpu_init_f	/* run low-level CPU init code     (from Flash)	*/
 
+	li	r3, 0		/* clear boot_flag for calling board_init_f */
 	bl	board_init_f	/* run 1st part of board init code (from Flash) */
 
 	/* NOTREACHED - board_init_f() does not return */