qcacmn: change RxDMA rings to DMAC mode for QCN9224

For Waikiki use same SW2RxDMA ring for both radios

Change-Id: I33ab1749afada08e97d0b16fe68773c2d5532a15
This commit is contained in:
Chaithanya Garrepalli
2021-10-04 23:46:39 +05:30
committed by Madan Koyyalamudi
parent 60db195327
commit b733f89803
4 changed files with 121 additions and 25 deletions

View File

@@ -53,6 +53,9 @@ static struct wlan_cfg_tcl_wbm_ring_num_map g_tcl_wbm_map_array[MAX_TCL_DATA_RIN
static void dp_soc_cfg_attach_be(struct dp_soc *soc) static void dp_soc_cfg_attach_be(struct dp_soc *soc)
{ {
soc->wlan_cfg_ctx->tcl_wbm_map_array = g_tcl_wbm_map_array; soc->wlan_cfg_ctx->tcl_wbm_map_array = g_tcl_wbm_map_array;
/* this is used only when dmac mode is enabled */
soc->num_rx_refill_buf_rings = 1;
} }
qdf_size_t dp_get_context_size_be(enum dp_context_type context_type) qdf_size_t dp_get_context_size_be(enum dp_context_type context_type)
@@ -607,6 +610,10 @@ dp_rxdma_ring_sel_cfg_be(struct dp_soc *soc)
pdev->pdev_id); pdev->pdev_id);
rx_mac_srng = dp_get_rxdma_ring(pdev, lmac_id); rx_mac_srng = dp_get_rxdma_ring(pdev, lmac_id);
if (!rx_mac_srng->hal_srng)
continue;
htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
rx_mac_srng->hal_srng, rx_mac_srng->hal_srng,
RXDMA_BUF, RX_DATA_BUFFER_SIZE, RXDMA_BUF, RX_DATA_BUFFER_SIZE,
@@ -896,22 +903,87 @@ static QDF_STATUS dp_soc_ppe_srng_init(struct dp_soc *soc)
static void dp_soc_srng_deinit_be(struct dp_soc *soc) static void dp_soc_srng_deinit_be(struct dp_soc *soc)
{ {
uint32_t i;
dp_soc_ppe_srng_deinit(soc); dp_soc_ppe_srng_deinit(soc);
if (hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc)) {
for (i = 0; i < soc->num_rx_refill_buf_rings; i++) {
dp_srng_deinit(soc, &soc->rx_refill_buf_ring[i],
RXDMA_BUF, 0);
}
}
} }
static void dp_soc_srng_free_be(struct dp_soc *soc) static void dp_soc_srng_free_be(struct dp_soc *soc)
{ {
uint32_t i;
dp_soc_ppe_srng_free(soc); dp_soc_ppe_srng_free(soc);
if (hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc)) {
for (i = 0; i < soc->num_rx_refill_buf_rings; i++)
dp_srng_free(soc, &soc->rx_refill_buf_ring[i]);
}
} }
static QDF_STATUS dp_soc_srng_alloc_be(struct dp_soc *soc) static QDF_STATUS dp_soc_srng_alloc_be(struct dp_soc *soc)
{ {
return dp_soc_ppe_srng_alloc(soc); struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
uint32_t ring_size;
uint32_t i;
soc_cfg_ctx = soc->wlan_cfg_ctx;
ring_size = wlan_cfg_get_dp_soc_rxdma_refill_ring_size(soc_cfg_ctx);
if (hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc)) {
for (i = 0; i < soc->num_rx_refill_buf_rings; i++) {
if (dp_srng_alloc(soc, &soc->rx_refill_buf_ring[i],
RXDMA_BUF, ring_size, 0)) {
dp_err("%pK: dp_srng_alloc failed refill ring",
soc);
goto fail;
}
}
}
if (dp_soc_ppe_srng_alloc(soc)) {
dp_err("%pK: ppe rings alloc failed",
soc);
goto fail;
}
return QDF_STATUS_SUCCESS;
fail:
dp_soc_srng_free_be(soc);
return QDF_STATUS_E_NOMEM;
} }
static QDF_STATUS dp_soc_srng_init_be(struct dp_soc *soc) static QDF_STATUS dp_soc_srng_init_be(struct dp_soc *soc)
{ {
return dp_soc_ppe_srng_init(soc); int i = 0;
if (hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc)) {
for (i = 0; i < soc->num_rx_refill_buf_rings; i++) {
if (dp_srng_init(soc, &soc->rx_refill_buf_ring[i],
RXDMA_BUF, 0, 0)) {
dp_err("%pK: dp_srng_init failed refill ring",
soc);
goto fail;
}
}
}
if (dp_soc_ppe_srng_init(soc)) {
dp_err("%pK: ppe rings init failed",
soc);
goto fail;
}
return QDF_STATUS_SUCCESS;
fail:
dp_soc_srng_deinit_be(soc);
return QDF_STATUS_E_NOMEM;
} }
#ifdef DP_TX_IMPLICIT_RBM_MAPPING #ifdef DP_TX_IMPLICIT_RBM_MAPPING

View File

@@ -5513,9 +5513,11 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
mac_for_pdev = i; mac_for_pdev = i;
lmac_id = dp_get_lmac_id_for_pdev_id(soc, 0, i); lmac_id = dp_get_lmac_id_for_pdev_id(soc, 0, i);
htt_srng_setup(soc->htt_handle, mac_for_pdev, if (soc->rx_refill_buf_ring[lmac_id].hal_srng)
soc->rx_refill_buf_ring[lmac_id]. htt_srng_setup(soc->htt_handle, mac_for_pdev,
hal_srng, RXDMA_BUF); soc->rx_refill_buf_ring[lmac_id].
hal_srng, RXDMA_BUF);
/* Configure monitor mode rings */ /* Configure monitor mode rings */
dp_monitor_htt_srng_setup(soc, pdev, dp_monitor_htt_srng_setup(soc, pdev,
lmac_id, lmac_id,
@@ -12044,25 +12046,25 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
goto fail3; goto fail3;
} }
if (!QDF_IS_STATUS_SUCCESS(soc->arch_ops.txrx_soc_attach(soc))) {
dp_err("unable to do target specific attach");
goto fail4;
}
if (dp_soc_srng_alloc(soc)) { if (dp_soc_srng_alloc(soc)) {
dp_err("failed to allocate soc srng rings"); dp_err("failed to allocate soc srng rings");
goto fail4; goto fail5;
} }
if (dp_soc_tx_desc_sw_pools_alloc(soc)) { if (dp_soc_tx_desc_sw_pools_alloc(soc)) {
dp_err("dp_soc_tx_desc_sw_pools_alloc failed"); dp_err("dp_soc_tx_desc_sw_pools_alloc failed");
goto fail5;
}
if (!QDF_IS_STATUS_SUCCESS(soc->arch_ops.txrx_soc_attach(soc))) {
dp_err("unable to do target specific attach");
goto fail6; goto fail6;
} }
if (!dp_monitor_modularized_enable()) { if (!dp_monitor_modularized_enable()) {
if (dp_mon_soc_attach_wrapper(soc)) { if (dp_mon_soc_attach_wrapper(soc)) {
dp_err("failed to attach monitor"); dp_err("failed to attach monitor");
goto fail6; goto fail7;
} }
} }
@@ -12081,10 +12083,12 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
qdf_skb_total_mem_stats_read()); qdf_skb_total_mem_stats_read());
return soc; return soc;
fail6: fail7:
dp_soc_tx_desc_sw_pools_free(soc); dp_soc_tx_desc_sw_pools_free(soc);
fail5: fail6:
dp_soc_srng_free(soc); dp_soc_srng_free(soc);
fail5:
soc->arch_ops.txrx_soc_detach(soc);
fail4: fail4:
dp_hw_link_desc_ring_free(soc); dp_hw_link_desc_ring_free(soc);
fail3: fail3:
@@ -12733,8 +12737,10 @@ static void dp_pdev_srng_deinit(struct dp_pdev *pdev)
struct dp_soc *soc = pdev->soc; struct dp_soc *soc = pdev->soc;
uint8_t i; uint8_t i;
dp_srng_deinit(soc, &soc->rx_refill_buf_ring[pdev->lmac_id], RXDMA_BUF, if (!hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc))
pdev->lmac_id); dp_srng_deinit(soc, &soc->rx_refill_buf_ring[pdev->lmac_id],
RXDMA_BUF,
pdev->lmac_id);
if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) { if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) {
dp_deinit_tx_pair_by_index(soc, IPA_TCL_DATA_RING_IDX); dp_deinit_tx_pair_by_index(soc, IPA_TCL_DATA_RING_IDX);
@@ -12777,10 +12783,13 @@ static QDF_STATUS dp_pdev_srng_init(struct dp_pdev *pdev)
soc_cfg_ctx = soc->wlan_cfg_ctx; soc_cfg_ctx = soc->wlan_cfg_ctx;
if (dp_srng_init(soc, &soc->rx_refill_buf_ring[pdev->lmac_id], if (!hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc)) {
RXDMA_BUF, 0, pdev->lmac_id)) { if (dp_srng_init(soc, &soc->rx_refill_buf_ring[pdev->lmac_id],
dp_init_err("%pK: dp_srng_init failed rx refill ring", soc); RXDMA_BUF, 0, pdev->lmac_id)) {
goto fail1; dp_init_err("%pK: dp_srng_init failed rx refill ring",
soc);
goto fail1;
}
} }
if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) { if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) {
@@ -12837,7 +12846,8 @@ static void dp_pdev_srng_free(struct dp_pdev *pdev)
struct dp_soc *soc = pdev->soc; struct dp_soc *soc = pdev->soc;
uint8_t i; uint8_t i;
dp_srng_free(soc, &soc->rx_refill_buf_ring[pdev->lmac_id]); if (!hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc))
dp_srng_free(soc, &soc->rx_refill_buf_ring[pdev->lmac_id]);
if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) { if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) {
dp_free_tx_ring_pair_by_index(soc, IPA_TCL_DATA_RING_IDX); dp_free_tx_ring_pair_by_index(soc, IPA_TCL_DATA_RING_IDX);
@@ -12872,10 +12882,13 @@ static QDF_STATUS dp_pdev_srng_alloc(struct dp_pdev *pdev)
soc_cfg_ctx = soc->wlan_cfg_ctx; soc_cfg_ctx = soc->wlan_cfg_ctx;
ring_size = wlan_cfg_get_dp_soc_rxdma_refill_ring_size(soc_cfg_ctx); ring_size = wlan_cfg_get_dp_soc_rxdma_refill_ring_size(soc_cfg_ctx);
if (dp_srng_alloc(soc, &soc->rx_refill_buf_ring[pdev->lmac_id], if (!hal_dmac_cmn_src_rxbuf_ring_get(soc->hal_soc)) {
RXDMA_BUF, ring_size, 0)) { if (dp_srng_alloc(soc, &soc->rx_refill_buf_ring[pdev->lmac_id],
dp_init_err("%pK: dp_srng_alloc failed rx refill ring", soc); RXDMA_BUF, ring_size, 0)) {
goto fail1; dp_init_err("%pK: dp_srng_alloc failed rx refill ring",
soc);
goto fail1;
}
} }
if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) { if (wlan_cfg_is_ipa_enabled(soc->wlan_cfg_ctx)) {

View File

@@ -2175,6 +2175,9 @@ struct dp_soc {
#endif #endif
uint8_t rxdma2sw_rings_not_supported:1, uint8_t rxdma2sw_rings_not_supported:1,
mec_fw_offload:1; mec_fw_offload:1;
/* Number of Rx refill rings */
uint8_t num_rx_refill_buf_rings;
}; };
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD

View File

@@ -2961,4 +2961,12 @@ hal_cmem_write(hal_soc_handle_t hal_soc_hdl, uint32_t offset,
return; return;
} }
static inline bool
hal_dmac_cmn_src_rxbuf_ring_get(hal_soc_handle_t hal_soc_hdl)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
return hal_soc->dmac_cmn_src_rxbuf_ring;
}
#endif /* _HAL_APIH_ */ #endif /* _HAL_APIH_ */