qcacmn: Support configure IPA tx alt ring and tx ring separately

Add support configure ipa tx ring and tx completion ring for
2.4G and/or 5G separately.

Change-Id: Iafb8fa589ff0cce15609a3dfa2209364291d7cef
CRs-Fixed: 2996604
This commit is contained in:
chunquan
2021-07-21 18:51:42 +08:00
committed by Madan Koyyalamudi
parent 050c08476e
commit 14d9d6d697
4 changed files with 153 additions and 7 deletions

View File

@@ -3972,9 +3972,10 @@ static bool dp_ipa_is_alt_tx_comp_ring(int index)
static void dp_ipa_get_tx_ring_size(int tx_ring_num, int *tx_ipa_ring_sz, static void dp_ipa_get_tx_ring_size(int tx_ring_num, int *tx_ipa_ring_sz,
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx) struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx)
{ {
if (tx_ring_num == IPA_TCL_DATA_RING_IDX || if (tx_ring_num == IPA_TCL_DATA_RING_IDX)
dp_ipa_is_alt_tx_ring(tx_ring_num))
*tx_ipa_ring_sz = wlan_cfg_ipa_tx_ring_size(soc_cfg_ctx); *tx_ipa_ring_sz = wlan_cfg_ipa_tx_ring_size(soc_cfg_ctx);
else if (dp_ipa_is_alt_tx_ring(tx_ring_num))
*tx_ipa_ring_sz = wlan_cfg_ipa_tx_alt_ring_size(soc_cfg_ctx);
} }
/** /**
@@ -3990,10 +3991,12 @@ static void dp_ipa_get_tx_comp_ring_size(int tx_comp_ring_num,
int *tx_comp_ipa_ring_sz, int *tx_comp_ipa_ring_sz,
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx) struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx)
{ {
if (tx_comp_ring_num == IPA_TCL_DATA_RING_IDX || if (tx_comp_ring_num == IPA_TCL_DATA_RING_IDX)
dp_ipa_is_alt_tx_comp_ring(tx_comp_ring_num))
*tx_comp_ipa_ring_sz = *tx_comp_ipa_ring_sz =
wlan_cfg_ipa_tx_comp_ring_size(soc_cfg_ctx); wlan_cfg_ipa_tx_comp_ring_size(soc_cfg_ctx);
else if (dp_ipa_is_alt_tx_comp_ring(tx_comp_ring_num))
*tx_comp_ipa_ring_sz =
wlan_cfg_ipa_tx_alt_comp_ring_size(soc_cfg_ctx);
} }
#else #else
static uint8_t dp_reo_ring_selection(uint32_t value, uint32_t *ring) static uint8_t dp_reo_ring_selection(uint32_t value, uint32_t *ring)

View File

@@ -72,6 +72,16 @@
#define WLAN_CFG_IPA_TX_COMP_RING_SIZE 1024 #define WLAN_CFG_IPA_TX_COMP_RING_SIZE 1024
#define WLAN_CFG_IPA_TX_COMP_RING_SIZE_MAX 8096 #define WLAN_CFG_IPA_TX_COMP_RING_SIZE_MAX 8096
#ifdef IPA_WDI3_TX_TWO_PIPES
#define WLAN_CFG_IPA_TX_ALT_RING_SIZE_MIN 1024
#define WLAN_CFG_IPA_TX_ALT_RING_SIZE 1024
#define WLAN_CFG_IPA_TX_ALT_RING_SIZE_MAX 8096
#define WLAN_CFG_IPA_TX_ALT_COMP_RING_SIZE_MIN 1024
#define WLAN_CFG_IPA_TX_ALT_COMP_RING_SIZE 1024
#define WLAN_CFG_IPA_TX_ALT_COMP_RING_SIZE_MAX 8096
#endif
#define WLAN_CFG_PER_PDEV_TX_RING 0 #define WLAN_CFG_PER_PDEV_TX_RING 0
#define WLAN_CFG_IPA_UC_TX_BUF_SIZE 2048 #define WLAN_CFG_IPA_UC_TX_BUF_SIZE 2048
#define WLAN_CFG_IPA_UC_TX_PARTITION_BASE 3000 #define WLAN_CFG_IPA_UC_TX_PARTITION_BASE 3000
@@ -1211,11 +1221,71 @@
WLAN_CFG_IPA_TX_COMP_RING_SIZE, \ WLAN_CFG_IPA_TX_COMP_RING_SIZE, \
CFG_VALUE_OR_DEFAULT, "IPA tx comp ring size") CFG_VALUE_OR_DEFAULT, "IPA tx comp ring size")
#ifdef IPA_WDI3_TX_TWO_PIPES
/*
* <ini>
* dp_ipa_tx_alt_ring_size - Set alt tcl ring size for IPA
* @Min: 1024
* @Max: 8096
* @Default: 1024
*
* This ini sets the alt tcl ring size for IPA
*
* Related: N/A
*
* Supported Feature: IPA
*
* Usage: Internal
*
* </ini>
*/
#define CFG_DP_IPA_TX_ALT_RING_SIZE \
CFG_INI_UINT("dp_ipa_tx_alt_ring_size", \
WLAN_CFG_IPA_TX_ALT_RING_SIZE_MIN, \
WLAN_CFG_IPA_TX_ALT_RING_SIZE_MAX, \
WLAN_CFG_IPA_TX_ALT_RING_SIZE, \
CFG_VALUE_OR_DEFAULT, \
"DP IPA TX Alternative Ring Size")
/*
* <ini>
* dp_ipa_tx_alt_comp_ring_size - Set tx alt comp ring size for IPA
* @Min: 1024
* @Max: 8096
* @Default: 1024
*
* This ini sets the tx alt comp ring size for IPA
*
* Related: N/A
*
* Supported Feature: IPA
*
* Usage: Internal
*
* </ini>
*/
#define CFG_DP_IPA_TX_ALT_COMP_RING_SIZE \
CFG_INI_UINT("dp_ipa_tx_alt_comp_ring_size", \
WLAN_CFG_IPA_TX_ALT_COMP_RING_SIZE_MIN, \
WLAN_CFG_IPA_TX_ALT_COMP_RING_SIZE_MAX, \
WLAN_CFG_IPA_TX_ALT_COMP_RING_SIZE, \
CFG_VALUE_OR_DEFAULT, \
"DP IPA TX Alternative Completion Ring Size")
#define CFG_DP_IPA_TX_ALT_RING_CFG \
CFG(CFG_DP_IPA_TX_ALT_RING_SIZE) \
CFG(CFG_DP_IPA_TX_ALT_COMP_RING_SIZE)
#else
#define CFG_DP_IPA_TX_ALT_RING_CFG
#endif
#define CFG_DP_IPA_TX_RING_CFG \ #define CFG_DP_IPA_TX_RING_CFG \
CFG(CFG_DP_IPA_TX_RING_SIZE) \ CFG(CFG_DP_IPA_TX_RING_SIZE) \
CFG(CFG_DP_IPA_TX_COMP_RING_SIZE) CFG(CFG_DP_IPA_TX_COMP_RING_SIZE)
#else #else
#define CFG_DP_IPA_TX_RING_CFG #define CFG_DP_IPA_TX_RING_CFG
#define CFG_DP_IPA_TX_ALT_RING_CFG
#endif #endif
#ifdef WLAN_SUPPORT_PPEDS #ifdef WLAN_SUPPORT_PPEDS
@@ -1350,5 +1420,6 @@
CFG(CFG_FORCE_RX_64_BA) \ CFG(CFG_FORCE_RX_64_BA) \
CFG(CFG_DP_DELAY_MON_REPLENISH) \ CFG(CFG_DP_DELAY_MON_REPLENISH) \
CFG_DP_IPA_TX_RING_CFG \ CFG_DP_IPA_TX_RING_CFG \
CFG_DP_PPE_CONFIG CFG_DP_PPE_CONFIG \
CFG_DP_IPA_TX_ALT_RING_CFG
#endif /* _CFG_DP_H_ */ #endif /* _CFG_DP_H_ */

View File

@@ -985,6 +985,29 @@ void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
#endif #endif
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD
#ifdef IPA_WDI3_TX_TWO_PIPES
/**
* wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config
* in dp soc cfg context
* @psoc: Object manager psoc
* @wlan_cfg_ctx: dp soc cfg ctx
*
* Return: None
*/
static void
wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
{
wlan_cfg_ctx->ipa_tx_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
wlan_cfg_ctx->ipa_tx_comp_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
wlan_cfg_ctx->ipa_tx_alt_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE);
wlan_cfg_ctx->ipa_tx_alt_comp_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE);
}
#else /* !IPA_WDI3_TX_TWO_PIPES */
/** /**
* wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
* cfg context * cfg context
@@ -1002,7 +1025,8 @@ wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
wlan_cfg_ctx->ipa_tx_comp_ring_size = wlan_cfg_ctx->ipa_tx_comp_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE); cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
} }
#else #endif /* IPA_WDI3_TX_TWO_PIPES */
#else /* !IPA_OFFLOAD */
static inline void static inline void
wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
@@ -2199,6 +2223,29 @@ uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
{ {
return cfg->ipa_tx_comp_ring_size; return cfg->ipa_tx_comp_ring_size;
} }
#ifdef IPA_WDI3_TX_TWO_PIPES
int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->ipa_tx_alt_ring_size;
}
int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->ipa_tx_alt_comp_ring_size;
}
#else
int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->ipa_tx_ring_size;
}
int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->ipa_tx_comp_ring_size;
}
#endif
#endif #endif
#ifdef WLAN_SUPPORT_PPEDS #ifdef WLAN_SUPPORT_PPEDS

View File

@@ -222,6 +222,8 @@ struct wlan_srng_cfg {
* @wow_check_rx_pending_enable: Enable RX frame pending check in WoW * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW
* @ipa_tx_ring_size: IPA tx ring size * @ipa_tx_ring_size: IPA tx ring size
* @ipa_tx_comp_ring_size: IPA tx completion ring size * @ipa_tx_comp_ring_size: IPA tx completion ring size
* @ipa_tx_alt_ring_size: IPA tx alt ring size
* @ipa_tx_alt_comp_ring_size: IPA tx alt completion ring size
* @hw_cc_conv_enabled: cookie conversion enabled * @hw_cc_conv_enabled: cookie conversion enabled
* @tcl_wbm_map_array: TCL-WBM map array * @tcl_wbm_map_array: TCL-WBM map array
*/ */
@@ -351,7 +353,11 @@ struct wlan_cfg_dp_soc_ctxt {
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD
uint32_t ipa_tx_ring_size; uint32_t ipa_tx_ring_size;
uint32_t ipa_tx_comp_ring_size; uint32_t ipa_tx_comp_ring_size;
#endif #ifdef IPA_WDI3_TX_TWO_PIPES
int ipa_tx_alt_ring_size;
int ipa_tx_alt_comp_ring_size;
#endif /* IPA_WDI3_TX_TWO_PIPES */
#endif /* IPA_OFFLOAD */
bool hw_cc_enabled; bool hw_cc_enabled;
struct wlan_cfg_tcl_wbm_ring_num_map *tcl_wbm_map_array; struct wlan_cfg_tcl_wbm_ring_num_map *tcl_wbm_map_array;
#ifdef WLAN_SUPPORT_PPEDS #ifdef WLAN_SUPPORT_PPEDS
@@ -1692,6 +1698,25 @@ uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
* Return: IPA Tx Completion ring size * Return: IPA Tx Completion ring size
*/ */
uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
/*
* wlan_cfg_ipa_tx_alt_ring_size - Get Tx alt DMA ring size (TCL Data Ring)
* @wlan_cfg_soc_ctx: dp cfg context
*
* Return: IPA Tx alt Ring Size
*/
int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
/*
* wlan_cfg_ipa_tx_alt_comp_ring_size - Get Tx alt comp DMA ring size
* (TCL Data Ring)
* @wlan_cfg_soc_ctx: dp cfg context
*
* Return: IPA Tx alt comp Ring Size
*/
int
wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
#else #else
static inline static inline
uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)