serial: stm32: fix rx error handling
- Fixes parity and framing error bit by clearing parity and framing error
flag. The current implementation doesn't clear the error bits when an
error is detected.
- Fixes the incorrect name of framing error clearing flag in header file.
- Fixes misalignement between data frame and errors status. The status
read for "n" frame was the status of "n+1" frame".
- Fixes break detection was not triggered by the expected register.
Fixes: 48a6092fb4
("serial: stm32-usart: Add STM32 USART Driver")
Signed-off-by: Erwan Le Ray <erwan.leray@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
c8a9d04394
commit
4f01d833fd
@@ -108,7 +108,6 @@ struct stm32_usart_info stm32h7_info = {
|
||||
#define USART_SR_RXNE BIT(5)
|
||||
#define USART_SR_TC BIT(6)
|
||||
#define USART_SR_TXE BIT(7)
|
||||
#define USART_SR_LBD BIT(8)
|
||||
#define USART_SR_CTSIF BIT(9)
|
||||
#define USART_SR_CTS BIT(10) /* F7 */
|
||||
#define USART_SR_RTOF BIT(11) /* F7 */
|
||||
@@ -120,8 +119,7 @@ struct stm32_usart_info stm32h7_info = {
|
||||
#define USART_SR_SBKF BIT(18) /* F7 */
|
||||
#define USART_SR_WUF BIT(20) /* H7 */
|
||||
#define USART_SR_TEACK BIT(21) /* F7 */
|
||||
#define USART_SR_ERR_MASK (USART_SR_LBD | USART_SR_ORE | \
|
||||
USART_SR_FE | USART_SR_PE)
|
||||
#define USART_SR_ERR_MASK (USART_SR_ORE | USART_SR_FE | USART_SR_PE)
|
||||
/* Dummy bits */
|
||||
#define USART_SR_DUMMY_RX BIT(16)
|
||||
|
||||
@@ -168,8 +166,6 @@ struct stm32_usart_info stm32h7_info = {
|
||||
/* USART_CR2 */
|
||||
#define USART_CR2_ADD_MASK GENMASK(3, 0) /* F4 */
|
||||
#define USART_CR2_ADDM7 BIT(4) /* F7 */
|
||||
#define USART_CR2_LBDL BIT(5)
|
||||
#define USART_CR2_LBDIE BIT(6)
|
||||
#define USART_CR2_LBCL BIT(8)
|
||||
#define USART_CR2_CPHA BIT(9)
|
||||
#define USART_CR2_CPOL BIT(10)
|
||||
@@ -226,12 +222,10 @@ struct stm32_usart_info stm32h7_info = {
|
||||
|
||||
/* USART_ICR */
|
||||
#define USART_ICR_PECF BIT(0) /* F7 */
|
||||
#define USART_ICR_FFECF BIT(1) /* F7 */
|
||||
#define USART_ICR_NCF BIT(2) /* F7 */
|
||||
#define USART_ICR_FECF BIT(1) /* F7 */
|
||||
#define USART_ICR_ORECF BIT(3) /* F7 */
|
||||
#define USART_ICR_IDLECF BIT(4) /* F7 */
|
||||
#define USART_ICR_TCCF BIT(6) /* F7 */
|
||||
#define USART_ICR_LBDCF BIT(8) /* F7 */
|
||||
#define USART_ICR_CTSCF BIT(9) /* F7 */
|
||||
#define USART_ICR_RTOCF BIT(11) /* F7 */
|
||||
#define USART_ICR_EOBCF BIT(12) /* F7 */
|
||||
|
Reference in New Issue
Block a user