浏览代码

qcacmn: Set default value for REO dest ctrl register

Currently in some case we are receiving non error packets on REO2TCL
ring, which is causing issue.

Fix is to set DEST_RING_MAPPING_0 to SW1 for REO dest ctrl
register, So that non error packets with reo_destination_indication
with 0x0 in the reo entrance ring will be routed to SW1 ring.

Change-Id: I67f78f35e7dba899943307902d99d0325a60498f
CRs-Fixed: 3150186
Amit Mehta 3 年之前
父节点
当前提交
d2199b7a99

+ 3 - 3
dp/wifi3.0/dp_ipa.c

@@ -1501,7 +1501,7 @@ int dp_ipa_ring_resource_setup(struct dp_soc *soc,
 	 * Set DEST_RING_MAPPING_4 to SW2 as default value for
 	 * DESTINATION_RING_CTRL_IX_0.
 	 */
-	ix0_map[0] = REO_REMAP_TCL;
+	ix0_map[0] = REO_REMAP_SW1;
 	ix0_map[1] = REO_REMAP_SW1;
 	ix0_map[2] = REO_REMAP_SW2;
 	ix0_map[3] = REO_REMAP_SW3;
@@ -1778,7 +1778,7 @@ QDF_STATUS dp_ipa_enable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 		return QDF_STATUS_E_AGAIN;
 
 	/* Call HAL API to remap REO rings to REO2IPA ring */
-	ix_map[0] = REO_REMAP_TCL;
+	ix_map[0] = REO_REMAP_SW1;
 	ix_map[1] = REO_REMAP_SW4;
 	ix_map[2] = REO_REMAP_SW1;
 	ix_map[3] = REO_REMAP_SW4;
@@ -1840,7 +1840,7 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 	if (!dp_ipa_is_target_ready(soc))
 		return QDF_STATUS_E_AGAIN;
 
-	ix0_map[0] = REO_REMAP_TCL;
+	ix0_map[0] = REO_REMAP_SW1;
 	ix0_map[1] = REO_REMAP_SW1;
 	ix0_map[2] = REO_REMAP_SW2;
 	ix0_map[3] = REO_REMAP_SW3;

+ 2 - 0
dp/wifi3.0/dp_main.c

@@ -4247,6 +4247,7 @@ bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0,
 					      soc->num_reo_dest_rings -
 					      USE_1_IPA_RX_REO_RING, remap1,
 					      remap2);
+		hal_compute_reo_remap_ix0(soc->hal_soc, remap0);
 		break;
 	default:
 		dp_err("unkonwn arch_id 0x%x", soc->arch_id);
@@ -4457,6 +4458,7 @@ bool dp_reo_remap_config(struct dp_soc *soc,
 		num = dp_reo_ring_selection(value, ring);
 		hal_compute_reo_remap_ix2_ix3(soc->hal_soc, ring,
 					      num, remap1, remap2);
+		hal_compute_reo_remap_ix0(soc->hal_soc, remap0);
 
 		break;
 	case dp_nss_cfg_first_radio:

+ 9 - 0
hal/wifi3.0/hal_api.h

@@ -2550,6 +2550,15 @@ void hal_compute_reo_remap_ix2_ix3(hal_soc_handle_t hal_soc_hdl,
 					num_rings, remap1, remap2);
 }
 
+static inline
+void hal_compute_reo_remap_ix0(hal_soc_handle_t hal_soc_hdl, uint32_t *remap0)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	if (hal_soc->ops->hal_compute_reo_remap_ix0)
+		hal_soc->ops->hal_compute_reo_remap_ix0(remap0);
+}
+
 /**
  * hal_setup_link_idle_list - Setup scattered idle list using the
  * buffer list provided

+ 1 - 0
hal/wifi3.0/hal_internal.h

@@ -929,6 +929,7 @@ struct hal_hw_txrx_ops {
 					      uint32_t num_rings,
 					      uint32_t *remap1,
 					      uint32_t *remap2);
+	void (*hal_compute_reo_remap_ix0)(uint32_t *remap0);
 	uint32_t (*hal_rx_flow_setup_cmem_fse)(
 				struct hal_soc *soc, uint32_t cmem_ba,
 				uint32_t table_offset, uint8_t *rx_flow);

+ 1 - 0
hal/wifi3.0/kiwi/hal_kiwi.c

@@ -1872,6 +1872,7 @@ static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_get_first_wow_wakeup_packet =
 		hal_get_first_wow_wakeup_packet_kiwi;
 #endif
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_kiwi[] = {

+ 11 - 0
hal/wifi3.0/li/hal_li_generic_api.h

@@ -2251,6 +2251,17 @@ void hal_reo_setup_generic_li(struct hal_soc *soc, void *reoparams)
 	 * 7: NOT_USED.
 	 */
 	if (reo_params->rx_hash_enabled) {
+		if (reo_params->remap0)
+			HAL_REG_WRITE(soc,
+				      HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR(
+				      SEQ_WCSS_UMAC_REO_REG_OFFSET),
+				      reo_params->remap0);
+
+		hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR 0x%x",
+			  HAL_REG_READ(soc,
+				       HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR(
+				       SEQ_WCSS_UMAC_REO_REG_OFFSET)));
+
 		HAL_REG_WRITE(soc,
 			      HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR(
 			      SEQ_WCSS_UMAC_REO_REG_OFFSET),

+ 1 - 0
hal/wifi3.0/qca5018/hal_5018.c

@@ -1841,6 +1841,7 @@ static void hal_hw_txrx_ops_attach_qca5018(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_compute_reo_remap_ix2_ix3 = hal_compute_reo_remap_ix2_ix3_5018;
 	hal_soc->ops->hal_setup_link_idle_list =
 				hal_setup_link_idle_list_generic_li;
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_5018[] = {

+ 1 - 0
hal/wifi3.0/qca6290/hal_6290.c

@@ -1237,6 +1237,7 @@ static void hal_hw_txrx_ops_attach_6290(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_get_first_wow_wakeup_packet =
 		hal_get_first_wow_wakeup_packet_6290;
 #endif
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

+ 15 - 0
hal/wifi3.0/qca6390/hal_6390.c

@@ -1100,6 +1100,19 @@ void hal_compute_reo_remap_ix2_ix3_6390(uint32_t *ring, uint32_t num_rings,
 	}
 }
 
+static
+void hal_compute_reo_remap_ix0_6390(uint32_t *remap0)
+{
+	*remap0 = HAL_REO_REMAP_IX0(REO_REMAP_SW1, 0) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW1, 1) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW2, 2) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW3, 3) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW2, 4) |
+			HAL_REO_REMAP_IX0(REO_REMAP_RELEASE, 5) |
+			HAL_REO_REMAP_IX0(REO_REMAP_FW, 6) |
+			HAL_REO_REMAP_IX0(REO_REMAP_FW, 7);
+}
+
 #ifdef WLAN_FEATURE_MARK_FIRST_WAKEUP_PACKET
 /**
  * hal_get_first_wow_wakeup_packet_6390(): Function to get if the buffer
@@ -1293,6 +1306,8 @@ static void hal_hw_txrx_ops_attach_qca6390(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_get_first_wow_wakeup_packet =
 		hal_get_first_wow_wakeup_packet_6390;
 #endif
+	hal_soc->ops->hal_compute_reo_remap_ix0 =
+				hal_compute_reo_remap_ix0_6390;
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

+ 15 - 0
hal/wifi3.0/qca6490/hal_6490.c

@@ -1681,6 +1681,19 @@ void hal_compute_reo_remap_ix2_ix3_6490(uint32_t *ring, uint32_t num_rings,
 	}
 }
 
+static
+void hal_compute_reo_remap_ix0_6490(uint32_t *remap0)
+{
+	*remap0 = HAL_REO_REMAP_IX0(REO_REMAP_SW1, 0) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW1, 1) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW2, 2) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW3, 3) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW2, 4) |
+			HAL_REO_REMAP_IX0(REO_REMAP_RELEASE, 5) |
+			HAL_REO_REMAP_IX0(REO_REMAP_FW, 6) |
+			HAL_REO_REMAP_IX0(REO_REMAP_FW, 7);
+}
+
 #ifdef WLAN_FEATURE_MARK_FIRST_WAKEUP_PACKET
 /**
  * hal_get_first_wow_wakeup_packet_6490(): Function to retrieve
@@ -1897,6 +1910,8 @@ static void hal_hw_txrx_ops_attach_qca6490(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_get_first_wow_wakeup_packet =
 		hal_get_first_wow_wakeup_packet_6490;
 #endif
+	hal_soc->ops->hal_compute_reo_remap_ix0 =
+					hal_compute_reo_remap_ix0_6490;
 };
 
 struct hal_hw_srng_config hw_srng_table_6490[] = {

+ 15 - 0
hal/wifi3.0/qca6750/hal_6750.c

@@ -1834,6 +1834,19 @@ void hal_compute_reo_remap_ix2_ix3_6750(uint32_t *ring, uint32_t num_rings,
 	}
 }
 
+static
+void hal_compute_reo_remap_ix0_6750(uint32_t *remap0)
+{
+	*remap0 = HAL_REO_REMAP_IX0(REO_REMAP_SW1, 0) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW1, 1) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW2, 2) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW3, 3) |
+			HAL_REO_REMAP_IX0(REO_REMAP_SW2, 4) |
+			HAL_REO_REMAP_IX0(REO_REMAP_RELEASE, 5) |
+			HAL_REO_REMAP_IX0(REO_REMAP_FW, 6) |
+			HAL_REO_REMAP_IX0(REO_REMAP_FW, 7);
+}
+
 #ifdef WLAN_FEATURE_MARK_FIRST_WAKEUP_PACKET
 /**
  * hal_get_first_wow_wakeup_packet_6750(): Function to retrieve
@@ -2055,6 +2068,8 @@ static void hal_hw_txrx_ops_attach_qca6750(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_get_first_wow_wakeup_packet =
 		hal_get_first_wow_wakeup_packet_6750;
 #endif
+	hal_soc->ops->hal_compute_reo_remap_ix0 =
+				hal_compute_reo_remap_ix0_6750;
 };
 
 struct hal_hw_srng_config hw_srng_table_6750[] = {

+ 1 - 0
hal/wifi3.0/qca8074v1/hal_8074v1.c

@@ -1406,6 +1406,7 @@ static void hal_hw_txrx_ops_attach_qca8074(struct hal_soc *hal_soc)
 					hal_compute_reo_remap_ix2_ix3_8074v1;
 	hal_soc->ops->hal_setup_link_idle_list =
 				hal_setup_link_idle_list_generic_li;
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

+ 1 - 0
hal/wifi3.0/qca8074v2/hal_8074v2.c

@@ -1407,6 +1407,7 @@ static void hal_hw_txrx_ops_attach_qca8074v2(struct hal_soc *hal_soc)
 					hal_compute_reo_remap_ix2_ix3_8074v2;
 	hal_soc->ops->hal_setup_link_idle_list =
 				hal_setup_link_idle_list_generic_li;
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

+ 1 - 0
hal/wifi3.0/qcn6122/hal_qcn6122.c

@@ -1900,6 +1900,7 @@ static void hal_hw_txrx_ops_attach_qcn6122(struct hal_soc *hal_soc)
 					hal_compute_reo_remap_ix2_ix3_6122;
 	hal_soc->ops->hal_setup_link_idle_list =
 				hal_setup_link_idle_list_generic_li;
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_6122[] = {

+ 1 - 0
hal/wifi3.0/qcn9000/hal_9000.c

@@ -1945,6 +1945,7 @@ static void hal_hw_txrx_ops_attach_qcn9000(struct hal_soc *hal_soc)
 					hal_compute_reo_remap_ix2_ix3_9000;
 	hal_soc->ops->hal_setup_link_idle_list =
 				hal_setup_link_idle_list_generic_li;
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {

+ 1 - 0
hal/wifi3.0/qcn9224/hal_9224.c

@@ -1929,6 +1929,7 @@ static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_txmon_status_free_buffer =
 				hal_txmon_status_free_buffer_generic_be;
 #endif /* QCA_MONITOR_2_0_SUPPORT */
+	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
 };
 
 struct hal_hw_srng_config hw_srng_table_9224[] = {