Merge "qcacmn: Add support for enabling TWO tx_pipe"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
3d28fd8ee3
@@ -79,6 +79,28 @@ struct dp_ipa_reo_remap_record {
|
|||||||
|
|
||||||
#define REO_REMAP_HISTORY_SIZE 32
|
#define REO_REMAP_HISTORY_SIZE 32
|
||||||
|
|
||||||
|
#if defined(IPA_WDI3_TX_TWO_PIPES) && defined(QCA_IPA_LL_TX_FLOW_CONTROL)
|
||||||
|
static bool dp_ipa_is_alt_tx_required(struct dp_soc *soc)
|
||||||
|
{
|
||||||
|
uint8_t num_radio = soc->pdev_count;
|
||||||
|
|
||||||
|
if (num_radio > 1)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#elif defined(IPA_WDI3_TX_TWO_PIPES)
|
||||||
|
static bool dp_ipa_is_alt_tx_required(struct dp_soc *soc)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static bool dp_ipa_is_alt_tx_required(struct dp_soc *soc)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct dp_ipa_reo_remap_record dp_ipa_reo_remap_history[REO_REMAP_HISTORY_SIZE];
|
struct dp_ipa_reo_remap_record dp_ipa_reo_remap_history[REO_REMAP_HISTORY_SIZE];
|
||||||
|
|
||||||
static qdf_atomic_t dp_ipa_reo_remap_history_index;
|
static qdf_atomic_t dp_ipa_reo_remap_history_index;
|
||||||
@@ -809,6 +831,7 @@ static void dp_ipa_map_ring_doorbell_paddr(struct dp_pdev *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup for alternative TX pipe */
|
/* Setup for alternative TX pipe */
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
if (!ipa_res->tx_alt_comp_doorbell_paddr)
|
if (!ipa_res->tx_alt_comp_doorbell_paddr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -827,6 +850,7 @@ static void dp_ipa_map_ring_doorbell_paddr(struct dp_pdev *pdev)
|
|||||||
ipa_res->tx_alt_comp_doorbell_paddr = tx_comp_doorbell_dmaaddr;
|
ipa_res->tx_alt_comp_doorbell_paddr = tx_comp_doorbell_dmaaddr;
|
||||||
qdf_assert_always(!ret);
|
qdf_assert_always(!ret);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dp_ipa_unmap_ring_doorbell_paddr(struct dp_pdev *pdev)
|
static void dp_ipa_unmap_ring_doorbell_paddr(struct dp_pdev *pdev)
|
||||||
@@ -839,12 +863,14 @@ static void dp_ipa_unmap_ring_doorbell_paddr(struct dp_pdev *pdev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Unmap must be in reverse order of map */
|
/* Unmap must be in reverse order of map */
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
if (ipa_res->tx_alt_comp_doorbell_paddr) {
|
if (ipa_res->tx_alt_comp_doorbell_paddr) {
|
||||||
ret = pld_smmu_unmap(soc->osdev->dev,
|
ret = pld_smmu_unmap(soc->osdev->dev,
|
||||||
ipa_res->tx_alt_comp_doorbell_paddr,
|
ipa_res->tx_alt_comp_doorbell_paddr,
|
||||||
sizeof(uint32_t));
|
sizeof(uint32_t));
|
||||||
qdf_assert_always(!ret);
|
qdf_assert_always(!ret);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = pld_smmu_unmap(soc->osdev->dev,
|
ret = pld_smmu_unmap(soc->osdev->dev,
|
||||||
ipa_res->rx_ready_doorbell_paddr,
|
ipa_res->rx_ready_doorbell_paddr,
|
||||||
@@ -1035,6 +1061,7 @@ static void dp_ipa_tx_comp_ring_init_hp(struct dp_soc *soc,
|
|||||||
res->tx_comp_doorbell_vaddr);
|
res->tx_comp_doorbell_vaddr);
|
||||||
|
|
||||||
/* Init the alternate TX comp ring */
|
/* Init the alternate TX comp ring */
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
if (!res->tx_alt_comp_doorbell_paddr)
|
if (!res->tx_alt_comp_doorbell_paddr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1043,6 +1070,7 @@ static void dp_ipa_tx_comp_ring_init_hp(struct dp_soc *soc,
|
|||||||
|
|
||||||
hal_srng_dst_init_hp(soc->hal_soc, wbm_srng,
|
hal_srng_dst_init_hp(soc->hal_soc, wbm_srng,
|
||||||
res->tx_alt_comp_doorbell_vaddr);
|
res->tx_alt_comp_doorbell_vaddr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dp_ipa_set_tx_doorbell_paddr(struct dp_soc *soc,
|
static void dp_ipa_set_tx_doorbell_paddr(struct dp_soc *soc,
|
||||||
@@ -1061,6 +1089,7 @@ static void dp_ipa_set_tx_doorbell_paddr(struct dp_soc *soc,
|
|||||||
(void *)ipa_res->tx_comp_doorbell_vaddr);
|
(void *)ipa_res->tx_comp_doorbell_vaddr);
|
||||||
|
|
||||||
/* Setup for alternative TX comp ring */
|
/* Setup for alternative TX comp ring */
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
if (!ipa_res->tx_alt_comp_doorbell_paddr)
|
if (!ipa_res->tx_alt_comp_doorbell_paddr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1073,6 +1102,7 @@ static void dp_ipa_set_tx_doorbell_paddr(struct dp_soc *soc,
|
|||||||
dp_info("paddr %pK vaddr %pK",
|
dp_info("paddr %pK vaddr %pK",
|
||||||
(void *)ipa_res->tx_alt_comp_doorbell_paddr,
|
(void *)ipa_res->tx_alt_comp_doorbell_paddr,
|
||||||
(void *)ipa_res->tx_alt_comp_doorbell_vaddr);
|
(void *)ipa_res->tx_alt_comp_doorbell_vaddr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IPA_SET_RESET_TX_DB_PA
|
#ifdef IPA_SET_RESET_TX_DB_PA
|
||||||
@@ -1092,6 +1122,9 @@ static QDF_STATUS dp_ipa_reset_tx_doorbell_pa(struct dp_soc *soc,
|
|||||||
|
|
||||||
dp_info("Reset WBM HP addr paddr: %pK", (void *)hp_addr);
|
dp_info("Reset WBM HP addr paddr: %pK", (void *)hp_addr);
|
||||||
|
|
||||||
|
if (!dp_ipa_is_alt_tx_required(soc))
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
|
||||||
/* Reset alternative TX comp ring */
|
/* Reset alternative TX comp ring */
|
||||||
wbm_srng = soc->tx_comp_ring[IPA_TX_ALT_COMP_RING_IDX].hal_srng;
|
wbm_srng = soc->tx_comp_ring[IPA_TX_ALT_COMP_RING_IDX].hal_srng;
|
||||||
if (!wbm_srng)
|
if (!wbm_srng)
|
||||||
@@ -1396,6 +1429,7 @@ int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
dp_tx_ipa_uc_detach(soc, pdev);
|
dp_tx_ipa_uc_detach(soc, pdev);
|
||||||
|
|
||||||
/* Cleanup 2nd TX pipe resources */
|
/* Cleanup 2nd TX pipe resources */
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc))
|
||||||
dp_ipa_tx_alt_pool_detach(soc, pdev);
|
dp_ipa_tx_alt_pool_detach(soc, pdev);
|
||||||
|
|
||||||
/* RX resource detach */
|
/* RX resource detach */
|
||||||
@@ -1560,6 +1594,7 @@ int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup 2nd TX pipe */
|
/* Setup 2nd TX pipe */
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
error = dp_ipa_tx_alt_pool_attach(soc);
|
error = dp_ipa_tx_alt_pool_attach(soc);
|
||||||
if (error) {
|
if (error) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -1568,6 +1603,7 @@ int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
dp_tx_ipa_uc_detach(soc, pdev);
|
dp_tx_ipa_uc_detach(soc, pdev);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* RX resource attach */
|
/* RX resource attach */
|
||||||
error = dp_rx_ipa_uc_attach(soc, pdev);
|
error = dp_rx_ipa_uc_attach(soc, pdev);
|
||||||
@@ -1575,6 +1611,7 @@ int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s: DP IPA UC RX attach fail code %d",
|
"%s: DP IPA UC RX attach fail code %d",
|
||||||
__func__, error);
|
__func__, error);
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc))
|
||||||
dp_ipa_tx_alt_pool_detach(soc, pdev);
|
dp_ipa_tx_alt_pool_detach(soc, pdev);
|
||||||
dp_tx_ipa_uc_detach(soc, pdev);
|
dp_tx_ipa_uc_detach(soc, pdev);
|
||||||
return error;
|
return error;
|
||||||
@@ -1904,8 +1941,10 @@ QDF_STATUS dp_ipa_get_resource(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
|||||||
&ipa_res->rx_refill_ring.mem_info))
|
&ipa_res->rx_refill_ring.mem_info))
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
if (dp_ipa_tx_alt_ring_get_resource(pdev))
|
if (dp_ipa_tx_alt_ring_get_resource(pdev))
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
if (dp_ipa_rx_alt_ring_get_resource(pdev))
|
if (dp_ipa_rx_alt_ring_get_resource(pdev))
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
@@ -2819,6 +2858,7 @@ QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
|||||||
else
|
else
|
||||||
dp_ipa_wdi_tx_params(soc, ipa_res, tx, over_gsi);
|
dp_ipa_wdi_tx_params(soc, ipa_res, tx, over_gsi);
|
||||||
|
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc))
|
||||||
dp_ipa_setup_tx_alt_pipe(soc, ipa_res, pipe_in);
|
dp_ipa_setup_tx_alt_pipe(soc, ipa_res, pipe_in);
|
||||||
|
|
||||||
/* RX PIPE */
|
/* RX PIPE */
|
||||||
@@ -3880,9 +3920,13 @@ QDF_STATUS dp_ipa_tx_buf_smmu_mapping(
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = dp_ipa_tx_alt_buf_smmu_mapping(soc, pdev, true, func, line);
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
|
ret = dp_ipa_tx_alt_buf_smmu_mapping(soc, pdev, true, func,
|
||||||
|
line);
|
||||||
if (ret)
|
if (ret)
|
||||||
__dp_ipa_tx_buf_smmu_mapping(soc, pdev, false, func, line);
|
__dp_ipa_tx_buf_smmu_mapping(soc, pdev, false, func,
|
||||||
|
line);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3904,10 +3948,15 @@ QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__dp_ipa_tx_buf_smmu_mapping(soc, pdev, false, func, line) ||
|
if (__dp_ipa_tx_buf_smmu_mapping(soc, pdev, false, func, line))
|
||||||
dp_ipa_tx_alt_buf_smmu_mapping(soc, pdev, false, func, line))
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
|
if (dp_ipa_is_alt_tx_required(soc)) {
|
||||||
|
if (dp_ipa_tx_alt_buf_smmu_mapping(soc, pdev, false, func,
|
||||||
|
line))
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user