serial: msm: Re-enable after resetting
authorStephan Gerhold <stephan.gerhold@linaro.org>
Mon, 8 Sep 2025 11:31:25 +0000 (13:31 +0200)
committerCasey Connolly <casey.connolly@linaro.org>
Wed, 29 Oct 2025 11:27:33 +0000 (12:27 +0100)
The documentation for the UART controller in the APQ8016E specifies that
both RESET and ENABLE commands must be issued to set up the receiver and
transmitter, but at the moment we only issue RESET. This doesn't seem to
cause issues in practice (looks like the reset already re-enables the
receiver/transmitter), but let's add the two writes to RX_ENABLE/TX_ENABLE
to better match the recommendations in the documentation.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-5-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
drivers/serial/serial_msm.c

index 5523ec4..2c08a84 100644 (file)
@@ -50,6 +50,8 @@
 #define UARTDM_SR_UART_OVERRUN   (1 << 4) /* Receive overrun */
 
 #define UARTDM_CR                         0xA8 /* Command register */
+#define UARTDM_CR_RX_ENABLE               (1 << 0) /* Enable receiver */
+#define UARTDM_CR_TX_ENABLE               (1 << 2) /* Enable transmitter */
 #define UARTDM_CR_CMD_RESET_RX            (1 << 4) /* Reset receiver */
 #define UARTDM_CR_CMD_RESET_TX            (2 << 4) /* Reset transmitter */
 #define UARTDM_CR_CMD_RESET_ERR           (3 << 4) /* Clear overrun error */
@@ -225,6 +227,8 @@ static void uart_dm_init(struct msm_serial_data *priv)
 
        writel(UARTDM_CR_CMD_RESET_RX, priv->base + UARTDM_CR);
        writel(UARTDM_CR_CMD_RESET_TX, priv->base + UARTDM_CR);
+       writel(UARTDM_CR_RX_ENABLE, priv->base + UARTDM_CR);
+       writel(UARTDM_CR_TX_ENABLE, priv->base + UARTDM_CR);
 }
 static int msm_serial_probe(struct udevice *dev)
 {