ath10k: sdio: workaround firmware UART pin configuration bug
authorWen Gong <wgong@codeaurora.org>
Fri, 19 Apr 2019 07:28:45 +0000 (10:28 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 23 Apr 2019 13:23:16 +0000 (16:23 +0300)
On QCA6174 SDIO devices the SDIO interrupt will fail if UART is
disabled from ath10k. SDIO firmware enables UART printouts by
default. If ath10k will try to enable UART again the firmware
will configure it's GPIO line incorrectly and SDIO interrupts
won't work anymore. The workaround is to set UART pin again (19
for QCA6174 SDIO) if uart_print is 0.

Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/hw.h

index 835b8de92d55e6f94cffbc2f1449eb27acff72b3..cfd7bb29a1ec58cc2e678040151d6324d47bef05 100644 (file)
@@ -2065,8 +2065,16 @@ static int ath10k_init_uart(struct ath10k *ar)
                return ret;
        }
 
-       if (!uart_print)
+       if (!uart_print && ar->hw_params.uart_pin_workaround) {
+               ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
+                                        ar->hw_params.uart_pin);
+               if (ret) {
+                       ath10k_warn(ar, "failed to set UART TX pin: %d", ret);
+                       return ret;
+               }
+
                return 0;
+       }
 
        ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, ar->hw_params.uart_pin);
        if (ret) {
index 71314999aa2467a1fbe3b7d77fccb7ce3f35d6ca..a92fce1bb6f0f187060c97df720a43182df94ce7 100644 (file)
@@ -606,6 +606,11 @@ struct ath10k_hw_params {
 
        /* target supporting fw download via diag ce */
        bool fw_diag_ce_download;
+
+       /* need to set uart pin if disable uart print, workaround for a
+        * firmware bug
+        */
+       bool uart_pin_workaround;
 };
 
 struct htt_rx_desc;