diff mbox

[U-Boot,18/55] exynos: Enable the debug UART in SPL

Message ID 1435882592-487-19-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 3, 2015, 12:15 a.m. UTC
As a debugging aid, allow UART3 to be used as a debug UART in SPL. This
is a precursor to proper UART support, which requires a substantial
refactor.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/cpu/armv7/exynos/lowlevel_init.c | 5 +++++
 drivers/serial/serial_s5p.c               | 2 ++
 2 files changed, 7 insertions(+)

Comments

Simon Glass July 27, 2015, 11:30 p.m. UTC | #1
On 2 July 2015 at 18:15, Simon Glass <sjg@chromium.org> wrote:
> As a debugging aid, allow UART3 to be used as a debug UART in SPL. This
> is a precursor to proper UART support, which requires a substantial
> refactor.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/arm/cpu/armv7/exynos/lowlevel_init.c | 5 +++++
>  drivers/serial/serial_s5p.c               | 2 ++
>  2 files changed, 7 insertions(+)

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/exynos/lowlevel_init.c b/arch/arm/cpu/armv7/exynos/lowlevel_init.c
index 120aaf8..3774607 100644
--- a/arch/arm/cpu/armv7/exynos/lowlevel_init.c
+++ b/arch/arm/cpu/armv7/exynos/lowlevel_init.c
@@ -25,6 +25,7 @@ 
 
 #include <common.h>
 #include <config.h>
+#include <debug_uart.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/dmc.h>
 #include <asm/arch/power.h>
@@ -216,6 +217,10 @@  int do_lowlevel_init(void)
 
 	if (actions & DO_CLOCKS) {
 		system_clock_init();
+#ifdef CONFIG_DEBUG_UART
+		exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
+		debug_uart_init();
+#endif
 		mem_ctrl_init(actions & DO_MEM_RESET);
 		tzpc_init();
 	}
diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
index 4a553a3..21cb566 100644
--- a/drivers/serial/serial_s5p.c
+++ b/drivers/serial/serial_s5p.c
@@ -85,6 +85,7 @@  static void __maybe_unused s5p_serial_baud(struct s5p_uart *uart, uint uclk,
 		writeb(val % 16, &uart->rest.value);
 }
 
+#ifndef CONFIG_SPL_BUILD
 int s5p_serial_setbrg(struct udevice *dev, int baudrate)
 {
 	struct s5p_serial_platdata *plat = dev->platdata;
@@ -200,6 +201,7 @@  U_BOOT_DRIVER(serial_s5p) = {
 	.ops	= &s5p_serial_ops,
 	.flags = DM_FLAG_PRE_RELOC,
 };
+#endif
 
 #ifdef CONFIG_DEBUG_UART_S5P