Implement the MHI controller configuration for QCN9575. Add ath12k_wifi8_mhi_config_qcn9575 with IPCR channels 20 and 21 and control and data event rings in wifi8/mhi.c, and export it through wifi8/mhi.h. Update the QCN9575 hw params entry to use ath12k_wifi8_mhi_config_qcn9575. Build wifi8/mhi.c from wifi8/Makefile. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Signed-off-by: Madhavan Ganesan --- drivers/net/wireless/ath/ath12k/wifi8/Makefile | 1 + drivers/net/wireless/ath/ath12k/wifi8/hw.c | 3 +- drivers/net/wireless/ath/ath12k/wifi8/mhi.c | 70 ++++++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wifi8/mhi.h | 10 ++++ 4 files changed, 83 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/wifi8/Makefile b/drivers/net/wireless/ath/ath12k/wifi8/Makefile index b1b90c109c76..051c6447d35c 100644 --- a/drivers/net/wireless/ath/ath12k/wifi8/Makefile +++ b/drivers/net/wireless/ath/ath12k/wifi8/Makefile @@ -4,4 +4,5 @@ ath12k_wifi8-y += core.o \ hal.o \ hal_qcn9575.o \ hw.o \ + mhi.o \ pci.o diff --git a/drivers/net/wireless/ath/ath12k/wifi8/hw.c b/drivers/net/wireless/ath/ath12k/wifi8/hw.c index bffd1081fd2f..428d6b2b4418 100644 --- a/drivers/net/wireless/ath/ath12k/wifi8/hw.c +++ b/drivers/net/wireless/ath/ath12k/wifi8/hw.c @@ -13,6 +13,7 @@ #include "../mhi.h" #include "hal.h" #include "hw.h" +#include "mhi.h" static const struct ath12k_hw_params ath12k_wifi8_hw_params[] = { { @@ -64,7 +65,7 @@ static const struct ath12k_hw_params ath12k_wifi8_hw_params[] = { .num_tcl_banks = 0, .max_tx_ring = 0, - .mhi_config = NULL, + .mhi_config = &ath12k_wifi8_mhi_config_qcn9575, .wmi_init = NULL, diff --git a/drivers/net/wireless/ath/ath12k/wifi8/mhi.c b/drivers/net/wireless/ath/ath12k/wifi8/mhi.c new file mode 100644 index 000000000000..04eb1f1650c3 --- /dev/null +++ b/drivers/net/wireless/ath/ath12k/wifi8/mhi.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include "../mhi.h" +#include "mhi.h" + +static const struct mhi_channel_config ath12k_wifi8_mhi_channels_qcn9575[] = { + { + .num = 20, + .name = "IPCR", + .num_elements = 32, + .event_ring = 1, + .dir = DMA_TO_DEVICE, + .ee_mask = 0x4, + .pollcfg = 0, + .doorbell = MHI_DB_BRST_DISABLE, + .lpm_notify = false, + .offload_channel = false, + .doorbell_mode_switch = false, + }, + { + .num = 21, + .name = "IPCR", + .num_elements = 32, + .event_ring = 1, + .dir = DMA_FROM_DEVICE, + .ee_mask = 0x4, + .pollcfg = 0, + .doorbell = MHI_DB_BRST_DISABLE, + .lpm_notify = false, + .offload_channel = false, + .doorbell_mode_switch = false, + }, +}; + +static struct mhi_event_config ath12k_wifi8_mhi_events_qcn9575[] = { + { + .num_elements = 32, + .irq_moderation_ms = 0, + .irq = 1, + .data_type = MHI_ER_CTRL, + .mode = MHI_DB_BRST_DISABLE, + .hardware_event = false, + .client_managed = false, + .offload_channel = false, + }, + { + .num_elements = 256, + .irq_moderation_ms = 1, + .irq = 2, + .mode = MHI_DB_BRST_DISABLE, + .priority = 1, + .hardware_event = false, + .client_managed = false, + .offload_channel = false, + }, +}; + +const struct mhi_controller_config ath12k_wifi8_mhi_config_qcn9575 = { + .max_channels = 30, + .timeout_ms = 10000, + .use_bounce_buf = false, + .buf_len = 0, + .num_channels = ARRAY_SIZE(ath12k_wifi8_mhi_channels_qcn9575), + .ch_cfg = ath12k_wifi8_mhi_channels_qcn9575, + .num_events = ARRAY_SIZE(ath12k_wifi8_mhi_events_qcn9575), + .event_cfg = ath12k_wifi8_mhi_events_qcn9575, +}; diff --git a/drivers/net/wireless/ath/ath12k/wifi8/mhi.h b/drivers/net/wireless/ath/ath12k/wifi8/mhi.h new file mode 100644 index 000000000000..7a229ea378d2 --- /dev/null +++ b/drivers/net/wireless/ath/ath12k/wifi8/mhi.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: BSD-3-Clause-Clear */ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#ifndef _ATH12K_WIFI8_MHI_H +#define _ATH12K_WIFI8_MHI_H + +extern const struct mhi_controller_config ath12k_wifi8_mhi_config_qcn9575; +#endif /* _ATH12K_WIFI8_MHI_H */ -- 2.34.1