diff mbox

[U-Boot,3/4] MIPS: tl-wdr4300: remove debug_uart_init call

Message ID 1493053414-810-4-git-send-email-noltari@gmail.com
State Superseded, archived
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Álvaro Fernández Rojas April 24, 2017, 5:03 p.m. UTC
In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.
WDR4300 doesn't provide a board_debug_uart_init and configures pinmux in
board_early_init_f instead. Since I have no idead of what's the needed uart
pinmux config, I copied the whole pinmux config to a new function that is
called from board_early_init_f if CONFIG_DEBUG_UART_BOARD_INIT is not enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: No changes.

 board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Comments

Daniel Schwierzeck April 30, 2017, 6:22 p.m. UTC | #1
Am 24.04.2017 um 19:03 schrieb Álvaro Fernández Rojas:
> In order to add a generic MIPS debug_uart_init call right before the call to
> board_early_init_f, we need to remove all calls to debug_uart_init from every
> MIPS boards.
> WDR4300 doesn't provide a board_debug_uart_init and configures pinmux in
> board_early_init_f instead. Since I have no idead of what's the needed uart
> pinmux config, I copied the whole pinmux config to a new function that is
> called from board_early_init_f if CONFIG_DEBUG_UART_BOARD_INIT is not enabled.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v2: No changes.
> 
>  board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 

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

Patch

diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
index 6e070fd..0f59648 100644
--- a/board/tplink/wdr4300/wdr4300.c
+++ b/board/tplink/wdr4300/wdr4300.c
@@ -34,8 +34,7 @@  static void wdr4300_usb_start(void)
 static inline void wdr4300_usb_start(void) {}
 #endif
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
+void wdr4300_pinmux_config(void)
 {
 	void __iomem *regs;
 
@@ -56,9 +55,20 @@  int board_early_init_f(void)
 	writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC3);
 	writel(0x0000004d, regs + AR934X_GPIO_REG_OUT_FUNC4);
 	writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC5);
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+	wdr4300_pinmux_config();
+}
+#endif
 
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifndef CONFIG_DEBUG_UART_BOARD_INIT
+	wdr4300_pinmux_config();
 #endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT