Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f54f3b5 authored by Chaitanya Pratapa's avatar Chaitanya Pratapa
Browse files

msm: ipa: Add support to IPA FW load prior to kernel start



IPA FW is loaded via XBL to improve boot KPI enumeration
for MHI and USB use cases.Make changes to complete the IPA
initialization as early as possible without waiting for
user space trigger to load the fw.

Change-Id: I164484593d0bdcaf7e5dd2f67fde4a7ee143dc1a
Signed-off-by: default avatarChaitanya Pratapa <cpratapa@codeaurora.org>
parent d60b5f4f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ memory allocation over a PCIe bridge
                                monitoring of holb via IPA uc is required.
- qcom,wlan-ce-db-over-pcie: Boolean context flag to represent WLAN CE DB
				over pcie bus or not.
- qcom,use-xbl-boot: Boolean to indicate XBL boot loading for IPA FW

IPA pipe sub nodes (A2 static pipes configurations):

+34 −0
Original line number Diff line number Diff line
@@ -5380,6 +5380,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->ipa_wdi2 = resource_p->ipa_wdi2;
	ipa3_ctx->ipa_config_is_auto = resource_p->ipa_config_is_auto;
	ipa3_ctx->use_xbl_boot = resource_p->use_xbl_boot;
	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->lan_rx_ring_size = resource_p->lan_rx_ring_size;
@@ -5952,6 +5953,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
	ipa_drv_res->modem_cfg_emb_pipe_flt = false;
	ipa_drv_res->ipa_wdi2 = false;
	ipa_drv_res->ipa_config_is_auto = false;
	ipa_drv_res->use_xbl_boot = false;
	ipa_drv_res->ipa_mhi_dynamic_config = false;
	ipa_drv_res->use_64_bit_dma_mask = false;
	ipa_drv_res->use_bw_vote = false;
@@ -6043,6 +6045,12 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
			ipa_drv_res->ipa_config_is_auto
			? "True" : "False");

	ipa_drv_res->use_xbl_boot =
		of_property_read_bool(pdev->dev.of_node,
		"qcom,use-xbl-boot");
	IPADBG("Is xbl loading used ? (%s)\n",
		ipa_drv_res->use_xbl_boot ? "Yes":"No");

	ipa_drv_res->use_64_bit_dma_mask =
			of_property_read_bool(pdev->dev.of_node,
			"qcom,use-64-bit-dma-mask");
@@ -6782,6 +6790,32 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p,
		cb->dev = dev;
		smmu_info.present[IPA_SMMU_CB_UC] = true;

		if (ipa3_ctx->use_xbl_boot) {
			/* Ensure uC probe is the last. */
			if (!smmu_info.present[IPA_SMMU_CB_AP] ||
				!smmu_info.present[IPA_SMMU_CB_WLAN]) {
				IPAERR("AP or WLAN CB probe not done. Defer");
				return -EPROBE_DEFER;
			}

			pr_info("Using XBL boot load for IPA FW\n");
			ipa3_ctx->fw_loaded = true;

			result = ipa3_attach_to_smmu();
			if (result) {
				IPAERR("IPA attach to smmu failed %d\n",
				result);
				return result;
			}

			result = ipa3_post_init(&ipa3_res, ipa3_ctx->cdev.dev);
			if (result) {
				IPAERR("IPA post init failed %d\n", result);
				return result;
			}
		}


		return 0;
	}

+3 −0
Original line number Diff line number Diff line
@@ -1449,6 +1449,7 @@ struct ipa3_char_device_context {
 * @logbuf_low: ipc log buffer for low priority messages
 * @ipa_wdi2: using wdi-2.0
 * @ipa_config_is_auto: is this AUTO use case
 * @use_xbl_boot: use xbl loading for IPA FW
 * @use_64_bit_dma_mask: using 64bits dma mask
 * @ipa_bus_hdl: msm driver handle for the data path bus
 * @ctrl: holds the core specific operations based on
@@ -1551,6 +1552,7 @@ struct ipa3_context {
	bool modem_cfg_emb_pipe_flt;
	bool ipa_wdi2;
	bool ipa_config_is_auto;
	bool use_xbl_boot;
	bool use_64_bit_dma_mask;
	/* featurize if memory footprint becomes a concern */
	struct ipa3_stats stats;
@@ -1633,6 +1635,7 @@ struct ipa3_plat_drv_res {
	bool modem_cfg_emb_pipe_flt;
	bool ipa_wdi2;
	bool ipa_config_is_auto;
	bool use_xbl_boot;
	bool use_64_bit_dma_mask;
	bool use_bw_vote;
	u32 wan_rx_ring_size;