serial: stm32: add Framing error support
[oweals/u-boot.git] / drivers / serial / serial_stm32.c
index 3ab536a52ac032c270b3d341c1ca2554d1ecbe8d..00a8e7249b55717c172d4ed0eb4b18df73d6bf4e 100644 (file)
@@ -106,10 +106,11 @@ static int stm32_serial_getc(struct udevice *dev)
        if ((isr & USART_ISR_RXNE) == 0)
                return -EAGAIN;
 
-       if (isr & (USART_ISR_PE | USART_ISR_ORE)) {
+       if (isr & (USART_ISR_PE | USART_ISR_ORE | USART_ISR_FE)) {
                if (!stm32f4)
                        setbits_le32(base + ICR_OFFSET,
-                                    USART_ICR_PCECF | USART_ICR_ORECF);
+                                    USART_ICR_PCECF | USART_ICR_ORECF |
+                                    USART_ICR_FECF);
                else
                        readl(base + RDR_OFFSET(stm32f4));
                return -EIO;