From a75d90576079398b99b0ad89c132966f0765c66f Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Mon, 28 Feb 2022 10:53:59 +0900 Subject: [PATCH] arch: imx6: Refactor imx_lowputc() Summary: - Remove '\n' -> '\r\n' conversion - Remove waiting for FIFO empty after sending a character - Remove CONFIG_DEBUG_FEATURES Impact: - None Testing: - Tested with sabre-6quad:netknsh (not merged yet) Signed-off-by: Masayuki Ishikawa --- arch/arm/src/imx6/imx_lowputc.c | 23 +---------------------- arch/arm/src/imx6/imx_lowputc.h | 4 +--- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/arm/src/imx6/imx_lowputc.c b/arch/arm/src/imx6/imx_lowputc.c index ad39c39f2e..5fa9b0cd51 100644 --- a/arch/arm/src/imx6/imx_lowputc.c +++ b/arch/arm/src/imx6/imx_lowputc.c @@ -571,7 +571,7 @@ int imx_uart_configure(uint32_t base, FAR const struct uart_config_s *config) * ****************************************************************************/ -#if defined(IMX_HAVE_UART) && defined(CONFIG_DEBUG_FEATURES) +#ifdef IMX_HAVE_UART void imx_lowputc(int ch) { /* Poll the TX fifo trigger level bit of the UART status register. When the @@ -585,29 +585,8 @@ void imx_lowputc(int ch) * return */ - if (ch == '\n') - { - /* Send the carrage return by writing it into the UART_TXD register. */ - - putreg32((uint32_t)'\r', IMX_CONSOLE_VBASE + UART_TXD_OFFSET); - - /* Wait for the tranmsit register to be emptied. When the TXFE bit is - * non-zero, the TX Buffer FIFO is empty. - */ - - while ((getreg32(IMX_CONSOLE_VBASE + UART_USR2_OFFSET) & - UART_USR2_TXFE) == 0); - } - /* Send the character by writing it into the UART_TXD register. */ putreg32((uint32_t)ch, IMX_CONSOLE_VBASE + UART_TXD_OFFSET); - - /* Wait for the tranmsit register to be emptied. When the TXFE bit is - * non-zero, the TX Buffer FIFO is empty. - */ - - while ((getreg32(IMX_CONSOLE_VBASE + UART_USR2_OFFSET) & - UART_USR2_TXFE) == 0); } #endif diff --git a/arch/arm/src/imx6/imx_lowputc.h b/arch/arm/src/imx6/imx_lowputc.h index 265e1195cb..df81bc86d1 100644 --- a/arch/arm/src/imx6/imx_lowputc.h +++ b/arch/arm/src/imx6/imx_lowputc.h @@ -91,10 +91,8 @@ int imx_uart_configure(uint32_t base, * ****************************************************************************/ -#if defined(IMX_HAVE_UART) && defined(CONFIG_DEBUG_FEATURES) +#ifdef IMX_HAVE_UART void imx_lowputc(int ch); -#else -# define imx_lowputc(ch) #endif #endif /* __ARCH_ARM_SRC_IMX6_IMX_LOWPUTC_H */