From d2199b7a99638eba785e021bdd260261b4c645fb Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Tue, 15 Mar 2022 23:30:19 -0700 Subject: [PATCH] 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 --- dp/wifi3.0/dp_ipa.c | 6 +++--- dp/wifi3.0/dp_main.c | 2 ++ hal/wifi3.0/hal_api.h | 9 +++++++++ hal/wifi3.0/hal_internal.h | 1 + hal/wifi3.0/kiwi/hal_kiwi.c | 1 + hal/wifi3.0/li/hal_li_generic_api.h | 11 +++++++++++ hal/wifi3.0/qca5018/hal_5018.c | 1 + hal/wifi3.0/qca6290/hal_6290.c | 1 + hal/wifi3.0/qca6390/hal_6390.c | 15 +++++++++++++++ hal/wifi3.0/qca6490/hal_6490.c | 15 +++++++++++++++ hal/wifi3.0/qca6750/hal_6750.c | 15 +++++++++++++++ hal/wifi3.0/qca8074v1/hal_8074v1.c | 1 + hal/wifi3.0/qca8074v2/hal_8074v2.c | 1 + hal/wifi3.0/qcn6122/hal_qcn6122.c | 1 + hal/wifi3.0/qcn9000/hal_9000.c | 1 + hal/wifi3.0/qcn9224/hal_9224.c | 1 + 16 files changed, 79 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c index d1ef7099b8..bc74ac38d6 100644 --- a/dp/wifi3.0/dp_ipa.c +++ b/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; diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 915bfa61d2..44fc6a5715 100644 --- a/dp/wifi3.0/dp_main.c +++ b/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: diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index 15683781bb..92774e3c85 100644 --- a/hal/wifi3.0/hal_api.h +++ b/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 diff --git a/hal/wifi3.0/hal_internal.h b/hal/wifi3.0/hal_internal.h index 2bcc68eb1e..8a5d6cfb79 100644 --- a/hal/wifi3.0/hal_internal.h +++ b/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); diff --git a/hal/wifi3.0/kiwi/hal_kiwi.c b/hal/wifi3.0/kiwi/hal_kiwi.c index 96102d407c..889e572c14 100644 --- a/hal/wifi3.0/kiwi/hal_kiwi.c +++ b/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[] = { diff --git a/hal/wifi3.0/li/hal_li_generic_api.h b/hal/wifi3.0/li/hal_li_generic_api.h index 6374f44c40..132bd4e60e 100644 --- a/hal/wifi3.0/li/hal_li_generic_api.h +++ b/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), diff --git a/hal/wifi3.0/qca5018/hal_5018.c b/hal/wifi3.0/qca5018/hal_5018.c index d0c499550e..30bf1fe5d1 100644 --- a/hal/wifi3.0/qca5018/hal_5018.c +++ b/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[] = { diff --git a/hal/wifi3.0/qca6290/hal_6290.c b/hal/wifi3.0/qca6290/hal_6290.c index 3ee8063e4e..d8cddd3587 100644 --- a/hal/wifi3.0/qca6290/hal_6290.c +++ b/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[] = { diff --git a/hal/wifi3.0/qca6390/hal_6390.c b/hal/wifi3.0/qca6390/hal_6390.c index 90a9261170..b4c184d736 100644 --- a/hal/wifi3.0/qca6390/hal_6390.c +++ b/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[] = { diff --git a/hal/wifi3.0/qca6490/hal_6490.c b/hal/wifi3.0/qca6490/hal_6490.c index 8d1c79b5ae..1cf01a9fc0 100644 --- a/hal/wifi3.0/qca6490/hal_6490.c +++ b/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[] = { diff --git a/hal/wifi3.0/qca6750/hal_6750.c b/hal/wifi3.0/qca6750/hal_6750.c index d5ed08c649..a50e8f0608 100644 --- a/hal/wifi3.0/qca6750/hal_6750.c +++ b/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[] = { diff --git a/hal/wifi3.0/qca8074v1/hal_8074v1.c b/hal/wifi3.0/qca8074v1/hal_8074v1.c index 5605e82641..91f0d95fc3 100644 --- a/hal/wifi3.0/qca8074v1/hal_8074v1.c +++ b/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[] = { diff --git a/hal/wifi3.0/qca8074v2/hal_8074v2.c b/hal/wifi3.0/qca8074v2/hal_8074v2.c index c88be467b9..4f3eab39e8 100644 --- a/hal/wifi3.0/qca8074v2/hal_8074v2.c +++ b/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[] = { diff --git a/hal/wifi3.0/qcn6122/hal_qcn6122.c b/hal/wifi3.0/qcn6122/hal_qcn6122.c index 2e2d3ebaaf..719da6f427 100644 --- a/hal/wifi3.0/qcn6122/hal_qcn6122.c +++ b/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[] = { diff --git a/hal/wifi3.0/qcn9000/hal_9000.c b/hal/wifi3.0/qcn9000/hal_9000.c index fe605baf55..bc0e3ff779 100644 --- a/hal/wifi3.0/qcn9000/hal_9000.c +++ b/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[] = { diff --git a/hal/wifi3.0/qcn9224/hal_9224.c b/hal/wifi3.0/qcn9224/hal_9224.c index feae9d4b9a..66d2d489e1 100644 --- a/hal/wifi3.0/qcn9224/hal_9224.c +++ b/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[] = {