فهرست منبع

qcacmn: Add CE config tables for Direct Link on Kiwi

Add separate CE host, target, and service map config
tables for Direct Link use case on Kiwi.

Change-Id: I84c1af09da401ab739905b96c85417f907b36743
CRs-Fixed: 3335330
Yeshwanth Sriram Guntuka 2 سال پیش
والد
کامیت
93c0c09c50
2فایلهای تغییر یافته به همراه164 افزوده شده و 30 حذف شده
  1. 67 17
      hif/src/ce/ce_assignment.h
  2. 97 13
      hif/src/ce/ce_main.c

+ 67 - 17
hif/src/ce/ce_assignment.h

@@ -1571,14 +1571,44 @@ static struct CE_pipe_config target_ce_config_wlan_qca6750[] = {
 };
 
 #define KIWI_CE_COUNT 9
-static struct CE_attr host_ce_config_wlan_kiwi[] = {
-	/* host->target HTC control and raw streams */
 #ifdef FEATURE_DIRECT_LINK
+static struct CE_attr host_ce_config_wlan_kiwi_direct_link[] = {
 	{ /* CE0 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, 8, 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,  3520, 256, NULL,},
+	/* host->target WMI */
+	{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 3520, 0, NULL,},
+	/* host->target HTT, HTC control and raw streams */
+	{ /* CE4 */ CE4_COMP_HTT_HTC, 0, 256, 256, 0, NULL,},
+#ifdef FEATURE_PKTLOG
+	/* target -> host PKTLOG */
+	{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
 #else
-	{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
+	{ /* CE5 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, 0, 256, 32,
+	 NULL,},
 #endif
+	/* Target autonomous HIF_memcpy */
+	{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+#ifdef WLAN_FEATURE_WMI_DIAG_OVER_CE7
+	/* target->host WMI_DIAG */
+	{ /* CE7 */ CE_ATTR_FLAGS, 0, 0,  2048, 32, NULL,},
+#else
+	/* ce_diag, the Diagnostic Window */
+	{ /* CE7 */ (CE_ATTR_DIAG_FLAGS | CE_ATTR_DISABLE_INTR), 0,
+		0, DIAG_TRANSFER_LIMIT, 0, NULL,},
+#endif
+	/* Reserved for target */
+	{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+	/* CE 9, 10, 11 belong to CoreBsp & MHI driver */
+};
+#endif
+
+static struct CE_attr host_ce_config_wlan_kiwi[] = {
+	/* 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 */
@@ -1591,13 +1621,8 @@ static struct CE_attr host_ce_config_wlan_kiwi[] = {
 #ifdef FEATURE_PKTLOG
 	/* target -> host PKTLOG */
 	{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
-#else
-#ifdef FEATURE_DIRECT_LINK
-	{ /* CE5 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, 0, 256, 32,
-	 NULL,},
 #else
 	{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 0, NULL,},
-#endif
 #endif
 	/* Target autonomous HIF_memcpy */
 	{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
@@ -1614,33 +1639,58 @@ static struct CE_attr host_ce_config_wlan_kiwi[] = {
 	/* CE 9, 10, 11 belong to CoreBsp & MHI driver */
 };
 
-static struct CE_pipe_config target_ce_config_wlan_kiwi[] = {
-	/* host->target HTC control and raw streams */
-#ifdef FEATURE_XPAN
+#ifdef FEATURE_DIRECT_LINK
+static struct CE_pipe_config target_ce_config_wlan_kiwi_direct_link[] = {
 	{ /* CE0 */ 0, PIPEDIR_OUT, 8, 2048, CE_ATTR_FLAGS, 0,},
-#else
-	{ /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
-#endif
 	/* target->host HTT */
 	{ /* CE1 */ 1, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
 	/* target->host WMI  + HTC control */
 	{ /* CE2 */ 2, PIPEDIR_IN,  32, 3520, CE_ATTR_FLAGS, 0,},
 	/* host->target WMI */
 	{ /* CE3 */ 3, PIPEDIR_OUT, 32, 3520, CE_ATTR_FLAGS, 0,},
-	/* host->target HTT */
+	/* host->target HTT, HTC control and raw streams */
 	{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
 		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
 #ifdef FEATURE_PKTLOG
 	/* Target -> host PKTLOG */
 	{ /* CE5 */ 5, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
 #else
-#ifdef FEATURE_DIRECT_LINK
 	{ /* CE5 */ 5, PIPEDIR_IN,  16, 256, CE_ATTR_FLAGS, 0,},
+#endif
+	/* Reserved for target autonomous HIF_memcpy */
+	{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
+#ifdef WLAN_FEATURE_WMI_DIAG_OVER_CE7
+	/* target->host WMI_DIAG */
+	{ /* CE7 */ 7, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
 #else
-	{ /* CE5 */ 5, PIPEDIR_IN,  0, 2048, CE_ATTR_FLAGS, 0,},
+	/* CE7 used only by Host */
+	{ /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0,
+		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
 #endif
+	/* Reserved for target */
+	{ /* CE8 */ 8, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
+	/* CE 9, 10, 11 belong to CoreBsp & MHI driver */
+};
 #endif
 
+static struct CE_pipe_config target_ce_config_wlan_kiwi[] = {
+	/* 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, 3520, CE_ATTR_FLAGS, 0,},
+	/* host->target WMI */
+	{ /* CE3 */ 3, PIPEDIR_OUT, 32, 3520, CE_ATTR_FLAGS, 0,},
+	/* host->target HTT */
+	{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
+		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
+#ifdef FEATURE_PKTLOG
+	/* Target -> host PKTLOG */
+	{ /* CE5 */ 5, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+#else
+	{ /* CE5 */ 5, PIPEDIR_IN,  0, 2048, CE_ATTR_FLAGS, 0,},
+#endif
 	/* Reserved for target autonomous HIF_memcpy */
 	{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
 #ifdef WLAN_FEATURE_WMI_DIAG_OVER_CE7

+ 97 - 13
hif/src/ce/ce_main.c

@@ -1122,7 +1122,8 @@ static struct service_to_pipe target_service_to_ce_map_qca6750[] = {
 #endif
 
 #if (defined(QCA_WIFI_KIWI))
-static struct service_to_pipe target_service_to_ce_map_kiwi[] = {
+#ifdef FEATURE_DIRECT_LINK
+static struct service_to_pipe target_service_to_ce_map_kiwi_direct_link[] = {
 	{ WMI_DATA_VO_SVC, PIPEDIR_OUT, 3, },
 	{ WMI_DATA_VO_SVC, PIPEDIR_IN, 2, },
 	{ WMI_DATA_BK_SVC, PIPEDIR_OUT, 3, },
@@ -1133,20 +1134,37 @@ static struct service_to_pipe target_service_to_ce_map_kiwi[] = {
 	{ WMI_DATA_VI_SVC, PIPEDIR_IN, 2, },
 	{ WMI_CONTROL_SVC, PIPEDIR_OUT, 3, },
 	{ WMI_CONTROL_SVC, PIPEDIR_IN, 2, },
-#ifdef FEATURE_DIRECT_LINK
 	{ HTC_CTRL_RSVD_SVC, PIPEDIR_OUT, 4, },
-#else
-	{ HTC_CTRL_RSVD_SVC, PIPEDIR_OUT, 0, },
-#endif
 	{ HTC_CTRL_RSVD_SVC, PIPEDIR_IN, 2, },
 	{ HTT_DATA_MSG_SVC, PIPEDIR_OUT, 4, },
 	{ HTT_DATA_MSG_SVC, PIPEDIR_IN, 1, },
 #ifdef WLAN_FEATURE_WMI_DIAG_OVER_CE7
 	{ WMI_CONTROL_DIAG_SVC, PIPEDIR_IN, 7, },
 #endif
-#ifdef FEATURE_DIRECT_LINK
 	{ LPASS_DATA_MSG_SVC, PIPEDIR_OUT, 0, },
 	{ LPASS_DATA_MSG_SVC, PIPEDIR_IN, 5, },
+	/* (Additions here) */
+	{ 0, 0, 0, },
+};
+#endif
+
+static struct service_to_pipe target_service_to_ce_map_kiwi[] = {
+	{ 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, },
+#ifdef WLAN_FEATURE_WMI_DIAG_OVER_CE7
+	{ WMI_CONTROL_DIAG_SVC, PIPEDIR_IN, 7, },
 #endif
 	/* (Additions here) */
 	{ 0, 0, 0, },
@@ -1342,6 +1360,39 @@ void hif_select_ce_map_qcn9224(struct service_to_pipe **tgt_svc_map_to_use,
 }
 #endif
 
+#ifdef FEATURE_DIRECT_LINK
+/**
+ * hif_select_service_to_pipe_map_kiwi() - Select service to CE map
+ *  configuration for Kiwi
+ * @scn: HIF context
+ *
+ * Return: None
+ */
+static inline void
+hif_select_service_to_pipe_map_kiwi(struct hif_softc *scn,
+				    struct service_to_pipe **tgt_svc_map_to_use,
+				    uint32_t *sz_tgt_svc_map_to_use)
+{
+	if (pld_is_direct_link_supported(scn->qdf_dev->dev)) {
+		*tgt_svc_map_to_use = target_service_to_ce_map_kiwi_direct_link;
+		*sz_tgt_svc_map_to_use =
+			sizeof(target_service_to_ce_map_kiwi_direct_link);
+	} else {
+		*tgt_svc_map_to_use = target_service_to_ce_map_kiwi;
+		*sz_tgt_svc_map_to_use = sizeof(target_service_to_ce_map_kiwi);
+	}
+}
+#else
+static inline void
+hif_select_service_to_pipe_map_kiwi(struct hif_softc *scn,
+				    struct service_to_pipe **tgt_svc_map_to_use,
+				    uint32_t *sz_tgt_svc_map_to_use)
+{
+	*tgt_svc_map_to_use = target_service_to_ce_map_kiwi;
+	*sz_tgt_svc_map_to_use = sizeof(target_service_to_ce_map_kiwi);
+}
+#endif
+
 static void hif_select_service_to_pipe_map(struct hif_softc *scn,
 				    struct service_to_pipe **tgt_svc_map_to_use,
 				    uint32_t *sz_tgt_svc_map_to_use)
@@ -1395,9 +1446,9 @@ static void hif_select_service_to_pipe_map(struct hif_softc *scn,
 			break;
 		case TARGET_TYPE_KIWI:
 		case TARGET_TYPE_MANGO:
-			*tgt_svc_map_to_use = target_service_to_ce_map_kiwi;
-			*sz_tgt_svc_map_to_use =
-				sizeof(target_service_to_ce_map_kiwi);
+			hif_select_service_to_pipe_map_kiwi(scn,
+							 tgt_svc_map_to_use,
+							 sz_tgt_svc_map_to_use);
 			break;
 		case TARGET_TYPE_QCA8074:
 			*tgt_svc_map_to_use = target_service_to_ce_map_qca8074;
@@ -3977,6 +4028,42 @@ static inline void hif_ce_service_init(void)
 }
 #endif
 
+#ifdef FEATURE_DIRECT_LINK
+/**
+ * hif_ce_select_config_kiwi() - Select the host and target CE
+ *  configuration for Kiwi
+ * @hif_state: HIF CE context
+ *
+ * Return: None
+ */
+static inline
+void hif_ce_select_config_kiwi(struct HIF_CE_state *hif_state)
+{
+	struct hif_softc *hif_ctx = HIF_GET_SOFTC(hif_state);
+
+	if (pld_is_direct_link_supported(hif_ctx->qdf_dev->dev)) {
+		hif_state->host_ce_config =
+				host_ce_config_wlan_kiwi_direct_link;
+		hif_state->target_ce_config =
+				target_ce_config_wlan_kiwi_direct_link;
+		hif_state->target_ce_config_sz =
+				sizeof(target_ce_config_wlan_kiwi_direct_link);
+	} else {
+		hif_state->host_ce_config = host_ce_config_wlan_kiwi;
+		hif_state->target_ce_config = target_ce_config_wlan_kiwi;
+		hif_state->target_ce_config_sz =
+				sizeof(target_ce_config_wlan_kiwi);
+	}
+}
+#else
+static inline
+void hif_ce_select_config_kiwi(struct HIF_CE_state *hif_state)
+{
+	hif_state->host_ce_config = host_ce_config_wlan_kiwi;
+	hif_state->target_ce_config = target_ce_config_wlan_kiwi;
+	hif_state->target_ce_config_sz = sizeof(target_ce_config_wlan_kiwi);
+}
+#endif
 
 /**
  * hif_ce_prepare_config() - load the correct static tables.
@@ -4152,10 +4239,7 @@ void hif_ce_prepare_config(struct hif_softc *scn)
 		break;
 	case TARGET_TYPE_KIWI:
 	case TARGET_TYPE_MANGO:
-		hif_state->host_ce_config = host_ce_config_wlan_kiwi;
-		hif_state->target_ce_config = target_ce_config_wlan_kiwi;
-		hif_state->target_ce_config_sz =
-					sizeof(target_ce_config_wlan_kiwi);
+		hif_ce_select_config_kiwi(hif_state);
 		scn->ce_count = KIWI_CE_COUNT;
 		break;
 	case TARGET_TYPE_ADRASTEA: