Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
msm: ipa: support dtsi entry for auto config
Browse files Browse the repository at this point in the history
Add support for new dtsi entry specifying auto configuration.

Change-Id: Ie27ca9e09ac228c5bfbf8832a9b123f733cab765
Signed-off-by: Akshay Pandit <pandit@codeaurora.org>
  • Loading branch information
Akshay Pandit committed Nov 14, 2019
1 parent d63e903 commit 2929dbc
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/platform/msm/ipa.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ memory allocation over a PCIe bridge
using wdi-2.0 or not
- qcom,ipa-wdi3-over-gsi: Boolean context flag to indicate whether
using wdi-3.0 or not
- qcom,ipa-config-is-auto: Boolean context flag to indicate ipa to be
used in auto config or not
- qcom,bandwidth-vote-for-ipa: Boolean context flag to indicate whether
ipa clock voting is done by bandwidth
voting via msm-bus-scale driver or not
Expand Down
5 changes: 5 additions & 0 deletions drivers/platform/msm/ipa/ipa_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ const char *ipa_clients_strings[IPA_CLIENT_MAX] = {
__stringify(IPA_CLIENT_MHI_PRIME_TETH_PROD),
__stringify(IPA_CLIENT_MHI_PRIME_TETH_CONS),
__stringify(IPA_CLIENT_MHI_PRIME_DPL_PROD),
__stringify(RESERVERD_CONS_103),
__stringify(IPA_CLIENT_MHI2_PROD),
__stringify(IPA_CLIENT_MHI2_CONS),
__stringify(IPA_CLIENT_Q6_CV2X_PROD),
__stringify(IPA_CLIENT_Q6_CV2X_CONS),
};

/**
Expand Down
9 changes: 9 additions & 0 deletions drivers/platform/msm/ipa/ipa_v3/ipa.c
Original file line number Diff line number Diff line change
Expand Up @@ -6432,6 +6432,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
ipa3_ctx->secure_debug_check_action =
resource_p->secure_debug_check_action;
ipa3_ctx->ipa_mhi_proxy = resource_p->ipa_mhi_proxy;
ipa3_ctx->ipa_config_is_auto = resource_p->ipa_config_is_auto;

if (ipa3_ctx->secure_debug_check_action == USE_SCM) {
if (ipa_is_mem_dump_allowed())
Expand Down Expand Up @@ -7089,6 +7090,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
ipa_drv_res->mhi_evid_limits[1] = IPA_MHI_GSI_EVENT_RING_ID_END;
ipa_drv_res->ipa_fltrt_not_hashable = false;
ipa_drv_res->ipa_endp_delay_wa = false;
ipa_drv_res->ipa_config_is_auto = false;

/* Get IPA HW Version */
result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver",
Expand Down Expand Up @@ -7195,6 +7197,13 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
ipa_drv_res->ipa_wdi2
? "True" : "False");

ipa_drv_res->ipa_config_is_auto =
of_property_read_bool(pdev->dev.of_node,
"qcom,ipa-config-is-auto");
IPADBG(": ipa-config-is-auto = %s\n",
ipa_drv_res->ipa_config_is_auto
? "True" : "False");

ipa_drv_res->ipa_wan_skb_page =
of_property_read_bool(pdev->dev.of_node,
"qcom,wan-use-skb-page");
Expand Down
3 changes: 3 additions & 0 deletions drivers/platform/msm/ipa/ipa_v3/ipa_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,7 @@ struct ipa3_pc_mbox_data {
* @logbuf: ipc log buffer for high priority messages
* @logbuf_low: ipc log buffer for low priority messages
* @ipa_wdi2: using wdi-2.0
* @ipa_config_is_auto: is this AUTO use case
* @ipa_fltrt_not_hashable: filter/route rules not hashable
* @use_64_bit_dma_mask: using 64bits dma mask
* @ipa_bus_hdl: msm driver handle for the data path bus
Expand Down Expand Up @@ -1828,6 +1829,7 @@ struct ipa3_context {
bool use_ipa_teth_bridge;
bool modem_cfg_emb_pipe_flt;
bool ipa_wdi2;
bool ipa_config_is_auto;
bool ipa_wdi2_over_gsi;
bool ipa_wdi3_over_gsi;
bool ipa_endp_delay_wa;
Expand Down Expand Up @@ -1941,6 +1943,7 @@ struct ipa3_plat_drv_res {
u32 ee;
bool modem_cfg_emb_pipe_flt;
bool ipa_wdi2;
bool ipa_config_is_auto;
bool ipa_wdi2_over_gsi;
bool ipa_wdi3_over_gsi;
bool ipa_fltrt_not_hashable;
Expand Down
17 changes: 17 additions & 0 deletions drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
#define IPA_v4_5_GROUP_UL_DL (1)
#define IPA_v4_5_MHI_GROUP_DDR (1)
#define IPA_v4_5_MHI_GROUP_DMA (2)
#define IPA_v4_5_GROUP_CV2X (2)
#define IPA_v4_5_MHI_GROUP_QDSS (3)
#define IPA_v4_5_GROUP_UC_RX_Q (4)
#define IPA_v4_5_SRC_GROUP_MAX (5)
Expand Down Expand Up @@ -261,6 +262,8 @@ enum ipa_ver {
IPA_4_5,
IPA_4_5_MHI,
IPA_4_5_APQ,
IPA_4_5_AUTO,
IPA_4_5_AUTO_MHI,
IPA_VER_MAX,
};

Expand Down Expand Up @@ -3280,6 +3283,11 @@ static u8 ipa3_get_hw_type_index(void)
hw_type_index = IPA_4_5_MHI;
if (ipa3_ctx->platform_type == IPA_PLAT_TYPE_APQ)
hw_type_index = IPA_4_5_APQ;
if (ipa3_ctx->ipa_config_is_auto)
hw_type_index = IPA_4_5_AUTO;
if (ipa3_ctx->ipa_config_is_auto &&
ipa3_ctx->ipa_config_is_mhi)
hw_type_index = IPA_4_5_AUTO_MHI;
break;
default:
IPAERR("Incorrect IPA version %d\n", ipa3_ctx->ipa_hw_type);
Expand Down Expand Up @@ -6924,6 +6932,8 @@ static void ipa3_write_rsrc_grp_type_reg(int group_index,
break;
case IPA_4_5:
case IPA_4_5_MHI:
case IPA_4_5_AUTO:
case IPA_4_5_AUTO_MHI:
if (src) {
switch (group_index) {
case IPA_v4_5_MHI_GROUP_PCIE:
Expand Down Expand Up @@ -7128,6 +7138,13 @@ void ipa3_set_resorce_groups_min_max_limits(void)
src_grp_idx_max = IPA_v4_5_SRC_GROUP_MAX;
dst_grp_idx_max = IPA_v4_5_DST_GROUP_MAX;
break;
case IPA_4_5_AUTO:
case IPA_4_5_AUTO_MHI:
src_rsrc_type_max = IPA_v4_0_RSRC_GRP_TYPE_SRC_MAX;
dst_rsrc_type_max = IPA_v4_0_RSRC_GRP_TYPE_DST_MAX;
src_grp_idx_max = IPA_v4_5_SRC_GROUP_MAX;
dst_grp_idx_max = IPA_v4_5_DST_GROUP_MAX;
break;
default:
IPAERR("invalid hw type index\n");
WARN_ON(1);
Expand Down
20 changes: 19 additions & 1 deletion include/uapi/linux/msm_ipa.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
(IPA_MAX_FLT_RT_CNT_INDEX - IPA_FLT_RT_HW_COUNTER)
#define IPA_MAX_FLT_RT_CLIENTS 60

/**
* New feature flag for CV2X config.
*/

#define IPA_CV2X_SUPPORT

/**
* the attributes of the rule (routing or filtering)
Expand Down Expand Up @@ -374,12 +379,21 @@ enum ipa_client_type {

IPA_CLIENT_MHI_PRIME_TETH_PROD = 98,
IPA_CLIENT_MHI_PRIME_TETH_CONS = 99,

IPA_CLIENT_MHI_PRIME_RMNET_PROD = 100,
IPA_CLIENT_MHI_PRIME_RMNET_CONS = 101,

IPA_CLIENT_MHI_PRIME_DPL_PROD = 102,
/* RESERVERD CONS = 103, */

IPA_CLIENT_MHI2_PROD = 104,
IPA_CLIENT_MHI2_CONS = 105,

IPA_CLIENT_Q6_CV2X_PROD = 106,
IPA_CLIENT_Q6_CV2X_CONS = 107,
};

#define IPA_CLIENT_MAX (IPA_CLIENT_MHI_PRIME_DPL_PROD + 1)
#define IPA_CLIENT_MAX (IPA_CLIENT_Q6_CV2X_CONS + 1)

#define IPA_CLIENT_WLAN2_PROD IPA_CLIENT_A5_WLAN_AMPDU_PROD
#define IPA_CLIENT_Q6_DL_NLO_DATA_PROD IPA_CLIENT_Q6_DL_NLO_DATA_PROD
Expand Down Expand Up @@ -437,6 +451,7 @@ enum ipa_client_type {
(client) == IPA_CLIENT_Q6_UL_NLO_DATA_CONS || \
(client) == IPA_CLIENT_Q6_UL_NLO_ACK_CONS || \
(client) == IPA_CLIENT_Q6_QBAP_STATUS_CONS || \
(client) == IPA_CLIENT_Q6_CV2X_CONS || \
(client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS)

#define IPA_CLIENT_IS_Q6_PROD(client) \
Expand All @@ -446,6 +461,7 @@ enum ipa_client_type {
(client) == IPA_CLIENT_Q6_DECOMP_PROD || \
(client) == IPA_CLIENT_Q6_DECOMP2_PROD || \
(client) == IPA_CLIENT_Q6_DL_NLO_DATA_PROD || \
(client) == IPA_CLIENT_Q6_CV2X_PROD || \
(client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD)

#define IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client) \
Expand All @@ -456,6 +472,7 @@ enum ipa_client_type {
(client) == IPA_CLIENT_Q6_UL_NLO_DATA_CONS || \
(client) == IPA_CLIENT_Q6_UL_NLO_ACK_CONS || \
(client) == IPA_CLIENT_Q6_QBAP_STATUS_CONS || \
(client) == IPA_CLIENT_Q6_CV2X_CONS || \
(client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS)

#define IPA_CLIENT_IS_Q6_ZIP_CONS(client) \
Expand All @@ -467,6 +484,7 @@ enum ipa_client_type {
(client) == IPA_CLIENT_Q6_WAN_PROD || \
(client) == IPA_CLIENT_Q6_CMD_PROD || \
(client) == IPA_CLIENT_Q6_DL_NLO_DATA_PROD || \
(client) == IPA_CLIENT_Q6_CV2X_PROD || \
(client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD)

#define IPA_CLIENT_IS_Q6_ZIP_PROD(client) \
Expand Down

0 comments on commit 2929dbc

Please sign in to comment.