qcacld-3.0: Add IPA over GSI support

For IPA WDI3.0 veresion IPA uses GSI FW. So add IPA
over GSI support.

Change-Id: I3ecdb0b365e6004f7694d19ea8165233f00c6335
CRs-Fixed: 2368038
This commit is contained in:
Sravan Kumar Kairam 2018-11-19 18:43:15 +05:30 • committed by nshrivas
commit c047d29ff2
4 changed files with 41 additions and 12 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -627,6 +627,7 @@ struct wlan_ipa_priv {
qdf_ipa_wdi_in_params_t prod_pipe_in;
bool uc_loaded;
bool wdi_enabled;
bool over_gsi;
qdf_mc_timer_t rt_debug_fill_timer;
qdf_mutex_t rt_debug_lock;
qdf_mutex_t ipa_lock;

View file

@ -321,7 +321,7 @@ static inline QDF_STATUS wlan_ipa_wdi_setup(struct wlan_ipa_priv *ipa_ctx,
&ipa_ctx->tx_pipe_handle,
&ipa_ctx->rx_pipe_handle,
wlan_ipa_wdi_is_smmu_enabled(ipa_ctx, osdev),
sys_in);
sys_in, ipa_ctx->over_gsi);
}
#ifdef FEATURE_METERING
@ -373,13 +373,18 @@ static inline QDF_STATUS wlan_ipa_wdi_init(struct wlan_ipa_priv *ipa_ctx)
return QDF_STATUS_E_FAILURE;
}
ipa_ctx->over_gsi =
QDF_IPA_WDI_INIT_OUT_PARAMS_IS_OVER_GSI(&out);
ipa_ctx->is_smmu_enabled =
QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(&out);
ipa_info("ipa_over_gsi: %d, is_smmu_enabled: %d",
ipa_ctx->over_gsi, ipa_ctx->is_smmu_enabled);
if (QDF_IPA_WDI_INIT_OUT_PARAMS_IS_UC_READY(&out)) {
ipa_debug("IPA uC READY");
ipa_ctx->uc_loaded = true;
ipa_ctx->is_smmu_enabled =
QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(&out);
ipa_debug("is_smmu_enabled=%d", ipa_ctx->is_smmu_enabled);
} else {
ipa_info("IPA uc not ready");
return QDF_STATUS_E_BUSY;
}
@ -2254,7 +2259,7 @@ static int wlan_ipa_setup_tx_sys_pipe(struct wlan_ipa_priv *ipa_ctx,
#else
/**
* wlan_ipa_setup_tx_sys_pipe() - Setup IPA Tx system pipes
* @ipa_ctx: Global IPA IPA context
* @ipa_ctx: IPA context
* @desc_fifo_sz: Number of descriptors
*
* Return: 0 on success, negative errno on error
@ -2270,6 +2275,27 @@ static int wlan_ipa_setup_tx_sys_pipe(struct wlan_ipa_priv *ipa_ctx,
}
#endif
#ifdef CONFIG_IPA_WDI_UNIFIED_API
/**
* wlan_ipa_get_rx_ipa_client() - Get IPA RX ipa client
* @ipa_ctx: IPA context
*
* Return: rx ipa sys client
*/
static inline uint8_t wlan_ipa_get_rx_ipa_client(struct wlan_ipa_priv *ipa_ctx)
{
if (ipa_ctx->over_gsi)
return IPA_CLIENT_WLAN2_PROD;
else
return IPA_CLIENT_WLAN1_PROD;
}
#else
static inline uint8_t wlan_ipa_get_rx_ipa_client(struct wlan_ipa_priv *ipa_ctx)
{
return IPA_CLIENT_WLAN1_PROD;
}
#endif
/**
* wlan_ipa_setup_rx_sys_pipe() - Setup IPA Rx system pipes
* @ipa_ctx: Global IPA IPA context
@ -2290,8 +2316,7 @@ static int wlan_ipa_setup_rx_sys_pipe(struct wlan_ipa_priv *ipa_ctx,
*/
ipa = &ipa_ctx->sys_pipe[WLAN_IPA_RX_PIPE].ipa_sys_params;
ipa->client = IPA_CLIENT_WLAN1_PROD;
ipa->client = wlan_ipa_get_rx_ipa_client(ipa_ctx);
ipa->desc_fifo_sz = desc_fifo_sz;
ipa->priv = ipa_ctx;
ipa->notify = wlan_ipa_w2i_cb;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -482,6 +482,7 @@ static inline void ol_txrx_ipa_wdi_rx_params(
* @p_rx_pipe_handle: pointer to Rx pipe handle
* @is_smmu_enabled: Is SMMU enabled or not
* @sys_in: parameters to setup sys pipe in mcc mode
* @over_gsi: is ipa ver gsi fw
*
* Return: QDF_STATUS
*/
@ -490,7 +491,8 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
uint32_t ipa_desc_size, void *ipa_priv,
bool is_rm_enabled, uint32_t *p_tx_pipe_handle,
uint32_t *p_rx_pipe_handle, bool is_smmu_enabled,
qdf_ipa_sys_connect_params_t *sys_in)
qdf_ipa_sys_connect_params_t *sys_in,
bool over_gsi)
{
ol_txrx_pdev_handle pdev = (ol_txrx_pdev_handle)ppdev;
struct ol_txrx_ipa_resources *ipa_res = &pdev->ipa_resource;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -128,7 +128,8 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle,
bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in);
bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in,
bool over_gsi);
#else /* CONFIG_IPA_WDI_UNIFIED_API */
QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,