OSDN Git Service

ath6kl: add ability to set debug uart baud rate
authorSteve deRosier <derosier@gmail.com>
Tue, 26 Apr 2016 11:41:37 +0000 (14:41 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 26 Apr 2016 11:57:44 +0000 (14:57 +0300)
It's useful to permit the customization of the debug uart baud rate. Enable
this and send down the value to the chip if we're enabling debug.

Signed-off-by: Steve deRosier <steve.derosier@lairdtech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/core.c
drivers/net/wireless/ath/ath6kl/core.h
drivers/net/wireless/ath/ath6kl/init.c

index 4ec02ce..ebb9f16 100644 (file)
@@ -31,6 +31,7 @@ unsigned int debug_mask;
 static unsigned int suspend_mode;
 static unsigned int wow_mode;
 static unsigned int uart_debug;
+static unsigned int uart_rate = 115200;
 static unsigned int ath6kl_p2p;
 static unsigned int testmode;
 static unsigned int recovery_enable;
@@ -40,6 +41,7 @@ module_param(debug_mask, uint, 0644);
 module_param(suspend_mode, uint, 0644);
 module_param(wow_mode, uint, 0644);
 module_param(uart_debug, uint, 0644);
+module_param(uart_rate, uint, 0644);
 module_param(ath6kl_p2p, uint, 0644);
 module_param(testmode, uint, 0644);
 module_param(recovery_enable, uint, 0644);
@@ -180,6 +182,7 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
 
        if (uart_debug)
                ar->conf_flags |= ATH6KL_CONF_UART_DEBUG;
+       ar->hw.uarttx_rate = uart_rate;
 
        set_bit(FIRST_BOOT, &ar->flag);
 
index 713a571..7a1970e 100644 (file)
@@ -781,6 +781,7 @@ struct ath6kl {
                u32 board_addr;
                u32 refclk_hz;
                u32 uarttx_pin;
+               u32 uarttx_rate;
                u32 testscript_addr;
                u8 tx_ant;
                u8 rx_ant;
index 3daeb27..58fb227 100644 (file)
@@ -651,6 +651,14 @@ int ath6kl_configure_target(struct ath6kl *ar)
        if (status)
                return status;
 
+       /* Only set the baud rate if we're actually doing debug */
+       if (ar->conf_flags & ATH6KL_CONF_UART_DEBUG) {
+               status = ath6kl_bmi_write_hi32(ar, hi_desired_baud_rate,
+                                              ar->hw.uarttx_rate);
+               if (status)
+                       return status;
+       }
+
        /* Configure target refclk_hz */
        if (ar->hw.refclk_hz != 0) {
                status = ath6kl_bmi_write_hi32(ar, hi_refclk_hz,