
25 Oct
2022
25 Oct
'22
11:37 p.m.
On Tue, Oct 25, 2022 at 1:37 PM Fabio Estevam festevam@denx.de wrote:
Hi Pali,
On 25/10/2022 17:23, Pali Rohár wrote:
Hello! I do not have any MXC hardware but I see there one issue. mxc_serial_putc() function probably should not return -EAGAIN when device is busy. But instead it should wait until it is ready.
Could you try to change code to following?
while (readl(&uart->ts) & UTS_TXFULL) ; writel(ch, &uart->txd);
Your analysis looks correct.
The kernel does like this:
static void imx_uart_console_putchar(struct uart_port *port, unsigned char ch) { struct imx_port *sport = (struct imx_port *)port;
while (imx_uart_readl(sport, imx_uart_uts_reg(sport)) & UTS_TXFULL) barrier(); imx_uart_writel(sport, ch, URTX0);
}
Thanks
Fabio and Pali,
Seems reasonable but this does not resolve the problem. Whatever I print in board_init gets cutoff by the print from dm_announce.
Tim