|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1 2/5] xen/arm: Add NXP LINFlexD UART early printk support
Hi, On 10/09/2024 15:34, Andrei Cherechesu (OSS) wrote: GPL-2.0 is deprecated and replaced by GPL-2.0-only. +/* + * xen/arch/arm/arm64/debug-linflex.inc + * + * NXP LINFlexD UART specific debug code + * + * Andrei Cherechesu <andrei.cherechesu@xxxxxxx> + * Copyright 2018, 2021, 2023-2024 NXP + */ + +#include <asm/asm_defns.h> +#include <asm/linflex-uart.h> + +/* + * wait LINFlexD UART to be ready to transmit + * xb: register which contains the UART base address + * c: scratch register number + */ +.macro early_uart_ready xb, c + ldr w\c, [\xb, #UARTCR] /* <= Control Register */ + and w\c, w\c, #UARTCR_TFBM /* Check Buffer/FIFO (0/1) Mode */ + cbz w\c, 2f /* Buffer Mode => return */ +1: + ldrb w\c, [\xb, #UARTSR] /* <= Status Register */ + tst w\c, #UARTSR_DTFTFF /* FIFO Mode => Check DTF bit */ + b.ne 1b +2: +.endm + +/* + * LINFlexD 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 + strb \wt, [\xb, #BDRL] + + ldr \wt, [\xb, #UARTCR] /* <= Control Register */ + and \wt, \wt, #UARTCR_TFBM /* Check Buffer/FIFO (0/1) Mode */ + cbnz \wt, 2f /* FIFO Mode => goto exit */ + +3: /* Buffer Mode */ + ldrb \wt, [\xb, #UARTSR] /* <= Status Register */ + and \wt, \wt, #UARTSR_DTFTFF /* Check Transmission Completed */ + cbz \wt, 3b + + ldr \wt, [\xb, #UARTSR] /* <= Status Register */ + orr \wt, \wt, #UARTSR_DTFTFF /* Clear DTF bit */ + str \wt, [\xb, #UARTSR] +2: +.endm + +/* + * Local variables: + * mode: ASM + * indent-tabs-mode: nil + * End: + */ \ No newline at end of file The file should end with a newline.I haven't looked at the specifics of the UART. But the code integration in Xen LGTM. So with the two comments addressed: Acked-by: Julien Grall <jgrall@xxxxxxxxxx> Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |