Commit ebf851ed authored by Yann Gautier's avatar Yann Gautier
Browse files

stm32mp1: manage CONSOLE_FLAG_TRANSLATE_CRLF and cleanup driver



The STM32 console driver was pre-pending '\r' before '\n'.
It is now managed by the framework with the flag:
CONSOLE_FLAG_TRANSLATE_CRLF.
Remove the code in driver, and add the flag for STM32MP1.

Change-Id: I5d0d5d5c4abee0b7dc11c2f8707b1b5cf10149ab
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent 0289ab9e
/* /*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -138,34 +138,18 @@ func console_stm32_core_putc ...@@ -138,34 +138,18 @@ func console_stm32_core_putc
/* Check the input parameter */ /* Check the input parameter */
cmp r1, #0 cmp r1, #0
beq putc_error beq putc_error
/* Prepend '\r' to '\n' */
cmp r0, #0xA
bne 2f
1:
/* Check Transmit Data Register Empty */
txe_loop_1:
ldr r2, [r1, #USART_ISR]
tst r2, #USART_ISR_TXE
beq txe_loop_1
mov r2, #0xD
str r2, [r1, #USART_TDR]
/* Check transmit complete flag */
tc_loop_1:
ldr r2, [r1, #USART_ISR]
tst r2, #USART_ISR_TC
beq tc_loop_1
2:
/* Check Transmit Data Register Empty */ /* Check Transmit Data Register Empty */
txe_loop_2: txe_loop:
ldr r2, [r1, #USART_ISR] ldr r2, [r1, #USART_ISR]
tst r2, #USART_ISR_TXE tst r2, #USART_ISR_TXE
beq txe_loop_2 beq txe_loop
str r0, [r1, #USART_TDR] str r0, [r1, #USART_TDR]
/* Check transmit complete flag */ /* Check transmit complete flag */
tc_loop_2: tc_loop:
ldr r2, [r1, #USART_ISR] ldr r2, [r1, #USART_ISR]
tst r2, #USART_ISR_TC tst r2, #USART_ISR_TC
beq tc_loop_2 beq tc_loop
bx lr bx lr
putc_error: putc_error:
mov r0, #-1 mov r0, #-1
......
...@@ -272,6 +272,9 @@ void bl2_el3_plat_arch_setup(void) ...@@ -272,6 +272,9 @@ void bl2_el3_plat_arch_setup(void)
panic(); panic();
} }
console_set_scope(&console.console, CONSOLE_FLAG_BOOT |
CONSOLE_FLAG_CRASH | CONSOLE_FLAG_TRANSLATE_CRLF);
stm32mp_print_cpuinfo(); stm32mp_print_cpuinfo();
board_model = dt_get_board_model(); board_model = dt_get_board_model();
......
...@@ -129,16 +129,20 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, ...@@ -129,16 +129,20 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
result = dt_get_stdout_uart_info(&dt_uart_info); result = dt_get_stdout_uart_info(&dt_uart_info);
if ((result > 0) && (dt_uart_info.status != 0U)) { if ((result > 0) && (dt_uart_info.status != 0U)) {
unsigned int console_flags;
if (console_stm32_register(dt_uart_info.base, 0, if (console_stm32_register(dt_uart_info.base, 0,
STM32MP_UART_BAUDRATE, &console) == STM32MP_UART_BAUDRATE, &console) ==
0) { 0) {
panic(); panic();
} }
console_flags = CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH |
CONSOLE_FLAG_TRANSLATE_CRLF;
#ifdef DEBUG #ifdef DEBUG
console_set_scope(&console.console, console_flags |= CONSOLE_FLAG_RUNTIME;
CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
#endif #endif
console_set_scope(&console.console, console_flags);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment