diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2019-07-30 20:16:46 +0300 |
---|---|---|
committer | Patrice Chotard <patrice.chotard@st.com> | 2019-08-27 12:19:23 +0300 |
commit | 132518f36b046f7b9523872ff04262713389a780 (patch) | |
tree | 7a644b14df135c441e5cbb17e8c29d10512d69b3 /drivers/serial/serial_stm32.c | |
parent | 48ac723a6fe4c31353371ec97b666b57eff65b51 (diff) | |
download | u-boot-132518f36b046f7b9523872ff04262713389a780.tar.xz |
serial: stm32: add Framing error support
Add management of Bit 1 of USART_ISR = FE: Framing error
This bit is set by hardware when a de-synchronization, excessive noise
or a break character is detected. It is cleared by software, writing 1
to the FECF bit in the USART_ICR register (for stm32 after f4).
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/serial/serial_stm32.c')
-rw-r--r-- | drivers/serial/serial_stm32.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c index 3ab536a52a..00a8e7249b 100644 --- a/drivers/serial/serial_stm32.c +++ b/drivers/serial/serial_stm32.c @@ -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; |