serial: msm-geni: configure RX watermark register
PATCH 1/1 serial: msm-geni: configure RX watermark register
From: Timple Raj M <[email protected]>
The SE_GENI_RX_WATERMARK_REG was not being programmed in the RX setup paths. Set it to DEF_RX_WM (2) in qcom_geni_serial_start_rx(), msm_geni_serial_setup_rx() and _debug_uart_init() to align with the Linux kernel driver behaviour.
Without this, the RX FIFO watermark interrupt threshold is left at its hardware reset value, which may differ from the expected value and can cause RX data loss or missed watermark interrupts.
--- drivers/serial/serial_msm_geni.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/serial/serial_msm_geni.c +4 -0
@@ -55,6 +55,7 @@#define SE_UART_RX_PARITY_CFG 0x2a8#define DEF_TX_WM 2 +#define DEF_RX_WM 2/* GENI_FORCE_DEFAULT_REG fields */ #define UART_START_READ 0x1
@@ -345,6 +346,7 @@ static void qcom_geni_serial_start_rx(struct udevice *dev)geni_se_setup_s_cmd (priv->base,UART_START_READ ,0 ); +writel (DEF_RX_WM , priv->base +SE_GENI_RX_WATERMARK_REG );setbits_le32 (priv->base +SE_GENI_S_IRQ_EN ,S_RX_FIFO_WATERMARK_EN |S_RX_FIFO_LAST_EN );setbits_le32 (priv->base +SE_GENI_M_IRQ_EN ,M_RX_FIFO_WATERMARK_EN |M_RX_FIFO_LAST_EN ); }
@@ -373,6 +375,7 @@ static void msm_geni_serial_setup_rx(struct udevice *dev)geni_se_setup_s_cmd (priv->base,UART_START_READ ,0 ); +writel (DEF_RX_WM , priv->base +SE_GENI_RX_WATERMARK_REG );setbits_le32 (priv->base +SE_GENI_S_IRQ_EN ,S_RX_FIFO_WATERMARK_EN |S_RX_FIFO_LAST_EN );setbits_le32 (priv->base +SE_GENI_M_IRQ_EN ,M_RX_FIFO_WATERMARK_EN |M_RX_FIFO_LAST_EN ); }
@@ -616,6 +619,7 @@ static inline void _debug_uart_init(void)phys_addr_t base =CONFIG_VAL (DEBUG_UART_BASE );geni_serial_init (&init_dev); +writel (DEF_RX_WM , base +SE_GENI_RX_WATERMARK_REG );geni_serial_baud (base,CLK_DIV ,CONFIG_BAUDRATE );qcom_geni_serial_start_tx (base); }
Signature · 1 line
2.34.1
Quoted 11 lines · Gurumoorthy Santhakumar
serial: msm-geni: configure RX watermark register
The
SE_GENI_RX_WATERMARK_REGwas not being programmed in the RX setup paths. Set it toDEF_RX_WM(2) inqcom_geni_serial_start_rx(),msm_geni_serial_setup_rx()and_debug_uart_init()to align with the Linux kernel driver behaviour.Without this, the RX FIFO watermark interrupt threshold is left at its hardware reset value, which may differ from the expected value and can cause RX data loss or missed watermark interrupts.
Quoted 6 lines
Signed-off-by Timple Raj M <[email protected]>Signed-off-by Gurumoorthy Santhakumar <[email protected]>
drivers/serial/serial_msm_geni.c| 4 ++++1 file changed, 4 insertions(+)
Quoted 11 lines · Gurumoorthy Santhakumar
From: Timple Raj M <[email protected]>
The
SE_GENI_RX_WATERMARK_REGwas not being programmed in the RX setup paths. Set it toDEF_RX_WM(2) inqcom_geni_serial_start_rx(),msm_geni_serial_setup_rx()and_debug_uart_init()to align with the Linux kernel driver behaviour.Without this, the RX FIFO watermark interrupt threshold is left at its hardware reset value, which may differ from the expected value and can cause RX data loss or missed watermark interrupts.
Quoted 6 lines
Signed-off-by Timple Raj M <[email protected]>Signed-off-by Gurumoorthy Santhakumar <[email protected]>--- drivers/serial/serial_msm_geni.c | 4 ++++ 1 file changed, 4 insertions(+)
-Sumit
Quoted 40 lines
drivers/serial/serial_msm_geni.c +4
-0@@ -55,6 +55,7 @@#define SE_UART_RX_PARITY_CFG 0x2a8#define DEF_TX_WM 2 +#define DEF_RX_WM 2/* GENI_FORCE_DEFAULT_REG fields */ #define UART_START_READ 0x1@@ -345,6 +346,7 @@ static void qcom_geni_serial_start_rx(struct udevice *dev)geni_se_setup_s_cmd (priv->base,UART_START_READ ,0 ); +writel (DEF_RX_WM , priv->base +SE_GENI_RX_WATERMARK_REG );setbits_le32 (priv->base +SE_GENI_S_IRQ_EN ,S_RX_FIFO_WATERMARK_EN |S_RX_FIFO_LAST_EN );setbits_le32 (priv->base +SE_GENI_M_IRQ_EN ,M_RX_FIFO_WATERMARK_EN |M_RX_FIFO_LAST_EN ); }@@ -373,6 +375,7 @@ static void msm_geni_serial_setup_rx(struct udevice *dev)geni_se_setup_s_cmd (priv->base,UART_START_READ ,0 ); +writel (DEF_RX_WM , priv->base +SE_GENI_RX_WATERMARK_REG );setbits_le32 (priv->base +SE_GENI_S_IRQ_EN ,S_RX_FIFO_WATERMARK_EN |S_RX_FIFO_LAST_EN );setbits_le32 (priv->base +SE_GENI_M_IRQ_EN ,M_RX_FIFO_WATERMARK_EN |M_RX_FIFO_LAST_EN ); }@@ -616,6 +619,7 @@ static inline void _debug_uart_init(void)phys_addr_t base =CONFIG_VAL (DEBUG_UART_BASE );geni_serial_init (&init_dev); +writel (DEF_RX_WM , base +SE_GENI_RX_WATERMARK_REG );geni_serial_baud (base,CLK_DIV ,CONFIG_BAUDRATE );qcom_geni_serial_start_tx (base); }Signature · 1 line
2.34.1
Quoted 7 lines · Gurumoorthy Santhakumar
From: Timple Raj M <[email protected]>
The
SE_GENI_RX_WATERMARK_REGwas not being programmed in the RX setup paths. Set it toDEF_RX_WM(2) inqcom_geni_serial_start_rx(),msm_geni_serial_setup_rx()and_debug_uart_init()to align with the Linux kernel driver behaviour.
Quoted 7 lines
Without this, the RX FIFO watermark interrupt threshold is left at its hardware reset value, which may differ from the expected value and can cause RX data loss or missed watermark interrupts.
Signed-off-by Timple Raj M <[email protected]>Signed-off-by Gurumoorthy Santhakumar <[email protected]>
Quoted 40 lines
--- drivers/serial/serial_msm_geni.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/serial/serial_msm_geni.c +4
-0@@ -55,6 +55,7 @@#define SE_UART_RX_PARITY_CFG 0x2a8#define DEF_TX_WM 2 +#define DEF_RX_WM 2/* GENI_FORCE_DEFAULT_REG fields */ #define UART_START_READ 0x1@@ -345,6 +346,7 @@ static void qcom_geni_serial_start_rx(struct udevice *dev)geni_se_setup_s_cmd (priv->base,UART_START_READ ,0 ); +writel (DEF_RX_WM , priv->base +SE_GENI_RX_WATERMARK_REG );setbits_le32 (priv->base +SE_GENI_S_IRQ_EN ,S_RX_FIFO_WATERMARK_EN |S_RX_FIFO_LAST_EN );setbits_le32 (priv->base +SE_GENI_M_IRQ_EN ,M_RX_FIFO_WATERMARK_EN |M_RX_FIFO_LAST_EN ); }@@ -373,6 +375,7 @@ static void msm_geni_serial_setup_rx(struct udevice *dev)geni_se_setup_s_cmd (priv->base,UART_START_READ ,0 ); +writel (DEF_RX_WM , priv->base +SE_GENI_RX_WATERMARK_REG );setbits_le32 (priv->base +SE_GENI_S_IRQ_EN ,S_RX_FIFO_WATERMARK_EN |S_RX_FIFO_LAST_EN );setbits_le32 (priv->base +SE_GENI_M_IRQ_EN ,M_RX_FIFO_WATERMARK_EN |M_RX_FIFO_LAST_EN ); }@@ -616,6 +619,7 @@ static inline void _debug_uart_init(void)phys_addr_t base =CONFIG_VAL (DEBUG_UART_BASE );geni_serial_init (&init_dev); +writel (DEF_RX_WM , base +SE_GENI_RX_WATERMARK_REG );geni_serial_baud (base,CLK_DIV ,CONFIG_BAUDRATE );qcom_geni_serial_start_tx (base); }
Signature · 1 line
// Casey (she/her)
Casey Connolly
AppliedQuoted 10 lines · Gurumoorthy Santhakumar
The
SE_GENI_RX_WATERMARK_REGwas not being programmed in the RX setup paths. Set it toDEF_RX_WM(2) inqcom_geni_serial_start_rx(),msm_geni_serial_setup_rx()and_debug_uart_init()to align with the Linux kernel driver behaviour.Without this, the RX FIFO watermark interrupt threshold is left at its hardware reset value, which may differ from the expected value and can cause RX data loss or missed watermark interrupts.
[...]
Applied, thanks!
[1/1] serial: msm-geni: configure RX watermark register
https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/5f171c622479
Best regards,
Signature · 1 line
// Casey (she/they)