diff mbox

[U-Boot,4/4] MIPS: call debug_uart_init right before board_init_f

Message ID 1493053414-810-5-git-send-email-noltari@gmail.com
State Accepted, archived
Commit 0d159d6852e2bafc453206a327e267124704a30e
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Álvaro Fernández Rojas April 24, 2017, 5:03 p.m. UTC
From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

All MIPS boards that support debug uart are calling debug_uart_init right at
the beginning of board_early_init_f.
Instead of doing that, let's provide a generic call to debug_uart_init right
before the call to board_init_f if debug uart is enabled for boards without
stack in SRAM.
On the other hand, boards with stack in SRAM can call earlier (right before
low level init).

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: Introduce the changes suggested by Daniel Schwierzeck:
  - Call debug_uart_init before low level init for boards with stack in SRAM.

 arch/mips/cpu/start.S | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Daniel Schwierzeck April 30, 2017, 6:22 p.m. UTC | #1
Am 24.04.2017 um 19:03 schrieb Álvaro Fernández Rojas:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> All MIPS boards that support debug uart are calling debug_uart_init right at
> the beginning of board_early_init_f.
> Instead of doing that, let's provide a generic call to debug_uart_init right
> before the call to board_init_f if debug uart is enabled for boards without
> stack in SRAM.
> On the other hand, boards with stack in SRAM can call earlier (right before
> low level init).
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v2: Introduce the changes suggested by Daniel Schwierzeck:
>   - Call debug_uart_init before low level init for boards with stack in SRAM.
> 
>  arch/mips/cpu/start.S | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 

applied to u-boot-mips/next, thanks!
diff mbox

Patch

diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index 6740fdf..a6b7a04 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -237,6 +237,13 @@  wr_done:
 #ifdef CONFIG_MIPS_INIT_STACK_IN_SRAM
 	/* Set up initial stack and global data */
 	setup_stack_gd
+
+# ifdef CONFIG_DEBUG_UART
+	/* Earliest point to set up debug uart */
+	PTR_LA	t9, debug_uart_init
+	jalr	t9
+	 nop
+# endif
 #endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
@@ -263,6 +270,13 @@  wr_done:
 #ifndef CONFIG_MIPS_INIT_STACK_IN_SRAM
 	/* Set up initial stack and global data */
 	setup_stack_gd
+
+# ifdef CONFIG_DEBUG_UART
+	/* Earliest point to set up debug uart */
+	PTR_LA	t9, debug_uart_init
+	jalr	t9
+	 nop
+# endif
 #endif
 
 	move	a0, zero		# a0 <-- boot_flags = 0