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

Commit eedcc176 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 a863b366
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ memory allocation over a PCIe bridge
				0 (use scm call),
				1 (override scm call as though it returned true), and
				2 (override scm call as though it returned false)
- 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
@@ -6685,6 +6685,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
	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->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;
@@ -7365,6 +7366,7 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
	ipa_drv_res->ipa_wan_skb_page = false;
	ipa_drv_res->ipa_wdi2_over_gsi = false;
	ipa_drv_res->ipa_wdi3_over_gsi = 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;
@@ -7506,6 +7508,12 @@ static int get_ipa_dts_configuration(struct platform_device *pdev,
			ipa_drv_res->ipa_fltrt_not_hashable
			? "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");
@@ -8363,6 +8371,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
@@ -1798,6 +1798,7 @@ struct ipa3_app_clock_vote {
 * @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_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
@@ -1911,6 +1912,7 @@ struct ipa3_context {
	bool ipa_wdi3_over_gsi;
	bool ipa_endp_delay_wa;
	bool ipa_fltrt_not_hashable;
	bool use_xbl_boot;
	bool use_64_bit_dma_mask;
	/* featurize if memory footprint becomes a concern */
	struct ipa3_stats stats;
@@ -2026,6 +2028,7 @@ struct ipa3_plat_drv_res {
	bool ipa_wdi2_over_gsi;
	bool ipa_wdi3_over_gsi;
	bool ipa_fltrt_not_hashable;
	bool use_xbl_boot;
	bool use_64_bit_dma_mask;
	bool use_bw_vote;
	u32 wan_rx_ring_size;