xen/arm64: add early printk for the classic i.MX UART

Add an early printk implementation for the classic i.MX UART IP,
selectable via EARLY_UART_CHOICE_IMX_UART.  The UART is expected to be
fully initialized by the bootloader.

Signed-off-by: Wig Cheng <onlywig@gmail.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
This commit is contained in:
Wig Cheng authored and Michal Orzel committed 2026-08-20 08:57:21 +02:00
1 parent ee53a871ed
commit 57b872a5b8
2 files changed
+49

No files matched your search

+12
View File
@@ -44,6 +44,14 @@ choice
Say Y here if you wish the early printk to direct their
output to a i.MX LPUART.
config EARLY_UART_CHOICE_IMX_UART
select EARLY_UART_IMX_UART
depends on ARM_64
bool "Early printk via i.MX UART"
help
Say Y here if you wish the early printk to direct their
output to the classic i.MX UART (i.MX8M family).
config EARLY_UART_CHOICE_LINFLEX
select EARLY_UART_LINFLEX
depends on ARM_64
@@ -97,6 +105,9 @@ config EARLY_UART_EXYNOS4210
config EARLY_UART_IMX_LPUART
select EARLY_PRINTK
bool
config EARLY_UART_IMX_UART
select EARLY_PRINTK
bool
config EARLY_UART_LINFLEX
select EARLY_PRINTK
bool
@@ -185,6 +196,7 @@ config EARLY_PRINTK_INC
default "debug-cadence.inc" if EARLY_UART_CADENCE
default "debug-exynos4210.inc" if EARLY_UART_EXYNOS4210
default "debug-imx-lpuart.inc" if EARLY_UART_IMX_LPUART
default "debug-imx-uart.inc" if EARLY_UART_IMX_UART
default "debug-linflex.inc" if EARLY_UART_LINFLEX
default "debug-meson.inc" if EARLY_UART_MESON
default "debug-mvebu.inc" if EARLY_UART_MVEBU
+37
View File
@@ -0,0 +1,37 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Early printk for the classic i.MX UART IP (i.MX8M family).
* The UART is expected to be fully initialized by the bootloader.
*
* Copyright 2026 Open-EP (E-Paper) Community
*/
#include <asm/imx-uart.h>
/*
* Wait for the UART to be ready to transmit
* xb: register which contains the UART base address
* c: scratch register
*/
.macro early_uart_ready xb, c
1:
ldr w\c, [\xb, #UTS] /* <- Test register */
tst w\c, #UTS_TXFULL /* Check TX FIFO full bit */
b.ne 1b /* Wait until there is room */
.endm
/*
* UART transmit character
* xb: register which contains the UART base address
* wt: register which contains the character to transmit
*/
.macro early_uart_transmit xb, wt
str \wt, [\xb, #URTX0] /* -> Transmitter register */
.endm
/*
* Local variables:
* mode: ASM
* indent-tabs-mode: nil
* End:
*/
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.