Commit 1e4ac717 authored by Baochen Qiang's avatar Baochen Qiang Committed by Kalle Valo

ath11k: enable PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability

In Qualcomm ARM platforms there is WL_EN pin and other power regulators
which can be controlled at platform side to completely reset the chip.
For most of x86 and other platforms, the chip is connected via PCIe M.2
interface, and there is no way to control WL_EN pin. Instead the host
driver needs to reset the chip via PCIE_SOC_GLOBAL_RESET hardware
register, just like ath11k does currently.

But when using PCIE_SOC_GLOBAL_RESET there are some hardware registers
which are not cleared/restored. To handle those cases we can enable
PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability to tell the firmware
to do some platform specific operations after firmware download.

This does not fix any known issues, but is recommended by the firmware
team, so enable the capability on QCA6390 and WCN6855 PCI devices. It is
currently unclear if this should be enabled also on QCN9074, so leave it
disabled for now. On AHB devices this is not needed as they don't use
PCIE_SOC_GLOBAL_RESET.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
Signed-off-by: default avatarBaochen Qiang <bqiang@codeaurora.org>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211011055602.77342-1-bqiang@codeaurora.org
parent 0d7a8a62
...@@ -100,6 +100,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -100,6 +100,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.fw_wmi_diag_event = false, .fw_wmi_diag_event = false,
.current_cc_support = false, .current_cc_support = false,
.dbr_debug_support = true, .dbr_debug_support = true,
.global_reset = false,
}, },
{ {
.hw_rev = ATH11K_HW_IPQ6018_HW10, .hw_rev = ATH11K_HW_IPQ6018_HW10,
...@@ -166,6 +167,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -166,6 +167,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.fw_wmi_diag_event = false, .fw_wmi_diag_event = false,
.current_cc_support = false, .current_cc_support = false,
.dbr_debug_support = true, .dbr_debug_support = true,
.global_reset = false,
}, },
{ {
.name = "qca6390 hw2.0", .name = "qca6390 hw2.0",
...@@ -231,6 +233,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -231,6 +233,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.fw_wmi_diag_event = true, .fw_wmi_diag_event = true,
.current_cc_support = true, .current_cc_support = true,
.dbr_debug_support = false, .dbr_debug_support = false,
.global_reset = true,
}, },
{ {
.name = "qcn9074 hw1.0", .name = "qcn9074 hw1.0",
...@@ -296,6 +299,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -296,6 +299,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.fw_wmi_diag_event = false, .fw_wmi_diag_event = false,
.current_cc_support = false, .current_cc_support = false,
.dbr_debug_support = true, .dbr_debug_support = true,
.global_reset = false,
}, },
{ {
.name = "wcn6855 hw2.0", .name = "wcn6855 hw2.0",
...@@ -361,6 +365,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -361,6 +365,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.fw_wmi_diag_event = true, .fw_wmi_diag_event = true,
.current_cc_support = true, .current_cc_support = true,
.dbr_debug_support = false, .dbr_debug_support = false,
.global_reset = true,
}, },
{ {
.name = "wcn6855 hw2.1", .name = "wcn6855 hw2.1",
...@@ -425,6 +430,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -425,6 +430,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.fw_wmi_diag_event = true, .fw_wmi_diag_event = true,
.current_cc_support = true, .current_cc_support = true,
.dbr_debug_support = false, .dbr_debug_support = false,
.global_reset = true,
}, },
}; };
......
...@@ -194,6 +194,7 @@ struct ath11k_hw_params { ...@@ -194,6 +194,7 @@ struct ath11k_hw_params {
bool fw_wmi_diag_event; bool fw_wmi_diag_event;
bool current_cc_support; bool current_cc_support;
bool dbr_debug_support; bool dbr_debug_support;
bool global_reset;
}; };
struct ath11k_hw_ops { struct ath11k_hw_ops {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02
#define HOST_CSTATE_BIT 0x04 #define HOST_CSTATE_BIT 0x04
#define PLATFORM_CAP_PCIE_GLOBAL_RESET 0x08
#define FW_BUILD_ID_MASK "QC_IMAGE_VERSION_STRING=" #define FW_BUILD_ID_MASK "QC_IMAGE_VERSION_STRING="
...@@ -1676,6 +1677,9 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab) ...@@ -1676,6 +1677,9 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab)
req.nm_modem |= SLEEP_CLOCK_SELECT_INTERNAL_BIT; req.nm_modem |= SLEEP_CLOCK_SELECT_INTERNAL_BIT;
} }
if (ab->hw_params.global_reset)
req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET;
ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n"); ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n");
ret = qmi_txn_init(&ab->qmi.handle, &txn, ret = qmi_txn_init(&ab->qmi.handle, &txn,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment