techpack: ipa: Read number of cb supported from dtsi

Read the the max number of cb supported from dtsi. When expected number
of cb's are probed, mark IPA_FW_LOAD_EVNT_SMMU_DONE.
Calculate hw_type_index after auto & mhi config is already saved in
ipa context.

Signed-off-by: Akshay Pandit <pandit@codeaurora.org>
This commit is contained in:
Akshay Pandit
2020-12-16 13:31:24 +05:30
committed by Gerrit - the friendly Code Review server
parent 894d1fee7b
commit 9e9824bcc6
2 changed files with 23 additions and 2 deletions

View File

@@ -7433,7 +7433,6 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
ipa3_ctx->ipa_cfg_offset = resource_p->ipa_cfg_offset; ipa3_ctx->ipa_cfg_offset = resource_p->ipa_cfg_offset;
ipa3_ctx->ipa_hw_type = resource_p->ipa_hw_type; ipa3_ctx->ipa_hw_type = resource_p->ipa_hw_type;
ipa3_ctx->ipa_config_is_mhi = resource_p->ipa_mhi_dynamic_config; ipa3_ctx->ipa_config_is_mhi = resource_p->ipa_mhi_dynamic_config;
ipa3_ctx->hw_type_index = ipa3_get_hw_type_index();
ipa3_ctx->ipa3_hw_mode = resource_p->ipa3_hw_mode; ipa3_ctx->ipa3_hw_mode = resource_p->ipa3_hw_mode;
ipa3_ctx->platform_type = resource_p->platform_type; ipa3_ctx->platform_type = resource_p->platform_type;
ipa3_ctx->use_ipa_teth_bridge = resource_p->use_ipa_teth_bridge; ipa3_ctx->use_ipa_teth_bridge = resource_p->use_ipa_teth_bridge;
@@ -7490,6 +7489,8 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
resource_p->tx_wrapper_cache_max_size); resource_p->tx_wrapper_cache_max_size);
ipa3_ctx->ipa_config_is_auto = resource_p->ipa_config_is_auto; ipa3_ctx->ipa_config_is_auto = resource_p->ipa_config_is_auto;
ipa3_ctx->ipa_mhi_proxy = resource_p->ipa_mhi_proxy; ipa3_ctx->ipa_mhi_proxy = resource_p->ipa_mhi_proxy;
ipa3_ctx->max_num_smmu_cb = resource_p->max_num_smmu_cb;
ipa3_ctx->hw_type_index = ipa3_get_hw_type_index();
if (resource_p->gsi_fw_file_name) { if (resource_p->gsi_fw_file_name) {
ipa3_ctx->gsi_fw_file_name = ipa3_ctx->gsi_fw_file_name =
@@ -8275,6 +8276,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
ipa_drv_res->skip_ieob_mask_wa = false; ipa_drv_res->skip_ieob_mask_wa = false;
ipa_drv_res->ipa_gpi_event_rp_ddr = false; ipa_drv_res->ipa_gpi_event_rp_ddr = false;
ipa_drv_res->ipa_config_is_auto = false; ipa_drv_res->ipa_config_is_auto = false;
ipa_drv_res->max_num_smmu_cb = IPA_SMMU_CB_MAX;
/* Get IPA HW Version */ /* Get IPA HW Version */
result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver", result = of_property_read_u32(pdev->dev.of_node, "qcom,ipa-hw-ver",
@@ -8831,6 +8833,16 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
get_dts_tx_wrapper_cache_size(pdev, ipa_drv_res); get_dts_tx_wrapper_cache_size(pdev, ipa_drv_res);
result = of_property_read_u32(pdev->dev.of_node,
"qcom,max_num_smmu_cb",
&ipa_drv_res->max_num_smmu_cb);
if (result)
IPADBG(": using default max number of cb = %d\n",
ipa_drv_res->max_num_smmu_cb);
else
IPADBG(": found ipa_drv_res->max_num_smmu_cb = %d\n",
ipa_drv_res->max_num_smmu_cb);
return 0; return 0;
} }
@@ -9336,7 +9348,8 @@ static void ipa_smmu_update_fw_loader(void)
break; break;
} }
} }
if (i == IPA_SMMU_CB_MAX) { if (i == IPA_SMMU_CB_MAX ||
ipa3_ctx->num_smmu_cb_probed == ipa3_ctx->max_num_smmu_cb) {
IPADBG("All %d CBs probed\n", IPA_SMMU_CB_MAX); IPADBG("All %d CBs probed\n", IPA_SMMU_CB_MAX);
ipa_fw_load_sm_handle_event(IPA_FW_LOAD_EVNT_SMMU_DONE); ipa_fw_load_sm_handle_event(IPA_FW_LOAD_EVNT_SMMU_DONE);
} }
@@ -9396,6 +9409,7 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p)
cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_AP); cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_AP);
cb->dev = dev; cb->dev = dev;
smmu_info.present[IPA_SMMU_CB_AP] = true; smmu_info.present[IPA_SMMU_CB_AP] = true;
ipa3_ctx->num_smmu_cb_probed++;
ipa_smmu_update_fw_loader(); ipa_smmu_update_fw_loader();
return 0; return 0;
@@ -9409,6 +9423,7 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p)
cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_WLAN); cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_WLAN);
cb->dev = dev; cb->dev = dev;
smmu_info.present[IPA_SMMU_CB_WLAN] = true; smmu_info.present[IPA_SMMU_CB_WLAN] = true;
ipa3_ctx->num_smmu_cb_probed++;
ipa_smmu_update_fw_loader(); ipa_smmu_update_fw_loader();
return 0; return 0;
@@ -9422,6 +9437,7 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p)
cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_UC); cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_UC);
cb->dev = dev; cb->dev = dev;
smmu_info.present[IPA_SMMU_CB_UC] = true; smmu_info.present[IPA_SMMU_CB_UC] = true;
ipa3_ctx->num_smmu_cb_probed++;
ipa_smmu_update_fw_loader(); ipa_smmu_update_fw_loader();
return 0; return 0;
@@ -9435,6 +9451,7 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p)
cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_11AD); cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_11AD);
cb->dev = dev; cb->dev = dev;
smmu_info.present[IPA_SMMU_CB_11AD] = true; smmu_info.present[IPA_SMMU_CB_11AD] = true;
ipa3_ctx->num_smmu_cb_probed++;
ipa_smmu_update_fw_loader(); ipa_smmu_update_fw_loader();
if (ipa3_ctx->use_xbl_boot) { if (ipa3_ctx->use_xbl_boot) {

View File

@@ -1977,6 +1977,7 @@ struct ipa3_eth_error_stats {
* @gsi_fw_file_name: GSI IPA fw file name * @gsi_fw_file_name: GSI IPA fw file name
* @uc_fw_file_name: uC IPA fw file name * @uc_fw_file_name: uC IPA fw file name
* @eth_info: ethernet client mapping * @eth_info: ethernet client mapping
* @max_num_smmu_cb: number of smmu s1 cb supported
*/ */
struct ipa3_context { struct ipa3_context {
struct ipa3_char_device_context cdev; struct ipa3_char_device_context cdev;
@@ -2173,6 +2174,8 @@ struct ipa3_context {
eth_info[IPA_ETH_CLIENT_MAX][IPA_ETH_INST_ID_MAX]; eth_info[IPA_ETH_CLIENT_MAX][IPA_ETH_INST_ID_MAX];
u32 ipa_wan_aggr_pkt_cnt; u32 ipa_wan_aggr_pkt_cnt;
bool ipa_mhi_proxy; bool ipa_mhi_proxy;
u32 num_smmu_cb_probed;
u32 max_num_smmu_cb;
}; };
struct ipa3_plat_drv_res { struct ipa3_plat_drv_res {
@@ -2241,6 +2244,7 @@ struct ipa3_plat_drv_res {
u32 tx_wrapper_cache_max_size; u32 tx_wrapper_cache_max_size;
u32 ipa_wan_aggr_pkt_cnt; u32 ipa_wan_aggr_pkt_cnt;
bool ipa_mhi_proxy; bool ipa_mhi_proxy;
u32 max_num_smmu_cb;
}; };
/** /**