pci.c (7dc67af063e3f0237c864504bb2188ada753b804) pci.c (4e80946197a83a6115e308334618449b77696d6a)
1// SPDX-License-Identifier: BSD-3-Clause-Clear
2/*
3 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/module.h>
7#include <linux/msi.h>
8#include <linux/pci.h>

--- 21 unchanged lines hidden (view full) ---

30
31/* BAR0 + 4k is always accessible, and no
32 * need to force wakeup.
33 * 4K - 32 = 0xFE0
34 */
35#define ACCESS_ALWAYS_OFF 0xFE0
36
37#define QCA6390_DEVICE_ID 0x1101
1// SPDX-License-Identifier: BSD-3-Clause-Clear
2/*
3 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/module.h>
7#include <linux/msi.h>
8#include <linux/pci.h>

--- 21 unchanged lines hidden (view full) ---

30
31/* BAR0 + 4k is always accessible, and no
32 * need to force wakeup.
33 * 4K - 32 = 0xFE0
34 */
35#define ACCESS_ALWAYS_OFF 0xFE0
36
37#define QCA6390_DEVICE_ID 0x1101
38#define QCN9074_DEVICE_ID 0x1104
38
39static const struct pci_device_id ath11k_pci_id_table[] = {
40 { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) },
39
40static const struct pci_device_id ath11k_pci_id_table[] = {
41 { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) },
42 /* TODO: add QCN9074_DEVICE_ID) once firmware issues are resolved */
41 {0}
42};
43
44MODULE_DEVICE_TABLE(pci, ath11k_pci_id_table);
45
46static const struct ath11k_bus_params ath11k_pci_bus_params = {
47 .mhi_support = true,
48 .m3_fw_support = true,

--- 7 unchanged lines hidden (view full) ---

56 .total_users = 4,
57 .users = (struct ath11k_msi_user[]) {
58 { .name = "MHI", .num_vectors = 3, .base_vector = 0 },
59 { .name = "CE", .num_vectors = 10, .base_vector = 3 },
60 { .name = "WAKE", .num_vectors = 1, .base_vector = 13 },
61 { .name = "DP", .num_vectors = 18, .base_vector = 14 },
62 },
63 },
43 {0}
44};
45
46MODULE_DEVICE_TABLE(pci, ath11k_pci_id_table);
47
48static const struct ath11k_bus_params ath11k_pci_bus_params = {
49 .mhi_support = true,
50 .m3_fw_support = true,

--- 7 unchanged lines hidden (view full) ---

58 .total_users = 4,
59 .users = (struct ath11k_msi_user[]) {
60 { .name = "MHI", .num_vectors = 3, .base_vector = 0 },
61 { .name = "CE", .num_vectors = 10, .base_vector = 3 },
62 { .name = "WAKE", .num_vectors = 1, .base_vector = 13 },
63 { .name = "DP", .num_vectors = 18, .base_vector = 14 },
64 },
65 },
66 {
67 .total_vectors = 16,
68 .total_users = 3,
69 .users = (struct ath11k_msi_user[]) {
70 { .name = "MHI", .num_vectors = 3, .base_vector = 0 },
71 { .name = "CE", .num_vectors = 5, .base_vector = 3 },
72 { .name = "DP", .num_vectors = 8, .base_vector = 8 },
73 },
74 },
64};
65
66static const char *irq_name[ATH11K_IRQ_NUM_MAX] = {
67 "bhi",
68 "mhi-er0",
69 "mhi-er1",
70 "ce0",
71 "ce1",

--- 1140 unchanged lines hidden (view full) ---

1212 ab->hw_rev = ATH11K_HW_QCA6390_HW20;
1213 break;
1214 default:
1215 dev_err(&pdev->dev, "Unsupported QCA6390 SOC hardware version: %d %d\n",
1216 soc_hw_version_major, soc_hw_version_minor);
1217 ret = -EOPNOTSUPP;
1218 goto err_pci_free_region;
1219 }
75};
76
77static const char *irq_name[ATH11K_IRQ_NUM_MAX] = {
78 "bhi",
79 "mhi-er0",
80 "mhi-er1",
81 "ce0",
82 "ce1",

--- 1140 unchanged lines hidden (view full) ---

1223 ab->hw_rev = ATH11K_HW_QCA6390_HW20;
1224 break;
1225 default:
1226 dev_err(&pdev->dev, "Unsupported QCA6390 SOC hardware version: %d %d\n",
1227 soc_hw_version_major, soc_hw_version_minor);
1228 ret = -EOPNOTSUPP;
1229 goto err_pci_free_region;
1230 }
1231 ab_pci->msi_config = &ath11k_msi_config[0];
1220 break;
1232 break;
1233 case QCN9074_DEVICE_ID:
1234 ab_pci->msi_config = &ath11k_msi_config[1];
1235 ab->bus_params.static_window_map = true;
1236 ab->hw_rev = ATH11K_HW_QCN9074_HW10;
1237 break;
1221 default:
1222 dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n",
1223 pci_dev->device);
1224 ret = -EOPNOTSUPP;
1225 goto err_pci_free_region;
1226 }
1227
1238 default:
1239 dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n",
1240 pci_dev->device);
1241 ret = -EOPNOTSUPP;
1242 goto err_pci_free_region;
1243 }
1244
1228 ab_pci->msi_config = &ath11k_msi_config[0];
1229 ret = ath11k_pci_enable_msi(ab_pci);
1230 if (ret) {
1231 ath11k_err(ab, "failed to enable msi: %d\n", ret);
1232 goto err_pci_free_region;
1233 }
1234
1235 ret = ath11k_core_pre_init(ab);
1236 if (ret)

--- 158 unchanged lines hidden ---
1245 ret = ath11k_pci_enable_msi(ab_pci);
1246 if (ret) {
1247 ath11k_err(ab, "failed to enable msi: %d\n", ret);
1248 goto err_pci_free_region;
1249 }
1250
1251 ret = ath11k_core_pre_init(ab);
1252 if (ret)

--- 158 unchanged lines hidden ---