serial: meson: handle RX errors
authorNeil Armstrong <narmstrong@baylibre.com>
Tue, 21 Jul 2020 11:41:14 +0000 (13:41 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Mon, 27 Jul 2020 14:35:56 +0000 (16:35 +0200)
commit812196d53eb23509a392e1a3b7f09f59d887228c
tree78550cd2724a2f85eec3caa07a4a130b445b746b
parent3773028fced4795d52f02b387496395ec387f3bb
serial: meson: handle RX errors

This checks and handles RX errors on the Amlogic UART controller
after experiencing errors on the Khadas VIM3 & VIM3L when UART AO A
lines are not connected.

When the RX line is not connected, the first byte is erroneous and breaks
the U-Boot autoboot, breaking automatic boot.

This checks and drops any erroneous RX byte on pending and getc callbacks
to avoid returning true to pending when an error byte is in the FIFO.

Fixes: bfcef28ae4 ("arm: add initial support for Amlogic Meson and ODROID-C2")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
drivers/serial/serial_meson.c