Forráskód Böngészése

qcacmn: Add HIF changes to support qca6490

HIF changes to support qca6490 WLAN chipset.

Change-Id: I4b1be1770a2daf0a0db6f65f579831e3fcb10e79
CRs-Fixed: 2522133
Mohit Khanna 5 éve
szülő
commit
973308ae13

+ 1 - 0
hif/inc/hif.h

@@ -63,6 +63,7 @@ typedef void *hif_handle_t;
 #define HIF_TYPE_QCA8074V2 19
 #define HIF_TYPE_QCA6018  20
 #define HIF_TYPE_QCN9000 21
+#define HIF_TYPE_QCA6490 22
 
 #ifdef IPA_OFFLOAD
 #define DMA_COHERENT_MASK_IPA_VER_3_AND_ABOVE   37

+ 1 - 0
hif/inc/hostdef.h

@@ -35,6 +35,7 @@ extern struct hostdef_s *QCA9984_HOSTdef;
 extern struct hostdef_s *QCA9888_HOSTdef;
 extern struct hostdef_s *QCA6290_HOSTdef;
 extern struct hostdef_s *QCA6390_HOSTdef;
+extern struct hostdef_s *QCA6490_HOSTdef;
 #ifdef ATH_AHB
 extern struct hostdef_s *IPQ4019_HOSTdef;
 #endif

+ 4 - 0
hif/inc/target_type.h

@@ -54,6 +54,10 @@ extern "C" {
 #ifndef TARGET_TYPE_QCN9000
 #define TARGET_TYPE_QCN9000      26
 #endif
+/* HastingsPrime */
+#ifndef TARGET_TYPE_QCA6490
+#define TARGET_TYPE_QCA6490   27
+#endif
 
 #ifdef __cplusplus
 }

+ 2 - 0
hif/inc/targetdef.h

@@ -35,6 +35,7 @@ extern struct targetdef_s *QCA9984_TARGETdef;
 extern struct targetdef_s *QCA9888_TARGETdef;
 extern struct targetdef_s *QCA6290_TARGETdef;
 extern struct targetdef_s *QCA6390_TARGETdef;
+extern struct targetdef_s *QCA6490_TARGETdef;
 #ifdef ATH_AHB
 extern struct targetdef_s *IPQ4019_TARGETdef;
 #endif
@@ -54,6 +55,7 @@ extern struct ce_reg_def *QCA9984_CE_TARGETdef;
 extern struct ce_reg_def *QCA9888_CE_TARGETdef;
 extern struct ce_reg_def *QCA6290_CE_TARGETdef;
 extern struct ce_reg_def *QCA6390_CE_TARGETdef;
+extern struct ce_reg_def *QCA6490_CE_TARGETdef;
 #ifdef ATH_AHB
 extern struct ce_reg_def *IPQ4019_CE_TARGETdef;
 #endif

+ 2 - 0
hif/src/ath_procfs.c

@@ -83,6 +83,7 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf,
 	    (scn->bus_type ==  QDF_BUS_TYPE_PCI &&
 	    ((tgt_info->target_type == TARGET_TYPE_QCA6290) ||
 	     (tgt_info->target_type == TARGET_TYPE_QCA6390) ||
+	     (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_QCN9000) ||
@@ -159,6 +160,7 @@ static ssize_t ath_procfs_diag_write(struct file *file,
 	    ((scn->bus_type ==  QDF_BUS_TYPE_PCI) &&
 	     ((tgt_info->target_type == TARGET_TYPE_QCA6290) ||
 	      (tgt_info->target_type == TARGET_TYPE_QCA6390) ||
+	      (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_QCN9000) ||

+ 49 - 0
hif/src/ce/ce_assignment.h

@@ -1120,4 +1120,53 @@ static struct CE_pipe_config target_ce_config_wlan_qca6390[] = {
 	{ /* CE8 */ 8, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
 	/* CE 9, 10, 11 belong to CoreBsp & MHI driver */
 };
+
+#define QCA_6490_CE_COUNT 9
+static struct CE_attr host_ce_config_wlan_qca6490[] = {
+	/* 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, 32, NULL,},
+	/* host->target WMI */
+	{ /* 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 */
+	{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
+	/* Target autonomous HIF_memcpy */
+	{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+	/* ce_diag, the Diagnostic Window */
+	{ /* CE7 */ (CE_ATTR_DIAG_FLAGS | CE_ATTR_DISABLE_INTR), 0,
+		0, DIAG_TRANSFER_LIMIT, 0, NULL,},
+	/* Reserved for target */
+	{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+	/* CE 9, 10, 11 belong to CoreBsp & MHI driver */
+};
+
+static struct CE_pipe_config target_ce_config_wlan_qca6490[] = {
+	/* 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,  32, 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,},
+	/* Target -> host PKTLOG */
+	{ /* CE5 */ 5, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+	/* Reserved for target autonomous HIF_memcpy */
+	{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
+	/* CE7 used only by Host */
+	{ /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0,
+		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
+	/* Reserved for target */
+	{ /* CE8 */ 8, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
+	/* CE 9, 10, 11 belong to CoreBsp & MHI driver */
+};
 #endif /* __HIF_PCI_INTERNAL_H__ */

+ 34 - 0
hif/src/ce/ce_main.c

@@ -611,6 +611,26 @@ static struct service_to_pipe target_service_to_ce_map_qca6390[] = {
 };
 #endif
 
+static struct service_to_pipe target_service_to_ce_map_qca6490[] = {
+	{ 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, },
+	{ HTC_CTRL_RSVD_SVC, PIPEDIR_OUT, 0, },
+	{ HTC_CTRL_RSVD_SVC, PIPEDIR_IN, 2, },
+	{ 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, },
+};
+
 static struct service_to_pipe target_service_to_ce_map_ar900b[] = {
 	{
 		WMI_DATA_VO_SVC,
@@ -802,6 +822,11 @@ static void hif_select_service_to_pipe_map(struct hif_softc *scn,
 			*sz_tgt_svc_map_to_use =
 				sizeof(target_service_to_ce_map_qca6390);
 			break;
+		case TARGET_TYPE_QCA6490:
+			*tgt_svc_map_to_use = target_service_to_ce_map_qca6490;
+			*sz_tgt_svc_map_to_use =
+				sizeof(target_service_to_ce_map_qca6490);
+			break;
 		case TARGET_TYPE_QCA8074:
 			*tgt_svc_map_to_use = target_service_to_ce_map_qca8074;
 			*sz_tgt_svc_map_to_use =
@@ -1032,6 +1057,7 @@ bool ce_srng_based(struct hif_softc *scn)
 	case TARGET_TYPE_QCA8074V2:
 	case TARGET_TYPE_QCA6290:
 	case TARGET_TYPE_QCA6390:
+	case TARGET_TYPE_QCA6490:
 	case TARGET_TYPE_QCA6018:
 	case TARGET_TYPE_QCN9000:
 		return true;
@@ -3177,6 +3203,14 @@ void hif_ce_prepare_config(struct hif_softc *scn)
 
 		scn->ce_count = QCA_6390_CE_COUNT;
 		break;
+	case TARGET_TYPE_QCA6490:
+		hif_state->host_ce_config = host_ce_config_wlan_qca6490;
+		hif_state->target_ce_config = target_ce_config_wlan_qca6490;
+		hif_state->target_ce_config_sz =
+					sizeof(target_ce_config_wlan_qca6490);
+
+		scn->ce_count = QCA_6490_CE_COUNT;
+		break;
 	case TARGET_TYPE_ADRASTEA:
 		if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_NO_PKTLOG_CFG)) {
 			hif_state->host_ce_config =

+ 1 - 1
hif/src/ce/ce_service_srng.c

@@ -305,7 +305,7 @@ ce_recv_buf_enqueue_srng(struct CE_handle *copyeng,
 	unsigned int sw_index;
 	uint64_t dma_addr = buffer;
 	struct hif_softc *scn = CE_state->scn;
-	struct ce_srng_dest_desc *dest_desc;
+	struct ce_srng_dest_desc *dest_desc = NULL;
 
 	qdf_spin_lock_bh(&CE_state->ce_index_lock);
 	write_index = dest_ring->write_index;

+ 8 - 1
hif/src/hif_main.c

@@ -489,7 +489,7 @@ void hif_close(struct hif_opaque_softc *hif_ctx)
 
 #if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) || \
 	defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390) || \
-	defined(QCA_WIFI_QCN9000)
+	defined(QCA_WIFI_QCN9000) || defined(QCA_WIFI_QCA6490)
 static QDF_STATUS hif_hal_attach(struct hif_softc *scn)
 {
 	if (ce_srng_based(scn)) {
@@ -839,6 +839,13 @@ int hif_get_device_type(uint32_t device_id,
 		HIF_INFO(" *********** QCA6390 *************\n");
 		break;
 
+	case QCA6490_DEVICE_ID:
+	case QCA6490_EMULATION_DEVICE_ID:
+		*hif_type = HIF_TYPE_QCA6490;
+		*target_type = TARGET_TYPE_QCA6490;
+		HIF_INFO(" *********** QCA6490 *************\n");
+		break;
+
 	case QCA8074V2_DEVICE_ID:
 		*hif_type = HIF_TYPE_QCA8074V2;
 		*target_type = TARGET_TYPE_QCA8074V2;

+ 4 - 0
hif/src/hif_main.h

@@ -83,6 +83,10 @@
 #define QCN9000_DEVICE_ID (0x1104)
 #define QCA6390_EMULATION_DEVICE_ID (0x0108)
 #define QCA6390_DEVICE_ID (0x1101)
+/* TODO: change IDs for HastingsPrime */
+#define QCA6490_EMULATION_DEVICE_ID (0x010a)
+#define QCA6490_DEVICE_ID (0x1103)
+
 #define ADRASTEA_DEVICE_ID_P2_E12 (0x7021)
 #define AR9887_DEVICE_ID    (0x0050)
 #define AR900B_DEVICE_ID    (0x0040)

+ 2 - 2
hif/src/pcie/if_pci.c

@@ -3659,9 +3659,8 @@ static bool hif_is_pld_based_target(struct hif_pci_softc *sc,
 	case QCA6290_DEVICE_ID:
 	case QCN9000_DEVICE_ID:
 	case QCA6290_EMULATION_DEVICE_ID:
-#ifdef QCA_WIFI_QCA6390
 	case QCA6390_DEVICE_ID:
-#endif
+	case QCA6490_DEVICE_ID:
 	case AR6320_DEVICE_ID:
 	case QCN7605_DEVICE_ID:
 		return true;
@@ -4596,6 +4595,7 @@ int hif_pci_addr_in_boundary(struct hif_softc *scn, uint32_t offset)
 
 	if (tgt_info->target_type == TARGET_TYPE_QCA6290 ||
 	    tgt_info->target_type == TARGET_TYPE_QCA6390 ||
+	    tgt_info->target_type == TARGET_TYPE_QCA6490 ||
 	    tgt_info->target_type == TARGET_TYPE_QCA8074) {
 		/*
 		 * Need to consider offset's memtype for QCA6290/QCA8074,

+ 15 - 0
hif/src/regtable.c

@@ -142,6 +142,14 @@ void hif_target_register_tbl_attach(struct hif_softc *scn, u32 target_type)
 		break;
 #endif /* QCA6390_HEADERS_DEF */
 
+#if defined(QCA6490_HEADERS_DEF)
+	case TARGET_TYPE_QCA6490:
+		scn->targetdef = QCA6490_TARGETdef;
+		scn->target_ce_def = QCA6490_CE_TARGETdef;
+		HIF_TRACE("%s: TARGET_TYPE_QCA6490", __func__);
+		break;
+#endif /* QCA6490_HEADERS_DEF */
+
 	default:
 		break;
 	}
@@ -243,6 +251,13 @@ void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type)
 		break;
 #endif /* QCA6390_HEADERS_DEF */
 
+#if defined(QCA6490_HEADERS_DEF)
+	case HIF_TYPE_QCA6490:
+		scn->hostdef = QCA6490_HOSTdef;
+		HIF_TRACE("%s: HIF_TYPE_QCA6490", __func__);
+		break;
+#endif /* QCA6490_HEADERS_DEF */
+
 	default:
 		break;
 	}