[PATCH v3 12/21] serial: sh: Fix error handling

Marek Vasut marek.vasut at mailbox.org
Mon Oct 16 14:55:50 CEST 2023


On 10/16/23 11:25, Paul Barker wrote:
> The current SCIF error handling is broken for the RZ/G2L. After a break
> condition has been triggered, the current code is unable to clear the
> error and serial port output never resumes.
> 
> The RZ/G2L datasheet says that most error conditions are cleared by
> resetting the relevant error bits in the FSR & LSR registers to zero.
> To clear framing errors, the invalid data also needs to be read out of
> the receive FIFO.
> 
> After reviewing datasheets for RZ/G2{H,M,N,E}, R-Car Gen4, R-Car Gen3
> and even SH7751 SoCs, it's clear that this is the way to clear errors
> for all of these SoCs.
> 
> While we're here, annotate the handle_error() function with a couple of
> comments as the reads and writes themselves don't immediately make it
> clear what we're doing.
> 
> Signed-off-by: Paul Barker <paul.barker.ct at bp.renesas.com>
> Tested-by: Chris Paterson <chris.paterson2 at renesas.com>
> 	# HiHope RZ/G2M board
> Tested-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> 	# R-Car H3 Salvator-XS

Reviewed-by: Marek Vasut <marek.vasut+renesas at mailbox.org>


More information about the U-Boot mailing list