summaryrefslogtreecommitdiff
path: root/doc/develop/bootstd/extlinux.rst
diff options
context:
space:
mode:
authorStephan Gerhold <[email protected]>2025-09-08 13:31:26 +0200
committerCasey Connolly <[email protected]>2025-10-29 12:27:33 +0100
commitff701837850e72f7333872d69c8dc8e77c66c870 (patch)
tree0f97801eb1d9130aa2b2dc4bbb04b3eab30bfbad /doc/develop/bootstd/extlinux.rst
parent5b83a081a7621e1be033518d771ea9a2ae0de962 (diff)
serial: msm: Use single character mode
The UART DM controller supports different channel data packing modes, either the 4-character packing mode (where 32-bit are read/written at once) or the single-character mode (where only a single character is read/written at a time). The 4-character mode can be more efficient, but the single-character mode is much easier to implement. At the moment, serial_msm uses the 4-character mode. Since the dm_serial_ops operate on one character at the time, the code goes through quite some hoops in order to break this down to single characters. This code is prone to race conditions (e.g. priv->chars_cnt is read from the registers, then a command is issued, what if another char came in inbetween?). It also seems to cause another subtle issue with autoboot: Unlike the previous autoboot failures that happened when UART was disconnected, this problem occurs when UART is connected and open in a terminal: For EFI boot, the console size is queried in efi_console.c query_console_serial() by sending an ANSI escape code via UART. For some reason, with the current driver we get yet another 0x00 byte (UART break event?) when reading the reply from serial input. Because of that, reading the console size fails in efi_console.c, the actual reply remains in the UART buffer, and later the boot flow aborts because it detects input after printing a prompt. Rather than trying to fix the issue in the current complicated approach, switch the driver to use the single-character mode. This is simple and straightforward to implement without race conditions: - We write one character at a time to UARTDM_TF, as long as the TX FIFO has space available (TX_READY). To flush the console before starting Linux, we wait for TX_EMPTY. - We read one character at a time from UARTDM_RF and strip off the additional error information (assuming there is something in the RX FIFO, as indicated by RX_READY). In this mode, querying the serial console size works and autoboot is no longer interrupted. The overall code is also much shorter. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Stephan Gerhold <[email protected]> Tested-by: Alexey Minnekhanov <[email protected]> Acked-by: Sumit Garg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
Diffstat (limited to 'doc/develop/bootstd/extlinux.rst')
0 files changed, 0 insertions, 0 deletions