ath10k: add qca6164 support (Closes: #800703)

This commit is contained in:
Ben Hutchings 2015-10-04 00:49:40 +01:00
parent b532cf080d
commit f7856192d9
3 changed files with 121 additions and 0 deletions

1
debian/changelog vendored
View File

@ -8,6 +8,7 @@ linux (4.2.1-3) UNRELEASED; urgency=medium
* [mips*/octeon] Enable CAVIUM_CN63XXP1 (Closes: #800595)
* [mips*/octeon] Enable MMC, MMC_BLOCK, OCTEON_MMC and other drivers as
modules (Closes: #800594)
* ath10k: add qca6164 support (Closes: #800703)
[ Salvatore Bonaccorso ]
* ipc: Initialize msg/shm IPC objects before doing ipc_addid()

View File

@ -0,0 +1,119 @@
From: Michal Kazior <michal.kazior@tieto.com>
Date: Thu, 13 Aug 2015 14:32:26 +0200
Subject: ath10k: add qca6164 support
Origin: https://git.kernel.org/linus/36582e5d4daeccf68a8a3cef9bc37b60fb7d45b9
Bug-Debian: https://bugs.debian.org/800703
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
<alanliu@qca.qualcomm.com> for providing support
help which enabled me to come up with this patch.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
[bwh: Backported to 4.2: adjust context]
---
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(+)
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -233,6 +233,17 @@ static int ath10k_push_board_ext_data(st
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;
}
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -532,6 +532,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;
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -58,10 +58,12 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1
#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)
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 */
{0}
};
@@ -72,6 +74,13 @@ static const struct ath10k_pci_supp_chip
* 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 },
@@ -1688,6 +1697,7 @@ static int ath10k_pci_get_num_banks(stru
switch (ar_pci->pdev->device) {
case QCA988X_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:
@@ -2742,6 +2752,7 @@ static int ath10k_pci_probe(struct pci_d
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;
@@ -2763,6 +2774,7 @@ static int ath10k_pci_probe(struct pci_d
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),

View File

@ -103,3 +103,4 @@ bugfix/all/ovl-conditionally-use-o_largefile-in-ovl_copy_up.patch
bugfix/x86/alsa-hda-disable-power_save_node-for-thinkpads.patch
bugfix/all/netfilter-conntrack-use-nf_ct_tmpl_free-in-ct-synpro.patch
bugfix/all/Initialize-msg-shm-IPC-objects-before-doing-ipc_addi.patch
features/all/ath10k-add-qca6164-support.patch