diff mbox

[U-Boot,v2] x86: Enable debug UART for Minnowmax

Message ID 1438560441-28739-1-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Aug. 3, 2015, 12:07 a.m. UTC
Enable the debug UART and emit a single 'a' early in the init sequence to
show that it is working.

Unfortunately the debug UART implementation needs a stack to work. I cannot
seem to remove this limitation as the absolute 'jmp %eax' instruction goes
off into the weeds.

So this means that the character output cannot be any earlier than
car_init_ret, where memory is available for a stack.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
---

Changes in v2:
- Put the debug UART setup code in comments since we don't always want it

 arch/x86/cpu/start.S        | 9 +++++++++
 configs/minnowmax_defconfig | 4 ++++
 2 files changed, 13 insertions(+)

Comments

Simon Glass Aug. 9, 2015, 3:07 p.m. UTC | #1
On 2 August 2015 at 18:07, Simon Glass <sjg@chromium.org> wrote:
> Enable the debug UART and emit a single 'a' early in the init sequence to
> show that it is working.
>
> Unfortunately the debug UART implementation needs a stack to work. I cannot
> seem to remove this limitation as the absolute 'jmp %eax' instruction goes
> off into the weeds.
>
> So this means that the character output cannot be any earlier than
> car_init_ret, where memory is available for a stack.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
> ---
>
> Changes in v2:
> - Put the debug UART setup code in comments since we don't always want it
>
>  arch/x86/cpu/start.S        | 9 +++++++++
>  configs/minnowmax_defconfig | 4 ++++
>  2 files changed, 13 insertions(+)

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index fdef2bb..ac711ed 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -128,6 +128,15 @@  car_init_ret:
 	andl	$0xfffffff0, %esp
 	post_code(POST_START_STACK)
 
+	/*
+	 * Debug UART is available here although it may not be plumbed out
+	 * to pins depending on the board. To use it:
+	 *
+	 * call  debug_uart_init
+	 * mov   $'a', %eax
+	 * call  printch
+	 */
+
 	/* Zero the global data since it won't happen later */
 	xorl	%eax, %eax
 	movl	$GENERATED_GBL_DATA_SIZE, %ecx
diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig
index e98f5eb..a67597d 100644
--- a/configs/minnowmax_defconfig
+++ b/configs/minnowmax_defconfig
@@ -24,3 +24,7 @@  CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
 CONFIG_DM_RTC=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_SYS_VSNPRINTF=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_NS16550=y
+CONFIG_DEBUG_UART_BASE=0x3f8
+CONFIG_DEBUG_UART_CLOCK=1843200