Loading drivers/platform/msm/gsi/gsi.c +88 −0 Original line number Original line Diff line number Diff line Loading @@ -4128,6 +4128,94 @@ int gsi_map_virtual_ch_to_per_ep(u32 ee, u32 chan_num, u32 per_ep_index) } } EXPORT_SYMBOL(gsi_map_virtual_ch_to_per_ep); EXPORT_SYMBOL(gsi_map_virtual_ch_to_per_ep); void gsi_wdi3_write_evt_ring_db(unsigned long evt_ring_hdl, uint32_t db_addr_low, uint32_t db_addr_high) { if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return; } gsi_writel(db_addr_low, gsi_ctx->base + GSI_EE_n_EV_CH_k_CNTXT_12_OFFS(evt_ring_hdl, gsi_ctx->per.ee)); gsi_writel(db_addr_high, gsi_ctx->base + GSI_EE_n_EV_CH_k_CNTXT_13_OFFS(evt_ring_hdl, gsi_ctx->per.ee)); } EXPORT_SYMBOL(gsi_wdi3_write_evt_ring_db); void gsi_wdi3_dump_register(unsigned long chan_hdl) { uint32_t val; if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return; } GSIDBG("reg dump ch id %d\n", chan_hdl); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_0_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_0_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_1_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_1_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_2_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_2_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_3_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_3_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_4_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_4_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_5_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_5_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_6_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_6_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_7_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_7_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_RE_FETCH_READ_PTR_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_RE_FETCH_READ_PTR_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_RE_FETCH_WRITE_PTR_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_RE_FETCH_WRITE_PTR_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_QOS_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_QOS_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_0_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_0_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_1_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_1_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_2_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_2_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_3_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_3_OFFS 0x%x\n", val); } EXPORT_SYMBOL(gsi_wdi3_dump_register); static int msm_gsi_probe(struct platform_device *pdev) static int msm_gsi_probe(struct platform_device *pdev) { { struct device *dev = &pdev->dev; struct device *dev = &pdev->dev; Loading drivers/platform/msm/ipa/ipa_api.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -117,7 +117,7 @@ const char *ipa_clients_strings[IPA_CLIENT_MAX] = { __stringify(IPA_CLIENT_HSIC5_CONS), __stringify(IPA_CLIENT_HSIC5_CONS), __stringify(IPA_CLIENT_WLAN1_PROD), __stringify(IPA_CLIENT_WLAN1_PROD), __stringify(IPA_CLIENT_WLAN1_CONS), __stringify(IPA_CLIENT_WLAN1_CONS), __stringify(IPA_CLIENT_A5_WLAN_AMPDU_PROD), __stringify(IPA_CLIENT_WLAN2_PROD), __stringify(IPA_CLIENT_WLAN2_CONS), __stringify(IPA_CLIENT_WLAN2_CONS), __stringify(RESERVED_PROD_14), __stringify(RESERVED_PROD_14), __stringify(IPA_CLIENT_WLAN3_CONS), __stringify(IPA_CLIENT_WLAN3_CONS), Loading drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c +47 −14 Original line number Original line Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only /* /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ */ #include <linux/ipa_wdi3.h> #include <linux/ipa_wdi3.h> Loading @@ -8,6 +8,7 @@ #include <linux/string.h> #include <linux/string.h> #include "../ipa_common_i.h" #include "../ipa_common_i.h" #include "../ipa_v3/ipa_pm.h" #include "../ipa_v3/ipa_pm.h" #include "../ipa_v3/ipa_i.h" #define OFFLOAD_DRV_NAME "ipa_wdi" #define OFFLOAD_DRV_NAME "ipa_wdi" #define IPA_WDI_DBG(fmt, args...) \ #define IPA_WDI_DBG(fmt, args...) \ Loading Loading @@ -113,6 +114,10 @@ int ipa_wdi_init(struct ipa_wdi_init_in_params *in, ipa_wdi_ctx->is_smmu_enabled = out->is_smmu_enabled; ipa_wdi_ctx->is_smmu_enabled = out->is_smmu_enabled; if (ipa3_ctx->ipa_wdi3_over_gsi) out->is_over_gsi = true; else out->is_over_gsi = false; return 0; return 0; } } EXPORT_SYMBOL(ipa_wdi_init); EXPORT_SYMBOL(ipa_wdi_init); Loading Loading @@ -243,14 +248,20 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in) memset(tx_prop, 0, sizeof(tx_prop)); memset(tx_prop, 0, sizeof(tx_prop)); tx_prop[0].ip = IPA_IP_v4; tx_prop[0].ip = IPA_IP_v4; if (!ipa3_ctx->ipa_wdi3_over_gsi) tx_prop[0].dst_pipe = IPA_CLIENT_WLAN1_CONS; tx_prop[0].dst_pipe = IPA_CLIENT_WLAN1_CONS; else tx_prop[0].dst_pipe = IPA_CLIENT_WLAN2_CONS; tx_prop[0].alt_dst_pipe = in->alt_dst_pipe; tx_prop[0].alt_dst_pipe = in->alt_dst_pipe; tx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; tx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; strlcpy(tx_prop[0].hdr_name, hdr->hdr[IPA_IP_v4].name, strlcpy(tx_prop[0].hdr_name, hdr->hdr[IPA_IP_v4].name, sizeof(tx_prop[0].hdr_name)); sizeof(tx_prop[0].hdr_name)); tx_prop[1].ip = IPA_IP_v6; tx_prop[1].ip = IPA_IP_v6; if (!ipa3_ctx->ipa_wdi3_over_gsi) tx_prop[1].dst_pipe = IPA_CLIENT_WLAN1_CONS; tx_prop[1].dst_pipe = IPA_CLIENT_WLAN1_CONS; else tx_prop[1].dst_pipe = IPA_CLIENT_WLAN2_CONS; tx_prop[1].alt_dst_pipe = in->alt_dst_pipe; tx_prop[1].alt_dst_pipe = in->alt_dst_pipe; tx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; tx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; strlcpy(tx_prop[1].hdr_name, hdr->hdr[IPA_IP_v6].name, strlcpy(tx_prop[1].hdr_name, hdr->hdr[IPA_IP_v6].name, Loading @@ -259,10 +270,12 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in) /* populate rx prop */ /* populate rx prop */ rx.num_props = 2; rx.num_props = 2; rx.prop = rx_prop; rx.prop = rx_prop; memset(rx_prop, 0, sizeof(rx_prop)); memset(rx_prop, 0, sizeof(rx_prop)); rx_prop[0].ip = IPA_IP_v4; rx_prop[0].ip = IPA_IP_v4; if (!ipa3_ctx->ipa_wdi3_over_gsi) rx_prop[0].src_pipe = IPA_CLIENT_WLAN1_PROD; rx_prop[0].src_pipe = IPA_CLIENT_WLAN1_PROD; else rx_prop[0].src_pipe = IPA_CLIENT_WLAN2_PROD; rx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; rx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; if (in->is_meta_data_valid) { if (in->is_meta_data_valid) { rx_prop[0].attrib.attrib_mask |= IPA_FLT_META_DATA; rx_prop[0].attrib.attrib_mask |= IPA_FLT_META_DATA; Loading @@ -271,7 +284,10 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in) } } rx_prop[1].ip = IPA_IP_v6; rx_prop[1].ip = IPA_IP_v6; if (!ipa3_ctx->ipa_wdi3_over_gsi) rx_prop[1].src_pipe = IPA_CLIENT_WLAN1_PROD; rx_prop[1].src_pipe = IPA_CLIENT_WLAN1_PROD; else rx_prop[1].src_pipe = IPA_CLIENT_WLAN2_PROD; rx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; rx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; if (in->is_meta_data_valid) { if (in->is_meta_data_valid) { rx_prop[1].attrib.attrib_mask |= IPA_FLT_META_DATA; rx_prop[1].attrib.attrib_mask |= IPA_FLT_META_DATA; Loading Loading @@ -649,8 +665,13 @@ int ipa_wdi_disconn_pipes(void) } } } } if (!ipa3_ctx->ipa_wdi3_over_gsi) { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); } else { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS); } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_disconn_wdi_pipes(ipa_ep_idx_rx, ipa_ep_idx_tx)) { if (ipa_disconn_wdi_pipes(ipa_ep_idx_rx, ipa_ep_idx_tx)) { Loading Loading @@ -705,8 +726,13 @@ int ipa_wdi_enable_pipes(void) return -EPERM; return -EPERM; } } if (!ipa3_ctx->ipa_wdi3_over_gsi) { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); } else { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS); } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_enable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { if (ipa_enable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { Loading Loading @@ -766,8 +792,13 @@ int ipa_wdi_disable_pipes(void) return -EPERM; return -EPERM; } } if (!ipa3_ctx->ipa_wdi3_over_gsi) { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); } else { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS); } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_disable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { if (ipa_disable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { Loading Loading @@ -825,9 +856,11 @@ int ipa_wdi_set_perf_profile(struct ipa_wdi_perf_profile *profile) rm_profile.max_supported_bandwidth_mbps = rm_profile.max_supported_bandwidth_mbps = profile->max_supported_bw_mbps; profile->max_supported_bw_mbps; if (profile->client == IPA_CLIENT_WLAN1_PROD) { if (profile->client == IPA_CLIENT_WLAN1_PROD || profile->client == IPA_CLIENT_WLAN2_PROD) { resource_name = IPA_RM_RESOURCE_WLAN_PROD; resource_name = IPA_RM_RESOURCE_WLAN_PROD; } else if (profile->client == IPA_CLIENT_WLAN1_CONS) { } else if (profile->client == IPA_CLIENT_WLAN1_CONS || profile->client == IPA_CLIENT_WLAN2_CONS) { resource_name = IPA_RM_RESOURCE_WLAN_CONS; resource_name = IPA_RM_RESOURCE_WLAN_CONS; } else { } else { IPA_WDI_ERR("not supported\n"); IPA_WDI_ERR("not supported\n"); Loading drivers/platform/msm/ipa/ipa_v3/ipa.c +9 −0 Original line number Original line Diff line number Diff line Loading @@ -5219,6 +5219,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, ipa3_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt; ipa3_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt; ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2; ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2; ipa3_ctx->ipa_wdi2_over_gsi = resource_p->ipa_wdi2_over_gsi; ipa3_ctx->ipa_wdi2_over_gsi = resource_p->ipa_wdi2_over_gsi; ipa3_ctx->ipa_wdi3_over_gsi = resource_p->ipa_wdi3_over_gsi; ipa3_ctx->ipa_fltrt_not_hashable = resource_p->ipa_fltrt_not_hashable; ipa3_ctx->ipa_fltrt_not_hashable = resource_p->ipa_fltrt_not_hashable; ipa3_ctx->use_64_bit_dma_mask = resource_p->use_64_bit_dma_mask; ipa3_ctx->use_64_bit_dma_mask = resource_p->use_64_bit_dma_mask; ipa3_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size; ipa3_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size; Loading Loading @@ -5804,6 +5805,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, ipa_drv_res->modem_cfg_emb_pipe_flt = false; ipa_drv_res->modem_cfg_emb_pipe_flt = false; ipa_drv_res->ipa_wdi2 = false; ipa_drv_res->ipa_wdi2 = false; ipa_drv_res->ipa_wdi2_over_gsi = false; ipa_drv_res->ipa_wdi2_over_gsi = false; ipa_drv_res->ipa_wdi3_over_gsi = false; ipa_drv_res->ipa_mhi_dynamic_config = false; ipa_drv_res->ipa_mhi_dynamic_config = false; ipa_drv_res->use_64_bit_dma_mask = false; ipa_drv_res->use_64_bit_dma_mask = false; ipa_drv_res->use_bw_vote = false; ipa_drv_res->use_bw_vote = false; Loading Loading @@ -5902,6 +5904,13 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, ipa_drv_res->ipa_wdi2_over_gsi ipa_drv_res->ipa_wdi2_over_gsi ? "True" : "False"); ? "True" : "False"); ipa_drv_res->ipa_wdi3_over_gsi = of_property_read_bool(pdev->dev.of_node, "qcom,ipa-wdi3-over-gsi"); IPADBG(": WDI-3.0 over gsi= %s\n", ipa_drv_res->ipa_wdi3_over_gsi ? "True" : "False"); ipa_drv_res->ipa_wdi2 = ipa_drv_res->ipa_wdi2 = of_property_read_bool(pdev->dev.of_node, of_property_read_bool(pdev->dev.of_node, "qcom,ipa-wdi2"); "qcom,ipa-wdi2"); Loading drivers/platform/msm/ipa/ipa_v3/ipa_i.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -1600,6 +1600,7 @@ struct ipa3_context { bool modem_cfg_emb_pipe_flt; bool modem_cfg_emb_pipe_flt; bool ipa_wdi2; bool ipa_wdi2; bool ipa_wdi2_over_gsi; bool ipa_wdi2_over_gsi; bool ipa_wdi3_over_gsi; bool ipa_fltrt_not_hashable; bool ipa_fltrt_not_hashable; bool use_64_bit_dma_mask; bool use_64_bit_dma_mask; /* featurize if memory footprint becomes a concern */ /* featurize if memory footprint becomes a concern */ Loading Loading @@ -1689,6 +1690,7 @@ struct ipa3_plat_drv_res { bool modem_cfg_emb_pipe_flt; bool modem_cfg_emb_pipe_flt; bool ipa_wdi2; bool ipa_wdi2; bool ipa_wdi2_over_gsi; bool ipa_wdi2_over_gsi; bool ipa_wdi3_over_gsi; bool ipa_fltrt_not_hashable; bool ipa_fltrt_not_hashable; bool use_64_bit_dma_mask; bool use_64_bit_dma_mask; bool use_bw_vote; bool use_bw_vote; Loading Loading @@ -2270,6 +2272,10 @@ int ipa_create_uc_smmu_mapping(int res_idx, bool wlan_smmu_en, phys_addr_t pa, struct sg_table *sgt, size_t len, bool device, phys_addr_t pa, struct sg_table *sgt, size_t len, bool device, unsigned long *iova); unsigned long *iova); int ipa_create_gsi_smmu_mapping(int res_idx, bool wlan_smmu_en, phys_addr_t pa, struct sg_table *sgt, size_t len, bool device, unsigned long *iova); /* /* * Tethering bridge (Rmnet / MBIM) * Tethering bridge (Rmnet / MBIM) */ */ Loading Loading @@ -2507,6 +2513,7 @@ void ipa3_active_clients_unlock(void); int ipa3_wdi_init(void); int ipa3_wdi_init(void); int ipa3_write_qmapid_gsi_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_gsi_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi3_gsi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_tag_process(struct ipa3_desc *desc, int num_descs, int ipa3_tag_process(struct ipa3_desc *desc, int num_descs, unsigned long timeout); unsigned long timeout); Loading Loading
drivers/platform/msm/gsi/gsi.c +88 −0 Original line number Original line Diff line number Diff line Loading @@ -4128,6 +4128,94 @@ int gsi_map_virtual_ch_to_per_ep(u32 ee, u32 chan_num, u32 per_ep_index) } } EXPORT_SYMBOL(gsi_map_virtual_ch_to_per_ep); EXPORT_SYMBOL(gsi_map_virtual_ch_to_per_ep); void gsi_wdi3_write_evt_ring_db(unsigned long evt_ring_hdl, uint32_t db_addr_low, uint32_t db_addr_high) { if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return; } gsi_writel(db_addr_low, gsi_ctx->base + GSI_EE_n_EV_CH_k_CNTXT_12_OFFS(evt_ring_hdl, gsi_ctx->per.ee)); gsi_writel(db_addr_high, gsi_ctx->base + GSI_EE_n_EV_CH_k_CNTXT_13_OFFS(evt_ring_hdl, gsi_ctx->per.ee)); } EXPORT_SYMBOL(gsi_wdi3_write_evt_ring_db); void gsi_wdi3_dump_register(unsigned long chan_hdl) { uint32_t val; if (!gsi_ctx) { pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__); return; } GSIDBG("reg dump ch id %d\n", chan_hdl); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_0_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_0_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_1_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_1_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_2_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_2_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_3_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_3_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_4_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_4_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_5_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_5_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_6_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_6_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_CNTXT_7_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_CNTXT_7_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_RE_FETCH_READ_PTR_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_RE_FETCH_READ_PTR_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_RE_FETCH_WRITE_PTR_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_RE_FETCH_WRITE_PTR_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_QOS_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_QOS_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_0_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_0_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_1_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_1_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_2_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_2_OFFS 0x%x\n", val); val = gsi_readl(gsi_ctx->base + GSI_EE_n_GSI_CH_k_SCRATCH_3_OFFS(chan_hdl, gsi_ctx->per.ee)); GSIDBG("GSI_EE_n_GSI_CH_k_SCRATCH_3_OFFS 0x%x\n", val); } EXPORT_SYMBOL(gsi_wdi3_dump_register); static int msm_gsi_probe(struct platform_device *pdev) static int msm_gsi_probe(struct platform_device *pdev) { { struct device *dev = &pdev->dev; struct device *dev = &pdev->dev; Loading
drivers/platform/msm/ipa/ipa_api.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -117,7 +117,7 @@ const char *ipa_clients_strings[IPA_CLIENT_MAX] = { __stringify(IPA_CLIENT_HSIC5_CONS), __stringify(IPA_CLIENT_HSIC5_CONS), __stringify(IPA_CLIENT_WLAN1_PROD), __stringify(IPA_CLIENT_WLAN1_PROD), __stringify(IPA_CLIENT_WLAN1_CONS), __stringify(IPA_CLIENT_WLAN1_CONS), __stringify(IPA_CLIENT_A5_WLAN_AMPDU_PROD), __stringify(IPA_CLIENT_WLAN2_PROD), __stringify(IPA_CLIENT_WLAN2_CONS), __stringify(IPA_CLIENT_WLAN2_CONS), __stringify(RESERVED_PROD_14), __stringify(RESERVED_PROD_14), __stringify(IPA_CLIENT_WLAN3_CONS), __stringify(IPA_CLIENT_WLAN3_CONS), Loading
drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c +47 −14 Original line number Original line Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only /* /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ */ #include <linux/ipa_wdi3.h> #include <linux/ipa_wdi3.h> Loading @@ -8,6 +8,7 @@ #include <linux/string.h> #include <linux/string.h> #include "../ipa_common_i.h" #include "../ipa_common_i.h" #include "../ipa_v3/ipa_pm.h" #include "../ipa_v3/ipa_pm.h" #include "../ipa_v3/ipa_i.h" #define OFFLOAD_DRV_NAME "ipa_wdi" #define OFFLOAD_DRV_NAME "ipa_wdi" #define IPA_WDI_DBG(fmt, args...) \ #define IPA_WDI_DBG(fmt, args...) \ Loading Loading @@ -113,6 +114,10 @@ int ipa_wdi_init(struct ipa_wdi_init_in_params *in, ipa_wdi_ctx->is_smmu_enabled = out->is_smmu_enabled; ipa_wdi_ctx->is_smmu_enabled = out->is_smmu_enabled; if (ipa3_ctx->ipa_wdi3_over_gsi) out->is_over_gsi = true; else out->is_over_gsi = false; return 0; return 0; } } EXPORT_SYMBOL(ipa_wdi_init); EXPORT_SYMBOL(ipa_wdi_init); Loading Loading @@ -243,14 +248,20 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in) memset(tx_prop, 0, sizeof(tx_prop)); memset(tx_prop, 0, sizeof(tx_prop)); tx_prop[0].ip = IPA_IP_v4; tx_prop[0].ip = IPA_IP_v4; if (!ipa3_ctx->ipa_wdi3_over_gsi) tx_prop[0].dst_pipe = IPA_CLIENT_WLAN1_CONS; tx_prop[0].dst_pipe = IPA_CLIENT_WLAN1_CONS; else tx_prop[0].dst_pipe = IPA_CLIENT_WLAN2_CONS; tx_prop[0].alt_dst_pipe = in->alt_dst_pipe; tx_prop[0].alt_dst_pipe = in->alt_dst_pipe; tx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; tx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; strlcpy(tx_prop[0].hdr_name, hdr->hdr[IPA_IP_v4].name, strlcpy(tx_prop[0].hdr_name, hdr->hdr[IPA_IP_v4].name, sizeof(tx_prop[0].hdr_name)); sizeof(tx_prop[0].hdr_name)); tx_prop[1].ip = IPA_IP_v6; tx_prop[1].ip = IPA_IP_v6; if (!ipa3_ctx->ipa_wdi3_over_gsi) tx_prop[1].dst_pipe = IPA_CLIENT_WLAN1_CONS; tx_prop[1].dst_pipe = IPA_CLIENT_WLAN1_CONS; else tx_prop[1].dst_pipe = IPA_CLIENT_WLAN2_CONS; tx_prop[1].alt_dst_pipe = in->alt_dst_pipe; tx_prop[1].alt_dst_pipe = in->alt_dst_pipe; tx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; tx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; strlcpy(tx_prop[1].hdr_name, hdr->hdr[IPA_IP_v6].name, strlcpy(tx_prop[1].hdr_name, hdr->hdr[IPA_IP_v6].name, Loading @@ -259,10 +270,12 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in) /* populate rx prop */ /* populate rx prop */ rx.num_props = 2; rx.num_props = 2; rx.prop = rx_prop; rx.prop = rx_prop; memset(rx_prop, 0, sizeof(rx_prop)); memset(rx_prop, 0, sizeof(rx_prop)); rx_prop[0].ip = IPA_IP_v4; rx_prop[0].ip = IPA_IP_v4; if (!ipa3_ctx->ipa_wdi3_over_gsi) rx_prop[0].src_pipe = IPA_CLIENT_WLAN1_PROD; rx_prop[0].src_pipe = IPA_CLIENT_WLAN1_PROD; else rx_prop[0].src_pipe = IPA_CLIENT_WLAN2_PROD; rx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; rx_prop[0].hdr_l2_type = in->hdr_info[0].hdr_type; if (in->is_meta_data_valid) { if (in->is_meta_data_valid) { rx_prop[0].attrib.attrib_mask |= IPA_FLT_META_DATA; rx_prop[0].attrib.attrib_mask |= IPA_FLT_META_DATA; Loading @@ -271,7 +284,10 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in) } } rx_prop[1].ip = IPA_IP_v6; rx_prop[1].ip = IPA_IP_v6; if (!ipa3_ctx->ipa_wdi3_over_gsi) rx_prop[1].src_pipe = IPA_CLIENT_WLAN1_PROD; rx_prop[1].src_pipe = IPA_CLIENT_WLAN1_PROD; else rx_prop[1].src_pipe = IPA_CLIENT_WLAN2_PROD; rx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; rx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type; if (in->is_meta_data_valid) { if (in->is_meta_data_valid) { rx_prop[1].attrib.attrib_mask |= IPA_FLT_META_DATA; rx_prop[1].attrib.attrib_mask |= IPA_FLT_META_DATA; Loading Loading @@ -649,8 +665,13 @@ int ipa_wdi_disconn_pipes(void) } } } } if (!ipa3_ctx->ipa_wdi3_over_gsi) { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); } else { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS); } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_disconn_wdi_pipes(ipa_ep_idx_rx, ipa_ep_idx_tx)) { if (ipa_disconn_wdi_pipes(ipa_ep_idx_rx, ipa_ep_idx_tx)) { Loading Loading @@ -705,8 +726,13 @@ int ipa_wdi_enable_pipes(void) return -EPERM; return -EPERM; } } if (!ipa3_ctx->ipa_wdi3_over_gsi) { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); } else { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS); } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_enable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { if (ipa_enable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { Loading Loading @@ -766,8 +792,13 @@ int ipa_wdi_disable_pipes(void) return -EPERM; return -EPERM; } } if (!ipa3_ctx->ipa_wdi3_over_gsi) { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS); } else { ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD); ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS); } if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_wdi_ctx->wdi_version == IPA_WDI_3) { if (ipa_disable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { if (ipa_disable_wdi_pipes(ipa_ep_idx_tx, ipa_ep_idx_rx)) { Loading Loading @@ -825,9 +856,11 @@ int ipa_wdi_set_perf_profile(struct ipa_wdi_perf_profile *profile) rm_profile.max_supported_bandwidth_mbps = rm_profile.max_supported_bandwidth_mbps = profile->max_supported_bw_mbps; profile->max_supported_bw_mbps; if (profile->client == IPA_CLIENT_WLAN1_PROD) { if (profile->client == IPA_CLIENT_WLAN1_PROD || profile->client == IPA_CLIENT_WLAN2_PROD) { resource_name = IPA_RM_RESOURCE_WLAN_PROD; resource_name = IPA_RM_RESOURCE_WLAN_PROD; } else if (profile->client == IPA_CLIENT_WLAN1_CONS) { } else if (profile->client == IPA_CLIENT_WLAN1_CONS || profile->client == IPA_CLIENT_WLAN2_CONS) { resource_name = IPA_RM_RESOURCE_WLAN_CONS; resource_name = IPA_RM_RESOURCE_WLAN_CONS; } else { } else { IPA_WDI_ERR("not supported\n"); IPA_WDI_ERR("not supported\n"); Loading
drivers/platform/msm/ipa/ipa_v3/ipa.c +9 −0 Original line number Original line Diff line number Diff line Loading @@ -5219,6 +5219,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, ipa3_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt; ipa3_ctx->modem_cfg_emb_pipe_flt = resource_p->modem_cfg_emb_pipe_flt; ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2; ipa3_ctx->ipa_wdi2 = resource_p->ipa_wdi2; ipa3_ctx->ipa_wdi2_over_gsi = resource_p->ipa_wdi2_over_gsi; ipa3_ctx->ipa_wdi2_over_gsi = resource_p->ipa_wdi2_over_gsi; ipa3_ctx->ipa_wdi3_over_gsi = resource_p->ipa_wdi3_over_gsi; ipa3_ctx->ipa_fltrt_not_hashable = resource_p->ipa_fltrt_not_hashable; ipa3_ctx->ipa_fltrt_not_hashable = resource_p->ipa_fltrt_not_hashable; ipa3_ctx->use_64_bit_dma_mask = resource_p->use_64_bit_dma_mask; ipa3_ctx->use_64_bit_dma_mask = resource_p->use_64_bit_dma_mask; ipa3_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size; ipa3_ctx->wan_rx_ring_size = resource_p->wan_rx_ring_size; Loading Loading @@ -5804,6 +5805,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, ipa_drv_res->modem_cfg_emb_pipe_flt = false; ipa_drv_res->modem_cfg_emb_pipe_flt = false; ipa_drv_res->ipa_wdi2 = false; ipa_drv_res->ipa_wdi2 = false; ipa_drv_res->ipa_wdi2_over_gsi = false; ipa_drv_res->ipa_wdi2_over_gsi = false; ipa_drv_res->ipa_wdi3_over_gsi = false; ipa_drv_res->ipa_mhi_dynamic_config = false; ipa_drv_res->ipa_mhi_dynamic_config = false; ipa_drv_res->use_64_bit_dma_mask = false; ipa_drv_res->use_64_bit_dma_mask = false; ipa_drv_res->use_bw_vote = false; ipa_drv_res->use_bw_vote = false; Loading Loading @@ -5902,6 +5904,13 @@ static int get_ipa_dts_configuration(struct platform_device *pdev, ipa_drv_res->ipa_wdi2_over_gsi ipa_drv_res->ipa_wdi2_over_gsi ? "True" : "False"); ? "True" : "False"); ipa_drv_res->ipa_wdi3_over_gsi = of_property_read_bool(pdev->dev.of_node, "qcom,ipa-wdi3-over-gsi"); IPADBG(": WDI-3.0 over gsi= %s\n", ipa_drv_res->ipa_wdi3_over_gsi ? "True" : "False"); ipa_drv_res->ipa_wdi2 = ipa_drv_res->ipa_wdi2 = of_property_read_bool(pdev->dev.of_node, of_property_read_bool(pdev->dev.of_node, "qcom,ipa-wdi2"); "qcom,ipa-wdi2"); Loading
drivers/platform/msm/ipa/ipa_v3/ipa_i.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -1600,6 +1600,7 @@ struct ipa3_context { bool modem_cfg_emb_pipe_flt; bool modem_cfg_emb_pipe_flt; bool ipa_wdi2; bool ipa_wdi2; bool ipa_wdi2_over_gsi; bool ipa_wdi2_over_gsi; bool ipa_wdi3_over_gsi; bool ipa_fltrt_not_hashable; bool ipa_fltrt_not_hashable; bool use_64_bit_dma_mask; bool use_64_bit_dma_mask; /* featurize if memory footprint becomes a concern */ /* featurize if memory footprint becomes a concern */ Loading Loading @@ -1689,6 +1690,7 @@ struct ipa3_plat_drv_res { bool modem_cfg_emb_pipe_flt; bool modem_cfg_emb_pipe_flt; bool ipa_wdi2; bool ipa_wdi2; bool ipa_wdi2_over_gsi; bool ipa_wdi2_over_gsi; bool ipa_wdi3_over_gsi; bool ipa_fltrt_not_hashable; bool ipa_fltrt_not_hashable; bool use_64_bit_dma_mask; bool use_64_bit_dma_mask; bool use_bw_vote; bool use_bw_vote; Loading Loading @@ -2270,6 +2272,10 @@ int ipa_create_uc_smmu_mapping(int res_idx, bool wlan_smmu_en, phys_addr_t pa, struct sg_table *sgt, size_t len, bool device, phys_addr_t pa, struct sg_table *sgt, size_t len, bool device, unsigned long *iova); unsigned long *iova); int ipa_create_gsi_smmu_mapping(int res_idx, bool wlan_smmu_en, phys_addr_t pa, struct sg_table *sgt, size_t len, bool device, unsigned long *iova); /* /* * Tethering bridge (Rmnet / MBIM) * Tethering bridge (Rmnet / MBIM) */ */ Loading Loading @@ -2507,6 +2513,7 @@ void ipa3_active_clients_unlock(void); int ipa3_wdi_init(void); int ipa3_wdi_init(void); int ipa3_write_qmapid_gsi_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_gsi_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi3_gsi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_tag_process(struct ipa3_desc *desc, int num_descs, int ipa3_tag_process(struct ipa3_desc *desc, int num_descs, unsigned long timeout); unsigned long timeout); Loading