Discussion:
[PATCH/RFT 1/2] ath10k: add qca6164 support
Michal Kazior
2015-08-13 12:32:26 UTC
Permalink
This adds additional 0x0041 PCI Device ID
definition to ath10k for QCA6164 which is a 1
spatial stream sibling of the QCA6174 (which is 2
spatial stream chip).

The QCA6164 needs a dedicated board.bin file which
is different than the one used for QCA6174. If the
board.bin is wrong the device will crash early
while trying to boot firmware. The register dump
will look like this:

ath10k_pci 0000:02:00.0: firmware register dump:
ath10k_pci 0000:02:00.0: [00]: 0x05010000 0x000015B3 0x000A012D 0x00955B31
...

Note the value 0x000A012D.

Special credit goes to Alan Liu
<***@qca.qualcomm.com> for providing support
help which enabled me to come up with this patch.

Signed-off-by: Michal Kazior <***@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 11 +++++++++++
drivers/net/wireless/ath/ath10k/core.h | 1 +
drivers/net/wireless/ath/ath10k/pci.c | 13 +++++++++++++
3 files changed, 25 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 25510679fd2e..1ea16d044645 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -231,6 +231,17 @@ static int ath10k_init_configure_target(struct ath10k *ar)
return ret;
}

+ /* Some devices have a special sanity check that verifies the PCI
+ * Device ID is written to this host interest var. It is known to be
+ * required to boot QCA6164.
+ */
+ ret = ath10k_bmi_write32(ar, hi_hci_uart_pwr_mgmt_params_ext,
+ ar->dev_id);
+ if (ret) {
+ ath10k_err(ar, "failed to set pwr_mgmt_params: %d\n", ret);
+ return ret;
+ }
+
return 0;
}

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 6a387bac27b0..91d4409dee0b 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -554,6 +554,7 @@ struct ath10k {
u8 mac_addr[ETH_ALEN];

enum ath10k_hw_rev hw_rev;
+ u16 dev_id;
u32 chip_id;
u32 target_version;
u8 fw_version_major;
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index f00b251ec9ce..49a7538325e3 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -58,11 +58,13 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only (default: 0)");
#define ATH10K_PCI_NUM_WARM_RESET_ATTEMPTS 3

#define QCA988X_2_0_DEVICE_ID (0x003c)
+#define QCA6164_2_1_DEVICE_ID (0x0041)
#define QCA6174_2_1_DEVICE_ID (0x003e)
#define QCA99X0_2_0_DEVICE_ID (0x0040)

static const struct pci_device_id ath10k_pci_id_table[] = {
{ PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
+ { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */
{ PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */
{ PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */
{0}
@@ -74,11 +76,19 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
* because of that.
*/
{ QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV },
+
+ { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_2_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA6174_HW_3_0_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA6174_HW_3_1_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
+
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV },
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_2_2_CHIP_ID_REV },
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_0_CHIP_ID_REV },
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_1_CHIP_ID_REV },
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
+
{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
};

@@ -1810,6 +1820,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
case QCA988X_2_0_DEVICE_ID:
case QCA99X0_2_0_DEVICE_ID:
return 1;
+ case QCA6164_2_1_DEVICE_ID:
case QCA6174_2_1_DEVICE_ID:
switch (MS(ar->chip_id, SOC_CHIP_ID_REV)) {
case QCA6174_HW_1_0_CHIP_ID_REV:
@@ -2898,6 +2909,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
case QCA988X_2_0_DEVICE_ID:
hw_rev = ATH10K_HW_QCA988X;
break;
+ case QCA6164_2_1_DEVICE_ID:
case QCA6174_2_1_DEVICE_ID:
hw_rev = ATH10K_HW_QCA6174;
break;
@@ -2922,6 +2934,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
ar_pci->pdev = pdev;
ar_pci->dev = &pdev->dev;
ar_pci->ar = ar;
+ ar->dev_id = pci_dev->device;

if (pdev->subsystem_vendor || pdev->subsystem_device)
scnprintf(ar->spec_board_id, sizeof(ar->spec_board_id),
--
2.1.4
Michal Kazior
2015-08-13 12:32:27 UTC
Permalink
This cleans up the naming a little bit. Both
QCA6174 and QCA6164 are in practice the same as
far as driving them is concerned.

Unfortunately firmware paths will need to stay
untouched, i.e. QCA6164 firmware will still be
looked for in QCA6174 to avoid breaking backward
compatibility with older /lib/firmware setups.

Signed-off-by: Michal Kazior <***@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 60 +++++++++++------------
drivers/net/wireless/ath/ath10k/hw.c | 4 +-
drivers/net/wireless/ath/ath10k/hw.h | 70 +++++++++++++--------------
drivers/net/wireless/ath/ath10k/pci.c | 74 ++++++++++++++---------------
drivers/net/wireless/ath/ath10k/pci.h | 2 +-
drivers/net/wireless/ath/ath10k/rx_desc.h | 4 +-
drivers/net/wireless/ath/ath10k/targaddrs.h | 4 +-
drivers/net/wireless/ath/ath10k/wmi-tlv.h | 2 +-
8 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 1ea16d044645..9074022fdf84 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -63,49 +63,49 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
},
},
{
- .id = QCA6174_HW_2_1_VERSION,
- .name = "qca6174 hw2.1",
- .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+ .id = QCA61X4_HW_2_1_VERSION,
+ .name = "qca61x4 hw2.1",
+ .patch_load_addr = QCA61X4_HW_2_1_PATCH_LOAD_ADDR,
.uart_pin = 6,
.otp_exe_param = 0,
.fw = {
- .dir = QCA6174_HW_2_1_FW_DIR,
- .fw = QCA6174_HW_2_1_FW_FILE,
- .otp = QCA6174_HW_2_1_OTP_FILE,
- .board = QCA6174_HW_2_1_BOARD_DATA_FILE,
- .board_size = QCA6174_BOARD_DATA_SZ,
- .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
+ .dir = QCA61X4_HW_2_1_FW_DIR,
+ .fw = QCA61X4_HW_2_1_FW_FILE,
+ .otp = QCA61X4_HW_2_1_OTP_FILE,
+ .board = QCA61X4_HW_2_1_BOARD_DATA_FILE,
+ .board_size = QCA61X4_BOARD_DATA_SZ,
+ .board_ext_size = QCA61X4_BOARD_EXT_DATA_SZ,
},
},
{
- .id = QCA6174_HW_3_0_VERSION,
- .name = "qca6174 hw3.0",
- .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .id = QCA61X4_HW_3_0_VERSION,
+ .name = "qca61x4 hw3.0",
+ .patch_load_addr = QCA61X4_HW_3_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
.otp_exe_param = 0,
.fw = {
- .dir = QCA6174_HW_3_0_FW_DIR,
- .fw = QCA6174_HW_3_0_FW_FILE,
- .otp = QCA6174_HW_3_0_OTP_FILE,
- .board = QCA6174_HW_3_0_BOARD_DATA_FILE,
- .board_size = QCA6174_BOARD_DATA_SZ,
- .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
+ .dir = QCA61X4_HW_3_0_FW_DIR,
+ .fw = QCA61X4_HW_3_0_FW_FILE,
+ .otp = QCA61X4_HW_3_0_OTP_FILE,
+ .board = QCA61X4_HW_3_0_BOARD_DATA_FILE,
+ .board_size = QCA61X4_BOARD_DATA_SZ,
+ .board_ext_size = QCA61X4_BOARD_EXT_DATA_SZ,
},
},
{
- .id = QCA6174_HW_3_2_VERSION,
- .name = "qca6174 hw3.2",
- .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .id = QCA61X4_HW_3_2_VERSION,
+ .name = "qca61x4 hw3.2",
+ .patch_load_addr = QCA61X4_HW_3_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
.otp_exe_param = 0,
.fw = {
/* uses same binaries as hw3.0 */
- .dir = QCA6174_HW_3_0_FW_DIR,
- .fw = QCA6174_HW_3_0_FW_FILE,
- .otp = QCA6174_HW_3_0_OTP_FILE,
- .board = QCA6174_HW_3_0_BOARD_DATA_FILE,
- .board_size = QCA6174_BOARD_DATA_SZ,
- .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
+ .dir = QCA61X4_HW_3_0_FW_DIR,
+ .fw = QCA61X4_HW_3_0_FW_FILE,
+ .otp = QCA61X4_HW_3_0_OTP_FILE,
+ .board = QCA61X4_HW_3_0_BOARD_DATA_FILE,
+ .board_size = QCA61X4_BOARD_DATA_SZ,
+ .board_ext_size = QCA61X4_BOARD_EXT_DATA_SZ,
},
},
{
@@ -1629,9 +1629,9 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
ar->regs = &qca988x_regs;
ar->hw_values = &qca988x_values;
break;
- case ATH10K_HW_QCA6174:
- ar->regs = &qca6174_regs;
- ar->hw_values = &qca6174_values;
+ case ATH10K_HW_QCA61X4:
+ ar->regs = &qca61x4_regs;
+ ar->hw_values = &qca61x4_values;
break;
case ATH10K_HW_QCA99X0:
ar->regs = &qca99x0_regs;
diff --git a/drivers/net/wireless/ath/ath10k/hw.c b/drivers/net/wireless/ath/ath10k/hw.c
index fef7ccf6e185..8549e60c8f21 100644
--- a/drivers/net/wireless/ath/ath10k/hw.c
+++ b/drivers/net/wireless/ath/ath10k/hw.c
@@ -45,7 +45,7 @@ const struct ath10k_hw_regs qca988x_regs = {
.pcie_intr_clr_address = 0x00000014,
};

-const struct ath10k_hw_regs qca6174_regs = {
+const struct ath10k_hw_regs qca61x4_regs = {
.rtc_state_cold_reset_mask = 0x00002000,
.rtc_soc_base_address = 0x00000800,
.rtc_wmac_base_address = 0x00001000,
@@ -118,7 +118,7 @@ const struct ath10k_hw_values qca988x_values = {
.ce_desc_meta_data_lsb = 2,
};

-const struct ath10k_hw_values qca6174_values = {
+const struct ath10k_hw_values qca61x4_values = {
.rtc_state_val_on = 3,
.ce_count = 8,
.msi_assign_ce_max = 7,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index d9de4a738470..0fe3dc33d0f2 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -34,43 +34,43 @@
#define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
#define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234

-/* QCA6174 target BMI version signatures */
-#define QCA6174_HW_1_0_VERSION 0x05000000
-#define QCA6174_HW_1_1_VERSION 0x05000001
-#define QCA6174_HW_1_3_VERSION 0x05000003
-#define QCA6174_HW_2_1_VERSION 0x05010000
-#define QCA6174_HW_3_0_VERSION 0x05020000
-#define QCA6174_HW_3_2_VERSION 0x05030000
+/* QCA61X4 target BMI version signatures */
+#define QCA61X4_HW_1_0_VERSION 0x05000000
+#define QCA61X4_HW_1_1_VERSION 0x05000001
+#define QCA61X4_HW_1_3_VERSION 0x05000003
+#define QCA61X4_HW_2_1_VERSION 0x05010000
+#define QCA61X4_HW_3_0_VERSION 0x05020000
+#define QCA61X4_HW_3_2_VERSION 0x05030000

-enum qca6174_pci_rev {
- QCA6174_PCI_REV_1_1 = 0x11,
- QCA6174_PCI_REV_1_3 = 0x13,
- QCA6174_PCI_REV_2_0 = 0x20,
- QCA6174_PCI_REV_3_0 = 0x30,
+enum qca61x4_pci_rev {
+ QCA61X4_PCI_REV_1_1 = 0x11,
+ QCA61X4_PCI_REV_1_3 = 0x13,
+ QCA61X4_PCI_REV_2_0 = 0x20,
+ QCA61X4_PCI_REV_3_0 = 0x30,
};

-enum qca6174_chip_id_rev {
- QCA6174_HW_1_0_CHIP_ID_REV = 0,
- QCA6174_HW_1_1_CHIP_ID_REV = 1,
- QCA6174_HW_1_3_CHIP_ID_REV = 2,
- QCA6174_HW_2_1_CHIP_ID_REV = 4,
- QCA6174_HW_2_2_CHIP_ID_REV = 5,
- QCA6174_HW_3_0_CHIP_ID_REV = 8,
- QCA6174_HW_3_1_CHIP_ID_REV = 9,
- QCA6174_HW_3_2_CHIP_ID_REV = 10,
+enum qca61x4_chip_id_rev {
+ QCA61X4_HW_1_0_CHIP_ID_REV = 0,
+ QCA61X4_HW_1_1_CHIP_ID_REV = 1,
+ QCA61X4_HW_1_3_CHIP_ID_REV = 2,
+ QCA61X4_HW_2_1_CHIP_ID_REV = 4,
+ QCA61X4_HW_2_2_CHIP_ID_REV = 5,
+ QCA61X4_HW_3_0_CHIP_ID_REV = 8,
+ QCA61X4_HW_3_1_CHIP_ID_REV = 9,
+ QCA61X4_HW_3_2_CHIP_ID_REV = 10,
};

-#define QCA6174_HW_2_1_FW_DIR "ath10k/QCA6174/hw2.1"
-#define QCA6174_HW_2_1_FW_FILE "firmware.bin"
-#define QCA6174_HW_2_1_OTP_FILE "otp.bin"
-#define QCA6174_HW_2_1_BOARD_DATA_FILE "board.bin"
-#define QCA6174_HW_2_1_PATCH_LOAD_ADDR 0x1234
+#define QCA61X4_HW_2_1_FW_DIR "ath10k/QCA6174/hw2.1"
+#define QCA61X4_HW_2_1_FW_FILE "firmware.bin"
+#define QCA61X4_HW_2_1_OTP_FILE "otp.bin"
+#define QCA61X4_HW_2_1_BOARD_DATA_FILE "board.bin"
+#define QCA61X4_HW_2_1_PATCH_LOAD_ADDR 0x1234

-#define QCA6174_HW_3_0_FW_DIR "ath10k/QCA6174/hw3.0"
-#define QCA6174_HW_3_0_FW_FILE "firmware.bin"
-#define QCA6174_HW_3_0_OTP_FILE "otp.bin"
-#define QCA6174_HW_3_0_BOARD_DATA_FILE "board.bin"
-#define QCA6174_HW_3_0_PATCH_LOAD_ADDR 0x1234
+#define QCA61X4_HW_3_0_FW_DIR "ath10k/QCA6174/hw3.0"
+#define QCA61X4_HW_3_0_FW_FILE "firmware.bin"
+#define QCA61X4_HW_3_0_OTP_FILE "otp.bin"
+#define QCA61X4_HW_3_0_BOARD_DATA_FILE "board.bin"
+#define QCA61X4_HW_3_0_PATCH_LOAD_ADDR 0x1234

/* QCA99X0 1.0 definitions (unsupported) */
#define QCA99X0_HW_1_0_CHIP_ID_REV 0x0
@@ -161,7 +161,7 @@ enum ath10k_fw_htt_op_version {

enum ath10k_hw_rev {
ATH10K_HW_QCA988X,
- ATH10K_HW_QCA6174,
+ ATH10K_HW_QCA61X4,
ATH10K_HW_QCA99X0,
};

@@ -193,7 +193,7 @@ struct ath10k_hw_regs {
};

extern const struct ath10k_hw_regs qca988x_regs;
-extern const struct ath10k_hw_regs qca6174_regs;
+extern const struct ath10k_hw_regs qca61x4_regs;
extern const struct ath10k_hw_regs qca99x0_regs;

struct ath10k_hw_values {
@@ -206,14 +206,14 @@ struct ath10k_hw_values {
};

extern const struct ath10k_hw_values qca988x_values;
-extern const struct ath10k_hw_values qca6174_values;
+extern const struct ath10k_hw_values qca61x4_values;
extern const struct ath10k_hw_values qca99x0_values;

void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev);

#define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
-#define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
+#define QCA_REV_61X4(ar) ((ar)->hw_rev == ATH10K_HW_QCA61X4)
#define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)

/* Known pecularities:
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 49a7538325e3..10a5d72b9bff 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -77,17 +77,17 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
*/
{ QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV },

- { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV },
- { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_2_CHIP_ID_REV },
- { QCA6164_2_1_DEVICE_ID, QCA6174_HW_3_0_CHIP_ID_REV },
- { QCA6164_2_1_DEVICE_ID, QCA6174_HW_3_1_CHIP_ID_REV },
- { QCA6164_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA61X4_HW_2_1_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA61X4_HW_2_2_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA61X4_HW_3_0_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA61X4_HW_3_1_CHIP_ID_REV },
+ { QCA6164_2_1_DEVICE_ID, QCA61X4_HW_3_2_CHIP_ID_REV },

- { QCA6174_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV },
- { QCA6174_2_1_DEVICE_ID, QCA6174_HW_2_2_CHIP_ID_REV },
- { QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_0_CHIP_ID_REV },
- { QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_1_CHIP_ID_REV },
- { QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
+ { QCA6174_2_1_DEVICE_ID, QCA61X4_HW_2_1_CHIP_ID_REV },
+ { QCA6174_2_1_DEVICE_ID, QCA61X4_HW_2_2_CHIP_ID_REV },
+ { QCA6174_2_1_DEVICE_ID, QCA61X4_HW_3_0_CHIP_ID_REV },
+ { QCA6174_2_1_DEVICE_ID, QCA61X4_HW_3_1_CHIP_ID_REV },
+ { QCA6174_2_1_DEVICE_ID, QCA61X4_HW_3_2_CHIP_ID_REV },

{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
};
@@ -774,7 +774,7 @@ static u32 ath10k_pci_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)

switch (ar->hw_rev) {
case ATH10K_HW_QCA988X:
- case ATH10K_HW_QCA6174:
+ case ATH10K_HW_QCA61X4:
val = (ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
CORE_CTRL_ADDRESS) &
0x7ff) << 21;
@@ -1442,7 +1442,7 @@ static void ath10k_pci_irq_msi_fw_mask(struct ath10k *ar)

switch (ar->hw_rev) {
case ATH10K_HW_QCA988X:
- case ATH10K_HW_QCA6174:
+ case ATH10K_HW_QCA61X4:
val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
CORE_CTRL_ADDRESS);
val &= ~CORE_CTRL_PCIE_REG_31_MASK;
@@ -1463,7 +1463,7 @@ static void ath10k_pci_irq_msi_fw_unmask(struct ath10k *ar)

switch (ar->hw_rev) {
case ATH10K_HW_QCA988X:
- case ATH10K_HW_QCA6174:
+ case ATH10K_HW_QCA61X4:
val = ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
CORE_CTRL_ADDRESS);
val |= CORE_CTRL_PCIE_REG_31_MASK;
@@ -1823,16 +1823,16 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
case QCA6164_2_1_DEVICE_ID:
case QCA6174_2_1_DEVICE_ID:
switch (MS(ar->chip_id, SOC_CHIP_ID_REV)) {
- case QCA6174_HW_1_0_CHIP_ID_REV:
- case QCA6174_HW_1_1_CHIP_ID_REV:
- case QCA6174_HW_2_1_CHIP_ID_REV:
- case QCA6174_HW_2_2_CHIP_ID_REV:
+ case QCA61X4_HW_1_0_CHIP_ID_REV:
+ case QCA61X4_HW_1_1_CHIP_ID_REV:
+ case QCA61X4_HW_2_1_CHIP_ID_REV:
+ case QCA61X4_HW_2_2_CHIP_ID_REV:
return 3;
- case QCA6174_HW_1_3_CHIP_ID_REV:
+ case QCA61X4_HW_1_3_CHIP_ID_REV:
return 2;
- case QCA6174_HW_3_0_CHIP_ID_REV:
- case QCA6174_HW_3_1_CHIP_ID_REV:
- case QCA6174_HW_3_2_CHIP_ID_REV:
+ case QCA61X4_HW_3_0_CHIP_ID_REV:
+ case QCA61X4_HW_3_1_CHIP_ID_REV:
+ case QCA61X4_HW_3_2_CHIP_ID_REV:
return 9;
}
break;
@@ -2152,7 +2152,7 @@ static int ath10k_pci_warm_reset(struct ath10k *ar)

static int ath10k_pci_safe_chip_reset(struct ath10k *ar)
{
- if (QCA_REV_988X(ar) || QCA_REV_6174(ar)) {
+ if (QCA_REV_988X(ar) || QCA_REV_61X4(ar)) {
return ath10k_pci_warm_reset(ar);
} else if (QCA_REV_99X0(ar)) {
ath10k_pci_irq_disable(ar);
@@ -2236,13 +2236,13 @@ static int ath10k_pci_qca988x_chip_reset(struct ath10k *ar)
return 0;
}

-static int ath10k_pci_qca6174_chip_reset(struct ath10k *ar)
+static int ath10k_pci_qca61x4_chip_reset(struct ath10k *ar)
{
int ret;

- ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot qca6174 chip reset\n");
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot qca61x4 chip reset\n");

- /* FIXME: QCA6174 requires cold + warm reset to work. */
+ /* FIXME: QCA61X4 requires cold + warm reset to work. */

ret = ath10k_pci_cold_reset(ar);
if (ret) {
@@ -2263,7 +2263,7 @@ static int ath10k_pci_qca6174_chip_reset(struct ath10k *ar)
return ret;
}

- ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot qca6174 chip reset complete (cold)\n");
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot qca61x4 chip reset complete (cold)\n");

return 0;
}
@@ -2296,8 +2296,8 @@ static int ath10k_pci_chip_reset(struct ath10k *ar)
{
if (QCA_REV_988X(ar))
return ath10k_pci_qca988x_chip_reset(ar);
- else if (QCA_REV_6174(ar))
- return ath10k_pci_qca6174_chip_reset(ar);
+ else if (QCA_REV_61X4(ar))
+ return ath10k_pci_qca61x4_chip_reset(ar);
else if (QCA_REV_99X0(ar))
return ath10k_pci_qca99x0_chip_reset(ar);
else
@@ -2911,7 +2911,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
break;
case QCA6164_2_1_DEVICE_ID:
case QCA6174_2_1_DEVICE_ID:
- hw_rev = ATH10K_HW_QCA6174;
+ hw_rev = ATH10K_HW_QCA61X4;
break;
case QCA99X0_2_0_DEVICE_ID:
hw_rev = ATH10K_HW_QCA99X0;
@@ -3095,12 +3095,12 @@ MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API4_FILE);
MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API5_FILE);
MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_BOARD_DATA_FILE);

-/* QCA6174 2.1 firmware files */
-MODULE_FIRMWARE(QCA6174_HW_2_1_FW_DIR "/" ATH10K_FW_API4_FILE);
-MODULE_FIRMWARE(QCA6174_HW_2_1_FW_DIR "/" ATH10K_FW_API5_FILE);
-MODULE_FIRMWARE(QCA6174_HW_2_1_FW_DIR "/" QCA6174_HW_2_1_BOARD_DATA_FILE);
+/* QCA61X4 2.1 firmware files */
+MODULE_FIRMWARE(QCA61X4_HW_2_1_FW_DIR "/" ATH10K_FW_API4_FILE);
+MODULE_FIRMWARE(QCA61X4_HW_2_1_FW_DIR "/" ATH10K_FW_API5_FILE);
+MODULE_FIRMWARE(QCA61X4_HW_2_1_FW_DIR "/" QCA61X4_HW_2_1_BOARD_DATA_FILE);

-/* QCA6174 3.1 firmware files */
-MODULE_FIRMWARE(QCA6174_HW_3_0_FW_DIR "/" ATH10K_FW_API4_FILE);
-MODULE_FIRMWARE(QCA6174_HW_3_0_FW_DIR "/" ATH10K_FW_API5_FILE);
-MODULE_FIRMWARE(QCA6174_HW_3_0_FW_DIR "/" QCA6174_HW_3_0_BOARD_DATA_FILE);
+/* QCA61X4 3.1 firmware files */
+MODULE_FIRMWARE(QCA61X4_HW_3_0_FW_DIR "/" ATH10K_FW_API4_FILE);
+MODULE_FIRMWARE(QCA61X4_HW_3_0_FW_DIR "/" ATH10K_FW_API5_FILE);
+MODULE_FIRMWARE(QCA61X4_HW_3_0_FW_DIR "/" QCA61X4_HW_3_0_BOARD_DATA_FILE);
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 8d364fb8f743..b4d14e8a052f 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -248,7 +248,7 @@ u32 ath10k_pci_read32(struct ath10k *ar, u32 offset);
u32 ath10k_pci_soc_read32(struct ath10k *ar, u32 addr);
u32 ath10k_pci_reg_read32(struct ath10k *ar, u32 addr);

-/* QCA6174 is known to have Tx/Rx issues when SOC_WAKE register is poked too
+/* QCA61X4 is known to have Tx/Rx issues when SOC_WAKE register is poked too
* frequently. To avoid this put SoC to sleep after a very conservative grace
* period. Adjust with great care.
*/
diff --git a/drivers/net/wireless/ath/ath10k/rx_desc.h b/drivers/net/wireless/ath/ath10k/rx_desc.h
index ca8d16884af1..affabb26880d 100644
--- a/drivers/net/wireless/ath/ath10k/rx_desc.h
+++ b/drivers/net/wireless/ath/ath10k/rx_desc.h
@@ -959,7 +959,7 @@ struct rx_ppdu_end_qca988x {
#define RX_PPDU_END_RTT_UNUSED_LSB 24
#define RX_PPDU_END_RTT_NORMAL_MODE BIT(31)

-struct rx_ppdu_end_qca6174 {
+struct rx_ppdu_end_qca61x4 {
u8 locationing_timestamp;
u8 phy_err_code;
__le16 flags; /* %RX_PPDU_END_FLAGS_ */
@@ -1078,7 +1078,7 @@ struct rx_ppdu_end {
struct rx_ppdu_end_common common;
union {
struct rx_ppdu_end_qca988x qca988x;
- struct rx_ppdu_end_qca6174 qca6174;
+ struct rx_ppdu_end_qca61x4 qca61x4;
struct rx_ppdu_end_qca99x0 qca99x0;
} __packed;
} __packed;
diff --git a/drivers/net/wireless/ath/ath10k/targaddrs.h b/drivers/net/wireless/ath/ath10k/targaddrs.h
index 768bef629099..db6b86d1fcd2 100644
--- a/drivers/net/wireless/ath/ath10k/targaddrs.h
+++ b/drivers/net/wireless/ath/ath10k/targaddrs.h
@@ -447,8 +447,8 @@ Fw Mode/SubMode Mask
#define QCA988X_BOARD_DATA_SZ 7168
#define QCA988X_BOARD_EXT_DATA_SZ 0

-#define QCA6174_BOARD_DATA_SZ 8192
-#define QCA6174_BOARD_EXT_DATA_SZ 0
+#define QCA61X4_BOARD_DATA_SZ 8192
+#define QCA61X4_BOARD_EXT_DATA_SZ 0

#define QCA99X0_BOARD_DATA_SZ 12288
#define QCA99X0_BOARD_EXT_DATA_SZ 0
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index ad655c44afdb..21ef7d395aa0 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1135,7 +1135,7 @@ struct wmi_tlv_abi_version {

enum wmi_tlv_hw_bd_id {
WMI_TLV_HW_BD_LEGACY = 0,
- WMI_TLV_HW_BD_QCA6174 = 1,
+ WMI_TLV_HW_BD_QCA61X4 = 1,
WMI_TLV_HW_BD_QCA2582 = 2,
};
--
2.1.4
Kalle Valo
2015-08-14 08:27:23 UTC
Permalink
Post by Michal Kazior
This cleans up the naming a little bit. Both
QCA6174 and QCA6164 are in practice the same as
far as driving them is concerned.
Unfortunately firmware paths will need to stay
untouched, i.e. QCA6164 firmware will still be
looked for in QCA6174 to avoid breaking backward
compatibility with older /lib/firmware setups.
This is purely cosmetics and only visible to developers, users won't
notice anything, so I'm not sure if this is worth the trouble. With
proper documentation I would hope that any developer will realise that
QCA6174 actually also means QCA6164 support :)

And more to the point there is nothing preventing coming up with a new
version with a name like QCA6964 or QCA9121 so the prefix would be wrong
again. This has happened with ath6kl in the past.
Post by Michal Kazior
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -63,49 +63,49 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
},
},
{
- .id = QCA6174_HW_2_1_VERSION,
- .name = "qca6174 hw2.1",
- .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+ .id = QCA61X4_HW_2_1_VERSION,
+ .name = "qca61x4 hw2.1",
What if we instead change the name to "qca6164/qca6176 hw2.1" or
something like that. Would that help?
--
Kalle Valo
Kalle Valo
2015-08-26 09:10:51 UTC
Permalink
Post by Michal Kazior
This cleans up the naming a little bit. Both
QCA6174 and QCA6164 are in practice the same as
far as driving them is concerned.
Unfortunately firmware paths will need to stay
untouched, i.e. QCA6164 firmware will still be
looked for in QCA6174 to avoid breaking backward
compatibility with older /lib/firmware setups.
Based on my previous comments I'll drop this.
--
Kalle Valo
Kalle Valo
2015-08-18 11:30:46 UTC
Permalink
Post by Michal Kazior
This adds additional 0x0041 PCI Device ID
definition to ath10k for QCA6164 which is a 1
spatial stream sibling of the QCA6174 (which is 2
spatial stream chip).
The QCA6164 needs a dedicated board.bin file which
is different than the one used for QCA6174. If the
board.bin is wrong the device will crash early
while trying to boot firmware. The register dump
ath10k_pci 0000:02:00.0: [00]: 0x05010000 0x000015B3 0x000A012D 0x00955B31
...
Note the value 0x000A012D.
Special credit goes to Alan Liu
help which enabled me to come up with this patch.
As neither Michal nor me have QCA6174 and I'm reluctant to take untested
patches, it would be great if someone could test this and tell us how it
went. That way I feel safer to apply this.
--
Kalle Valo
Arnd Bergmann
2015-08-20 13:22:11 UTC
Permalink
I can confirm this patch did it for my Lenovo Yoga 3 14 with QCA6164, the
WLAN interface is now alive, up and running perfectly fine!
(After running modprobe -r ideapad-laptop that is, should anyone have
trouble enabling it)
I had tried all the board.bin files from the windows drivers before, so the
added sanity check seems to be what finally solved it.
I hope to test it in my Yoga 3 11 (1170) in the next days. Meanwhile, what is
the problem you see with the ideapad-laptop driver? I have recently submitted
a couple of bug fixes for the Yoga 1170, can you try if the patch below
fixes this for you?

Arnd

commit 9d6d311add697014bdccb18d625db7e38676adbf
Author: Arnd Bergmann <***@arndb.de>
Date: Sat Jun 13 15:13:11 2015 +0200

ideapad: add rfkill whitelist entry for Yoga 3 1170

This adds one more entry to the whitelist of machines that do not have
a physical rfkill switch. Unfortunately, the Yoga 3 generation seems
to use upper-case letters for the YOGA 3 Pro-1370, while it uses normal
capitalization for its Yoga 3 1170 sibling.

In order to catch all variants of the Yoga 3, I'm now using both strings
as wildcards here, which should also cover the 1470 model, and possible
changes in the string that could happen in firmware updates.

Signed-off-by: Arnd Bergmann <***@arndb.de>

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index cb7cd8d79329..8e455c1429ee 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -855,7 +855,14 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
.ident = "Lenovo Yoga 3 Pro 1370",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3 Pro-1370"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"),
+ },
+ },
+ {
+ .ident = "Lenovo Yoga 3 1170 / 1470",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3"),
},
},
{}
Kalle Valo
2015-08-25 13:00:20 UTC
Permalink
I can confirm this patch did it for my Lenovo Yoga 3 14 with QCA6164, the
WLAN interface is now alive, up and running perfectly fine!
(After running modprobe -r ideapad-laptop that is, should anyone have
trouble enabling it)
I had tried all the board.bin files from the windows drivers before, so the
added sanity check seems to be what finally solved it.
Odd, I didn't see this mail from Oscar and almost missed it. Maybe the
mailing list blocked it?

Anyway, thanks for testing. I'll try to get patch 1 to Linux 4.3 so that
it would have proper qca6164 support. If there are issues still, we can
fix those in a followup patch.
--
Kalle Valo
Arnd Bergmann
2015-08-25 12:56:06 UTC
Permalink
Hi everyone,
Looks like ath10k is very close to finally support
qca6164. Recent discussion[1] led to a working
prototype[2][3].
I'm CCing everyone I've found in my mailbox that
complained about QCA6164 not working. Hopefully I
did not miss anyone.
I would really like to know if this patchset (in
its current shape and form) of mine works for any
of you who owns QCA6164. If it doesn't please try
Patch [1/2] only.
Today Kalle posted QCA6174 (which is actually
QCA61X4) firmware binary for ath10k[4]. Please use
it to test QCA6164 (i.e. don't use sumdog's
firmware nor your own assembled one).
However QCA6164 requires a different board.bin
file[3]. This requires some additional changes in
ath10k to support sanely but *for now* you can use
board file vvanpo extracted from window driver[5]
/lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin
This should work. If it doesn't, try replacing the
existing board.bin - if you'll need to do please
let me/us know and post the boot string which
ath10k_pci 0000:03:00.0: qca6174 hw2.1 (0x05010000, 0x003405ff, 168c:0041:17aa:3545 fallback) fw killer-n1525-fw api 5 htt-ver 0.0 wmi-op 4 htt-op 3 cal otp max-sta 32 raw 0 hwcrypto 1 features
My guess is some devices may have different
subsystem product/vendor ids. It'll be good to
know at least a subset of those for reference.
Hi Michael,

I have now put the qca6164 card back into my Lenovo Yoga 3 11 (1170)
and tried your first patch from your email on top of 4d43636271
("Merge remote-tracking branch 'wireless-testing/master'") from Kalle.

It looks like I'm still getting firmware crashes with the firmware
files you pointed to:

$ md5sum /lib/firmware/ath10k/QCA6174/hw2.1/*
e6adc90ecaf55edc656990c6c50193ac /lib/firmware/ath10k/QCA6174/hw2.1/board.bin
e6adc90ecaf55edc656990c6c50193ac /lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin
8f5303e4b1afc818798425a700139133 /lib/firmware/ath10k/QCA6174/hw2.1/firmware-5.bin

$ sudo modprobe ath10k-core debug_mask=0xffffbfff skip_otp=1
$ sudo modprobe ath10k-pci
$ dmesg

[ 2213.448180] ath10k_pci 0000:02:00.0: pci remove
[ 2217.606063] ath10k_pci 0000:02:00.0: pci probe
[ 2217.606231] ath10k_pci 0000:02:00.0: boot pci_mem 0xffffc90001800000
[ 2217.606623] ath10k_pci 0000:02:00.0: pci irq msi-x interrupts 8 irq_mode 0 reset_mode 0
[ 2217.606767] ath10k_pci 0000:02:00.0: boot qca6174 chip reset
[ 2217.606770] ath10k_pci 0000:02:00.0: boot cold reset
[ 2217.654621] ath10k_pci 0000:02:00.0: boot cold reset complete
[ 2217.654630] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2217.654638] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2217.654646] ath10k_pci 0000:02:00.0: boot target initialised
[ 2217.654650] ath10k_pci 0000:02:00.0: boot warm reset
[ 2217.686575] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2217.686597] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2217.686614] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2217.686633] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2217.686656] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2217.686675] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2217.686690] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2217.686694] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2217.686699] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2217.696630] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2217.696636] ath10k_pci 0000:02:00.0: boot target initialised
[ 2217.710686] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2217.710708] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2217.710725] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2217.710744] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2217.710767] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2217.710785] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2217.710801] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2217.710805] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2217.710811] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2217.720741] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2217.720747] ath10k_pci 0000:02:00.0: boot target initialised
[ 2217.720748] ath10k_pci 0000:02:00.0: boot warm reset complete
[ 2217.720749] ath10k_pci 0000:02:00.0: boot qca6174 chip reset complete (cold)
[ 2217.720781] ath10k_pci 0000:02:00.0: boot hif power up
[ 2217.720790] ath10k_pci 0000:02:00.0: boot qca6174 chip reset
[ 2217.720792] ath10k_pci 0000:02:00.0: boot cold reset
[ 2217.766698] ath10k_pci 0000:02:00.0: boot cold reset complete
[ 2217.766706] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2217.766714] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2217.766723] ath10k_pci 0000:02:00.0: boot target initialised
[ 2217.766726] ath10k_pci 0000:02:00.0: boot warm reset
[ 2217.798743] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2217.798766] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2217.798782] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2217.798801] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2217.798824] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2217.798843] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2217.798858] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2217.798862] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2217.798868] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2217.808798] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2217.808804] ath10k_pci 0000:02:00.0: boot target initialised
[ 2217.822763] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2217.822786] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2217.822803] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2217.822822] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2217.822845] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2217.822863] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2217.822879] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2217.822883] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2217.822888] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2217.832819] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2217.832825] ath10k_pci 0000:02:00.0: boot target initialised
[ 2217.832826] ath10k_pci 0000:02:00.0: boot warm reset complete
[ 2217.832828] ath10k_pci 0000:02:00.0: boot qca6174 chip reset complete (cold)
[ 2217.832841] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2217.832852] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2217.832864] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2217.832877] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2217.832891] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2217.832904] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2217.832915] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2217.843910] ath10k_pci 0000:02:00.0: bmi get target info
[ 2217.844158] ath10k_pci 0000:02:00.0: Hardware name qca6174 hw2.1 version 0x5010000
[ 2217.844172] ath10k_pci 0000:02:00.0: Direct firmware load for ath10k/cal-pci-0000:02:00.0.bin failed with error -2
[ 2217.844174] ath10k_pci 0000:02:00.0: Falling back to user helper
[ 2217.844559] ath10k_pci 0000:02:00.0: found specific board file for 168c:0041:17aa:3545
[ 2217.844562] ath10k_pci 0000:02:00.0: trying fw api 5
[ 2217.844679] ath10k_pci 0000:02:00.0: found fw version WLAN.RM.1.1-00141
[ 2217.844681] ath10k_pci 0000:02:00.0: found fw timestamp 1439305604
[ 2217.844683] ath10k_pci 0000:02:00.0: found otp image ie (29533 B)
[ 2217.844684] ath10k_pci 0000:02:00.0: found fw image ie (469603 B)
[ 2217.844686] ath10k_pci 0000:02:00.0: found firmware features ie (2 B)
[ 2217.844687] ath10k_pci 0000:02:00.0: Enabling feature bit: 7
[ 2217.844688] ath10k_pci 0000:02:00.0: Enabling feature bit: 8
[ 2217.844690] ath10k_pci 0000:02:00.0: features
[ 2217.844692] ath10k_pci 0000:02:00.0: 00000000: 80 01 00 00 00 00 00 00 ........
[ 2217.844693] ath10k_pci 0000:02:00.0: found fw ie wmi op version 4
[ 2217.844695] ath10k_pci 0000:02:00.0: using fw api 5
[ 2217.844697] ath10k_pci 0000:02:00.0: bmi start
[ 2217.844699] ath10k_pci 0000:02:00.0: bmi write address 0x400800 length 4
[ 2217.844707] ath10k_pci 0000:02:00.0: bmi read address 0x400810 length 4
[ 2217.844792] ath10k_pci 0000:02:00.0: bmi write address 0x400810 length 4
[ 2217.844799] ath10k_pci 0000:02:00.0: bmi write address 0x400844 length 4
[ 2217.844849] ath10k_pci 0000:02:00.0: bmi write address 0x400904 length 4
[ 2217.844892] This the patched kernel -Anish
[ 2217.844894] ath10k_pci 0000:02:00.0: bmi write address 0x4008bc length 4
[ 2217.844936] ath10k_pci 0000:02:00.0: boot did not find a calibration file, try DT next: -11
[ 2217.844937] ath10k_pci 0000:02:00.0: boot did not find DT entry, try OTP next: -2
[ 2217.844939] ath10k_pci 0000:02:00.0: bmi read address 0x4008ac length 4
[ 2217.845017] ath10k_pci 0000:02:00.0: boot push board extended data addr 0x0
[ 2217.845019] ath10k_pci 0000:02:00.0: bmi read address 0x400854 length 4
[ 2217.845070] ath10k_pci 0000:02:00.0: bmi write address 0x401d40 length 8124
[ 2217.860880] ath10k_pci 0000:02:00.0: bmi write address 0x400858 length 4
[ 2217.861043] ath10k_pci 0000:02:00.0: boot upload otp to 0x1234 len 29533
[ 2217.861047] ath10k_pci 0000:02:00.0: bmi fast download address 0x1234 buffer 0xffffc9000147003c length 29533
[ 2217.861049] ath10k_pci 0000:02:00.0: bmi lz stream start address 0x1234
[ 2217.861084] ath10k_pci 0000:02:00.0: bmi lz data buffer 0xffffc9000147003c length 29532
[ 2217.921837] ath10k_pci 0000:02:00.0: bmi lz data buffer 0xffff880156d1fd2c length 4
[ 2217.921914] ath10k_pci 0000:02:00.0: bmi lz stream start address 0x0
[ 2217.921959] ath10k_pci 0000:02:00.0: bmi execute address 0x1234 param 0x0
[ 2217.923520] ath10k_pci 0000:02:00.0: bmi execute result 0x3
[ 2217.923524] ath10k_pci 0000:02:00.0: boot otp execute result 3
[ 2217.923527] ath10k_pci 0000:02:00.0: boot using calibration mode otp
[ 2217.923531] ath10k_pci 0000:02:00.0: boot uploading firmware image ffffc900014773a4 len 469603 mode normal
[ 2217.923534] ath10k_pci 0000:02:00.0: bmi fast download address 0x1234 buffer 0xffffc900014773a4 length 469603
[ 2217.923537] ath10k_pci 0000:02:00.0: bmi lz stream start address 0x1234
[ 2217.923547] ath10k_pci 0000:02:00.0: bmi lz data buffer 0xffffc900014773a4 length 469600
[ 2218.992790] ath10k_pci 0000:02:00.0: bmi lz data buffer 0xffff880156d1fd2c length 4
[ 2218.993071] ath10k_pci 0000:02:00.0: bmi lz stream start address 0x0
[ 2218.993116] ath10k_pci 0000:02:00.0: bmi write address 0x400814 length 4
[ 2218.993150] ath10k_pci 0000:02:00.0: pci hif set callbacks
[ 2218.993153] ath10k_pci 0000:02:00.0: pci hif get default pipe
[ 2218.993155] ath10k_pci 0000:02:00.0: pci hif map service
[ 2218.993158] ath10k_pci 0000:02:00.0: bmi done
[ 2218.993193] ath10k_pci 0000:02:00.0: htt tx max num pending tx 1056
[ 2218.993212] ath10k_pci 0000:02:00.0: htt rx ring size 2048 fill_level 1023
[ 2218.993214] ath10k_pci 0000:02:00.0: boot hif start
[ 2218.993232] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2218.993750] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2219.992233] ath10k_pci 0000:02:00.0: failed to receive control response completion, polling..
[ 2219.992242] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992271] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992280] ath10k_pci 0000:02:00.0: pci rx ce pipe 1 len 20
[ 2219.992286] ath10k_pci 0000:02:00.0: pci rx: 00000000: 00 00 0c 00 00 00 00 00 01 00 02 00 00 07 16 00 ................
[ 2219.992291] ath10k_pci 0000:02:00.0: pci rx: 00000010: 01 00 00 00 ....
[ 2219.992301] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992307] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992313] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992319] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992323] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992327] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992335] ath10k_pci 0000:02:00.0: Target ready! transmit resources: 2 size:1792
[ 2219.992339] ath10k_pci 0000:02:00.0: pci hif map service
[ 2219.992344] ath10k_pci 0000:02:00.0: boot htc service 'Control' ul pipe 0 dl pipe 1 eid 0 ready
[ 2219.992348] ath10k_pci 0000:02:00.0: boot htc ep 0 ul polled 0 dl polled 0
[ 2219.992352] ath10k_pci 0000:02:00.0: boot htc service 'Control' eid 0 TX flow control disabled
[ 2219.992357] ath10k_pci 0000:02:00.0: boot htc service HTT Data does not allocate target credits
[ 2219.992363] ath10k_pci 0000:02:00.0: ath10k_htc_build_tx_ctrl_skb: skb ffff88009738d900
[ 2219.992369] ath10k_pci 0000:02:00.0: pci tx item 0 paddr 0x9ae95800 len 16 n_items 1
[ 2219.992374] ath10k_pci 0000:02:00.0: pci tx data: 00000000: 00 01 08 00 74 00 0c 00 02 00 00 03 08 00 00 00 ....t...........
[ 2219.992401] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2219.992431] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2220.993005] ath10k_pci 0000:02:00.0: Service connect timeout
[ 2220.993017] ath10k_pci 0000:02:00.0: failed to connect htt (-110)
[ 2220.993023] ath10k_pci 0000:02:00.0: boot hif stop
[ 2220.993028] ath10k_pci 0000:02:00.0: boot warm reset
[ 2221.025082] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2221.025103] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2221.025119] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2221.025137] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2221.025159] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2221.025177] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2221.025191] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2221.025195] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2221.025200] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2221.035130] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2221.035137] ath10k_pci 0000:02:00.0: boot target initialised
[ 2221.049108] ath10k_pci 0000:02:00.0: boot init ce src ring id 0 entries 16 base_addr ffff8800977d4000
[ 2221.049133] ath10k_pci 0000:02:00.0: boot ce dest ring id 1 entries 512 base_addr ffff88002a03e000
[ 2221.049152] ath10k_pci 0000:02:00.0: boot ce dest ring id 2 entries 128 base_addr ffff880097110000
[ 2221.049173] ath10k_pci 0000:02:00.0: boot init ce src ring id 3 entries 32 base_addr ffff8800972a4000
[ 2221.049199] ath10k_pci 0000:02:00.0: boot init ce src ring id 4 entries 4096 base_addr ffff880061030000
[ 2221.049220] ath10k_pci 0000:02:00.0: boot init ce src ring id 7 entries 2 base_addr ffff880061246000
[ 2221.049237] ath10k_pci 0000:02:00.0: boot ce dest ring id 7 entries 2 base_addr ffff880061247000
[ 2221.049241] ath10k_pci 0000:02:00.0: boot waiting target to initialise
[ 2221.049247] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2221.059178] ath10k_pci 0000:02:00.0: boot target indicator 0
[ 2221.069108] ath10k_pci 0000:02:00.0: boot target indicator 2
[ 2221.069114] ath10k_pci 0000:02:00.0: boot target initialised
[ 2221.069116] ath10k_pci 0000:02:00.0: boot warm reset complete
[ 2221.069185] ath10k_pci 0000:02:00.0: ath10k_htc_notify_tx_completion: ep 0 skb ffff88009738d900
[ 2221.069522] ath10k_pci 0000:02:00.0: could not init core (-110)
[ 2221.069555] ath10k_pci 0000:02:00.0: boot hif power down
[ 2221.069556] ath10k_pci 0000:02:00.0: could not probe fw (-110)

It's quite possible that I did not follow all steps correctly

Arnd
Michal Kazior
2015-08-25 13:09:45 UTC
Permalink
Post by Arnd Bergmann
Hi everyone,
Looks like ath10k is very close to finally support
qca6164. Recent discussion[1] led to a working
prototype[2][3].
I'm CCing everyone I've found in my mailbox that
complained about QCA6164 not working. Hopefully I
did not miss anyone.
I would really like to know if this patchset (in
its current shape and form) of mine works for any
of you who owns QCA6164. If it doesn't please try
Patch [1/2] only.
Today Kalle posted QCA6174 (which is actually
QCA61X4) firmware binary for ath10k[4]. Please use
it to test QCA6164 (i.e. don't use sumdog's
firmware nor your own assembled one).
However QCA6164 requires a different board.bin
file[3]. This requires some additional changes in
ath10k to support sanely but *for now* you can use
board file vvanpo extracted from window driver[5]
/lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin
This should work. If it doesn't, try replacing the
existing board.bin - if you'll need to do please
let me/us know and post the boot string which
ath10k_pci 0000:03:00.0: qca6174 hw2.1 (0x05010000, 0x003405ff, 168c:0041:17aa:3545 fallback) fw killer-n1525-fw api 5 htt-ver 0.0 wmi-op 4 htt-op 3 cal otp max-sta 32 raw 0 hwcrypto 1 features
My guess is some devices may have different
subsystem product/vendor ids. It'll be good to
know at least a subset of those for reference.
Hi Michael,
I have now put the qca6164 card back into my Lenovo Yoga 3 11 (1170)
and tried your first patch from your email on top of 4d43636271
("Merge remote-tracking branch 'wireless-testing/master'") from Kalle.
It looks like I'm still getting firmware crashes with the firmware
$ md5sum /lib/firmware/ath10k/QCA6174/hw2.1/*
e6adc90ecaf55edc656990c6c50193ac /lib/firmware/ath10k/QCA6174/hw2.1/board.bin
e6adc90ecaf55edc656990c6c50193ac /lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin
8f5303e4b1afc818798425a700139133 /lib/firmware/ath10k/QCA6174/hw2.1/firmware-5.bin
$ sudo modprobe ath10k-core debug_mask=0xffffbfff skip_otp=1
$ sudo modprobe ath10k-pci
$ dmesg
[ 2213.448180] ath10k_pci 0000:02:00.0: pci remove
[ 2217.606063] ath10k_pci 0000:02:00.0: pci probe
[ 2217.606231] ath10k_pci 0000:02:00.0: boot pci_mem 0xffffc90001800000
[ 2217.606623] ath10k_pci 0000:02:00.0: pci irq msi-x interrupts 8 irq_mode 0 reset_mode 0
[...]
Post by Arnd Bergmann
[ 2218.993214] ath10k_pci 0000:02:00.0: boot hif start
[ 2218.993232] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2218.993750] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2219.992233] ath10k_pci 0000:02:00.0: failed to receive control response completion, polling..
[ 2219.992242] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992271] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992280] ath10k_pci 0000:02:00.0: pci rx ce pipe 1 len 20
[ 2219.992286] ath10k_pci 0000:02:00.0: pci rx: 00000000: 00 00 0c 00 00 00 00 00 01 00 02 00 00 07 16 00 ................
[ 2219.992291] ath10k_pci 0000:02:00.0: pci rx: 00000010: 01 00 00 00 ....
[ 2219.992301] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992307] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992313] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992319] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992323] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992327] ath10k_pci 0000:02:00.0: pci hif send complete check
[ 2219.992335] ath10k_pci 0000:02:00.0: Target ready! transmit resources: 2 size:1792
[ 2219.992339] ath10k_pci 0000:02:00.0: pci hif map service
[ 2219.992344] ath10k_pci 0000:02:00.0: boot htc service 'Control' ul pipe 0 dl pipe 1 eid 0 ready
[ 2219.992348] ath10k_pci 0000:02:00.0: boot htc ep 0 ul polled 0 dl polled 0
[ 2219.992352] ath10k_pci 0000:02:00.0: boot htc service 'Control' eid 0 TX flow control disabled
[ 2219.992357] ath10k_pci 0000:02:00.0: boot htc service HTT Data does not allocate target credits
[ 2219.992363] ath10k_pci 0000:02:00.0: ath10k_htc_build_tx_ctrl_skb: skb ffff88009738d900
[ 2219.992369] ath10k_pci 0000:02:00.0: pci tx item 0 paddr 0x9ae95800 len 16 n_items 1
[ 2219.992374] ath10k_pci 0000:02:00.0: pci tx data: 00000000: 00 01 08 00 74 00 0c 00 02 00 00 03 08 00 00 00 ....t...........
[ 2219.992401] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
[ 2219.992431] ath10k_pci 0000:02:00.0: received unsolicited fw crash interrupt
This is some weird regression with MSI ranges and we still haven't
figured this out.

For the time being add "irq_mode=1" parameter when loading ath10k_pci
module, please.


MichaƂ
Arnd Bergmann
2015-08-25 13:47:45 UTC
Permalink
Post by Michal Kazior
This is some weird regression with MSI ranges and we still haven't
figured this out.
For the time being add "irq_mode=1" parameter when loading ath10k_pci
module, please.
Ok, that gets the device to show up without errors. I have no
time to test whether I can actually use it at the moment, will
report back later.

Thanks!

Arnd
Arnd Bergmann
2015-08-25 18:24:57 UTC
Permalink
Post by Arnd Bergmann
Post by Michal Kazior
This is some weird regression with MSI ranges and we still haven't
figured this out.
For the time being add "irq_mode=1" parameter when loading ath10k_pci
module, please.
Ok, that gets the device to show up without errors. I have no
time to test whether I can actually use it at the moment, will
report back later.
I tested some more and everything seems fine now when using legacy
interrupts. Thanks for all the work that went into this, I hope
the patch can make it into 4.3.

Arnd
Kalle Valo
2015-08-26 09:44:25 UTC
Permalink
Post by Arnd Bergmann
Post by Arnd Bergmann
Post by Michal Kazior
This is some weird regression with MSI ranges and we still haven't
figured this out.
For the time being add "irq_mode=1" parameter when loading ath10k_pci
module, please.
Ok, that gets the device to show up without errors. I have no
time to test whether I can actually use it at the moment, will
report back later.
I tested some more and everything seems fine now when using legacy
interrupts. Thanks for all the work that went into this, I hope
the patch can make it into 4.3.
I'm planning to send a pull request to Dave later today so this patch
should make it to 4.3. Sorry for taking so long to fix this.
--
Kalle Valo
Kalle Valo
2015-08-26 09:09:51 UTC
Permalink
Post by Michal Kazior
This adds additional 0x0041 PCI Device ID
definition to ath10k for QCA6164 which is a 1
spatial stream sibling of the QCA6174 (which is 2
spatial stream chip).
The QCA6164 needs a dedicated board.bin file which
is different than the one used for QCA6174. If the
board.bin is wrong the device will crash early
while trying to boot firmware. The register dump
ath10k_pci 0000:02:00.0: [00]: 0x05010000 0x000015B3 0x000A012D 0x00955B31
...
Note the value 0x000A012D.
Special credit goes to Alan Liu
help which enabled me to come up with this patch.
Thanks, applied.
--
Kalle Valo
Loading...