qcacmn: Initial changes for ipq9574 target compilation

Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
This commit is contained in:
Basamma Yakkanahalli
2021-06-13 15:32:44 +05:30
committed by Madan Koyyalamudi
parent 1db04afdb1
commit 00bcc8cbd3
20 changed files with 179 additions and 13 deletions

View File

@@ -104,6 +104,7 @@ static ssize_t ath_procfs_diag_read_legacy(struct file *file,
(tgt_info->target_type == TARGET_TYPE_QCA6490) ||
(tgt_info->target_type == TARGET_TYPE_QCA8074) ||
(tgt_info->target_type == TARGET_TYPE_QCA8074V2) ||
(tgt_info->target_type == TARGET_TYPE_QCA9574) ||
(tgt_info->target_type == TARGET_TYPE_QCN9000) ||
(tgt_info->target_type == TARGET_TYPE_QCN9224) ||
(tgt_info->target_type == TARGET_TYPE_QCN6122) ||
@@ -185,6 +186,7 @@ static ssize_t ath_procfs_diag_write_legacy(struct file *file,
(tgt_info->target_type == TARGET_TYPE_QCA6490) ||
(tgt_info->target_type == TARGET_TYPE_QCA8074) ||
(tgt_info->target_type == TARGET_TYPE_QCA8074V2) ||
(tgt_info->target_type == TARGET_TYPE_QCA9574) ||
(tgt_info->target_type == TARGET_TYPE_QCN9000) ||
(tgt_info->target_type == TARGET_TYPE_QCN9224) ||
(tgt_info->target_type == TARGET_TYPE_QCN6122) ||

View File

@@ -816,6 +816,71 @@ static struct CE_pipe_config target_ce_config_wlan_qca8074_pci[] = {
{ /* CE11 */ 11, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
};
static struct CE_attr host_ce_config_wlan_qca9574[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
/* target->host HTT + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
/* target->host WMI */
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
/* host->target WMI (mac0) */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
/* host->target HTT */
{ /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
/* target -> host PKTLOG */
#ifdef REMOVE_PKT_LOG
{ /* CE5 */ 0, 0, 0, 0, 0, NULL,},
#else
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
#endif
/* Target autonomous HIF_memcpy */
{ /* CE6 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, 0,
0, 0, NULL,},
/* host->target WMI (mac1) */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
/* Target to uMC */
{ /* CE8 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, 0, 0, 0, NULL,},
/* host->target WMI (mac2) */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
/* target->host HTT */
{ /* CE10 unused */ 0, 0, 0, 0, 0, NULL,},
{ /* CE11 unused */ 0, 0, 0, 0, 0, NULL,},
};
static struct CE_pipe_config target_ce_config_wlan_qca9574[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
/* target->host HTT */
{ /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
/* target->host WMI + HTC control */
{ /* CE2 */ 2, PIPEDIR_IN, T2H_WMI_RING_SIZE, 2048, CE_ATTR_FLAGS, 0,},
/* host->target WMI */
{ /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
/* host->target HTT */
{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
/* NB: 50% of src nentries, since tx has 2 frags */
/* Target -> host PKTLOG */
#ifdef REMOVE_PKT_LOG
{ /* CE5 */ 5, PIPEDIR_NONE, 0, 0, 0, 0,},
#else
{ /* CE5 */ 5, PIPEDIR_IN, 32, 2048, 0, 0,},
#endif
/* Reserved for target autonomous HIF_memcpy */
{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 65535, 64, 0,},
/* CE7 used only by Host */
{ /* CE7 */ 7, PIPEDIR_OUT, 32, 2048,
8192, 0,},
/* CE8 used only by IPA */
{ /* CE8 */ 8, PIPEDIR_INOUT, 32, 65535, 112, 0,},
/* CE9 target->host HTT */
{ /* CE9 */ 9, PIPEDIR_OUT, 32, 2048, 8192, 0,},
/* CE10 target->host HTT */
{/* CE10 unused */10, PIPEDIR_NONE, 0, 0, 0, 0,},
{/* CE11 unused */11, PIPEDIR_NONE, 0, 0, 0, 0,},
};
static struct CE_attr host_lowdesc_ce_config_wlan_adrastea_nopktlog[] = {
/* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},

View File

@@ -54,7 +54,8 @@
#if (defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6290) || \
defined(QCA_WIFI_QCA6018) || defined(QCA_WIFI_QCA5018) || \
defined(QCA_WIFI_WCN7850)) && !defined(QCA_WIFI_SUPPORT_SRNG)
defined(QCA_WIFI_WCN7850) || defined(QCA_WIFI_QCA9574)) && \
!defined(QCA_WIFI_SUPPORT_SRNG)
#define QCA_WIFI_SUPPORT_SRNG
#endif
@@ -767,6 +768,35 @@ static struct service_to_pipe target_service_to_ce_map_qca8074[] = {
};
#endif
#if (defined(QCA_WIFI_QCA9574))
static struct service_to_pipe target_service_to_ce_map_qca9574[] = {
{ WMI_DATA_VO_SVC, PIPEDIR_OUT, 3, },
{ WMI_DATA_VO_SVC, PIPEDIR_IN, 2, },
{ WMI_DATA_BK_SVC, PIPEDIR_OUT, 3, },
{ WMI_DATA_BK_SVC, PIPEDIR_IN, 2, },
{ WMI_DATA_BE_SVC, PIPEDIR_OUT, 3, },
{ WMI_DATA_BE_SVC, PIPEDIR_IN, 2, },
{ WMI_DATA_VI_SVC, PIPEDIR_OUT, 3, },
{ WMI_DATA_VI_SVC, PIPEDIR_IN, 2, },
{ WMI_CONTROL_SVC, PIPEDIR_OUT, 3, },
{ WMI_CONTROL_SVC, PIPEDIR_IN, 2, },
{ WMI_CONTROL_SVC_WMAC1, PIPEDIR_OUT, 7},
{ WMI_CONTROL_SVC_WMAC1, PIPEDIR_IN, 2},
{ HTC_CTRL_RSVD_SVC, PIPEDIR_OUT, 0, },
{ HTC_CTRL_RSVD_SVC, PIPEDIR_IN, 1, },
{ HTC_RAW_STREAMS_SVC, PIPEDIR_OUT, 0},
{ HTC_RAW_STREAMS_SVC, PIPEDIR_IN, 1 },
{ HTT_DATA_MSG_SVC, PIPEDIR_OUT, 4, },
{ HTT_DATA_MSG_SVC, PIPEDIR_IN, 1, },
{ PACKET_LOG_SVC, PIPEDIR_IN, 5, },
/* (Additions here) */
{ 0, 0, 0, },
};
#else
static struct service_to_pipe target_service_to_ce_map_qca9574[] = {
};
#endif
#if (defined(QCA_WIFI_QCA8074V2))
static struct service_to_pipe target_service_to_ce_map_qca8074_v2[] = {
{ WMI_DATA_VO_SVC, PIPEDIR_OUT, 3, },
@@ -1342,6 +1372,12 @@ static void hif_select_service_to_pipe_map(struct hif_softc *scn,
*sz_tgt_svc_map_to_use =
sizeof(target_service_to_ce_map_qca8074_v2);
break;
case TARGET_TYPE_QCA9574:
*tgt_svc_map_to_use =
target_service_to_ce_map_qca9574;
*sz_tgt_svc_map_to_use =
sizeof(target_service_to_ce_map_qca9574);
break;
case TARGET_TYPE_QCA6018:
*tgt_svc_map_to_use =
target_service_to_ce_map_qca6018;
@@ -1594,6 +1630,7 @@ bool ce_srng_based(struct hif_softc *scn)
case TARGET_TYPE_QCA5018:
case TARGET_TYPE_WCN7850:
case TARGET_TYPE_QCN9224:
case TARGET_TYPE_QCA9574:
return true;
default:
return false;
@@ -3832,6 +3869,12 @@ void hif_ce_prepare_config(struct hif_softc *scn)
sizeof(target_ce_config_wlan_qca5018);
scn->ce_count = QCA_5018_CE_COUNT;
break;
case TARGET_TYPE_QCA9574:
hif_state->host_ce_config = host_ce_config_wlan_qca9574;
hif_state->target_ce_config = target_ce_config_wlan_qca9574;
hif_state->target_ce_config_sz =
sizeof(target_ce_config_wlan_qca9574);
break;
case TARGET_TYPE_QCA6390:
hif_state->host_ce_config = host_ce_config_wlan_qca6390;
hif_state->target_ce_config = target_ce_config_wlan_qca6390;

View File

@@ -40,7 +40,7 @@
#include "hif_debug.h"
#include "mp_dev.h"
#if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) || \
defined(QCA_WIFI_QCA5018)
defined(QCA_WIFI_QCA5018) || defined(QCA_WIFI_QCA9574)
#include "hal_api.h"
#endif
#include "hif_napi.h"
@@ -1008,7 +1008,8 @@ static inline int hif_get_num_active_grp_tasklets(struct hif_softc *scn)
defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390) || \
defined(QCA_WIFI_QCN9000) || defined(QCA_WIFI_QCA6490) || \
defined(QCA_WIFI_QCA6750) || defined(QCA_WIFI_QCA5018) || \
defined(QCA_WIFI_WCN7850) || defined(QCA_WIFI_QCN9224))
defined(QCA_WIFI_WCN7850) || defined(QCA_WIFI_QCN9224) || \
defined(QCA_WIFI_QCA9574))
/**
* hif_get_num_pending_work() - get the number of entries in
* the workqueue pending to be completed.
@@ -1113,7 +1114,8 @@ uint8_t hif_get_ep_vote_access(struct hif_opaque_softc *hif_ctx,
defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390) || \
defined(QCA_WIFI_QCN9000) || defined(QCA_WIFI_QCA6490) || \
defined(QCA_WIFI_QCA6750) || defined(QCA_WIFI_QCA5018) || \
defined(QCA_WIFI_WCN7850) || defined(QCA_WIFI_QCN9224))
defined(QCA_WIFI_WCN7850) || defined(QCA_WIFI_QCN9224) || \
defined(QCA_WIFI_QCA9574))
static QDF_STATUS hif_hal_attach(struct hif_softc *scn)
{
if (ce_srng_based(scn)) {
@@ -1560,6 +1562,12 @@ int hif_get_device_type(uint32_t device_id,
hif_info(" *********** qca5018 *************");
break;
case QCA9574_DEVICE_ID:
*hif_type = HIF_TYPE_QCA9574;
*target_type = TARGET_TYPE_QCA9574;
hif_info(" *********** QCA9574 *************");
break;
default:
hif_err("Unsupported device ID = 0x%x!", device_id);
ret = -ENODEV;

View File

@@ -119,6 +119,7 @@
#define QCA8074V2_DEVICE_ID (0xfffe) /* Todo: replace this with actual number */
#define QCA6018_DEVICE_ID (0xfffd) /* Todo: replace this with actual number */
#define QCA5018_DEVICE_ID (0xfffc) /* Todo: replace this with actual number */
#define QCA9574_DEVICE_ID (0xfffa)
/* Genoa */
#define QCN7605_DEVICE_ID (0x1102) /* Genoa PCIe device ID*/
#define QCN7605_COMPOSITE (0x9901)

View File

@@ -1707,6 +1707,7 @@ int hif_pci_bus_configure(struct hif_softc *hif_sc)
/* todo: consider replacing this with an srng field */
if (((hif_sc->target_info.target_type == TARGET_TYPE_QCA8074) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA8074V2) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA9574) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA5018) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCN6122) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA6018)) &&
@@ -1729,6 +1730,7 @@ int hif_pci_bus_configure(struct hif_softc *hif_sc)
if (((hif_sc->target_info.target_type == TARGET_TYPE_QCA8074) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA8074V2) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA9574) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA5018) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCN6122) ||
(hif_sc->target_info.target_type == TARGET_TYPE_QCA6018)) &&
@@ -3245,6 +3247,7 @@ int hif_configure_irq(struct hif_softc *scn)
case TARGET_TYPE_QCA8074V2:
case TARGET_TYPE_QCA6018:
case TARGET_TYPE_QCA5018:
case TARGET_TYPE_QCA9574:
ret = hif_ahb_configure_irq(sc);
break;
default:

View File

@@ -125,6 +125,13 @@ void hif_target_register_tbl_attach(struct hif_softc *scn, u32 target_type)
scn->target_ce_def = QCA6018_CE_TARGETDEF;
break;
#endif
#if defined(QCA9574_HEADERS_DEF)
case TARGET_TYPE_QCA9574:
scn->targetdef = QCA9574_TARGETDEF;
scn->target_ce_def = QCA9574_CE_TARGETDEF;
hif_info("TARGET_TYPE_QCA9574");
break;
#endif
#if defined(QCN9000_HEADERS_DEF)
case TARGET_TYPE_QCN9000:
@@ -297,6 +304,12 @@ void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type)
scn->hostdef = QCA5018_HOSTDEF;
break;
#endif
#if defined(QCA9574_HEADERS_DEF)
case HIF_TYPE_QCA9574:
scn->hostdef = QCA9574_HOSTDEF;
hif_info("HIF_TYPE_QCA9574");
break;
#endif
#if defined(QCA6390_HEADERS_DEF)
case HIF_TYPE_QCA6390:

View File

@@ -520,6 +520,7 @@ void hif_ahb_disable_bus(struct hif_softc *scn)
/* Should not be executed on 8074 platform */
if ((tgt_info->target_type != TARGET_TYPE_QCA8074) &&
(tgt_info->target_type != TARGET_TYPE_QCA8074V2) &&
(tgt_info->target_type != TARGET_TYPE_QCA9574) &&
(tgt_info->target_type != TARGET_TYPE_QCA5018) &&
(tgt_info->target_type != TARGET_TYPE_QCN6122) &&
(tgt_info->target_type != TARGET_TYPE_QCA6018)) {
@@ -665,6 +666,7 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc,
if ((tgt_info->target_type != TARGET_TYPE_QCA8074) &&
(tgt_info->target_type != TARGET_TYPE_QCA8074V2) &&
(tgt_info->target_type != TARGET_TYPE_QCA9574) &&
(tgt_info->target_type != TARGET_TYPE_QCA5018) &&
(tgt_info->target_type != TARGET_TYPE_QCN6122) &&
(tgt_info->target_type != TARGET_TYPE_QCA6018)) {
@@ -685,6 +687,7 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc,
err_target_sync:
if ((tgt_info->target_type != TARGET_TYPE_QCA8074) &&
(tgt_info->target_type != TARGET_TYPE_QCA8074V2) &&
(tgt_info->target_type != TARGET_TYPE_QCA9574) &&
(tgt_info->target_type != TARGET_TYPE_QCN6122) &&
(tgt_info->target_type != TARGET_TYPE_QCA5018) &&
(tgt_info->target_type != TARGET_TYPE_QCA6018)) {
@@ -797,6 +800,7 @@ void hif_ahb_irq_enable(struct hif_softc *scn, int ce_id)
hif_write32_mb(scn, mem + reg_offset, regval);
if (tgt_info->target_type == TARGET_TYPE_QCA8074 ||
tgt_info->target_type == TARGET_TYPE_QCA8074V2 ||
tgt_info->target_type == TARGET_TYPE_QCA9574 ||
tgt_info->target_type == TARGET_TYPE_QCA5018 ||
tgt_info->target_type == TARGET_TYPE_QCA6018) {
/* Enable destination ring interrupts for
@@ -849,6 +853,7 @@ void hif_ahb_irq_disable(struct hif_softc *scn, int ce_id)
hif_write32_mb(scn, mem + reg_offset, regval);
if (tgt_info->target_type == TARGET_TYPE_QCA8074 ||
tgt_info->target_type == TARGET_TYPE_QCA8074V2 ||
tgt_info->target_type == TARGET_TYPE_QCA9574 ||
tgt_info->target_type == TARGET_TYPE_QCA5018 ||
tgt_info->target_type == TARGET_TYPE_QCA6018) {
/* Disable destination ring interrupts for