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

Commit 6100f6fe authored by Ravi Gummadidala's avatar Ravi Gummadidala Committed by Michael Bohan
Browse files

msm: ipa: add 64-bit support for IPA



This change has 64-bit compilation fixes and other
related cleanup.

On targets with IPA HW that mainline code applies to, A2 HW block no
longer exists. This makes a bunch of code (like a2_service.c,
ipa_bridge.c) obsolete. Also, teth_bridge.c is significantly different
because a new IPA driver running on Q6 subsumes most of the
functionality. We need an atomic change to ensure tethering
functionality does not break.

Change-Id: I279e6605dd30b0b8fc03808b69931c749c461914
Signed-off-by: default avatarRavi Gummadidala <rgummadi@codeaurora.org>
parent f63e9a46
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -52,6 +52,12 @@ Optional properties:
                    memory instead of system memory. In case this property
                    will not appear in the IPA DTS entry, the driver will
                    use system memory.
- clocks: This property shall provide a list of entries each of which
    contains a phandle to clock controller device and a macro that is
    the clock's name in hardware.This should be "clock_rpm" as clock
    controller phandle and "clk_ipa_clk" as macro for "iface_clk"
- clock-names: This property shall contain the clock input names used
    by driver in same order as the clocks property.This should be "iface_clk"

Example:

@@ -66,6 +72,9 @@ qcom,ipa@fd4c0000 {
	             <0 29 1>;
	interrupt-names = "ipa-irq", "bam-irq"; "a2-bam-irq";
	qcom,ipa-hw-ver = <1>;
	clocks = <&clock_rpm clk_ipa_clk>;
	clock-names = "iface_clk";


	qcom,pipe1 {
		label = "a2-to-ipa";
+2 −3
Original line number Diff line number Diff line
obj-$(CONFIG_IPA) += ipat.o
ipat-y := ipa.o ipa_debugfs.o ipa_hdr.o ipa_flt.o ipa_rt.o ipa_dp.o ipa_client.o \
	ipa_utils.o ipa_nat.o a2_service.o ipa_bridge.o ipa_intf.o teth_bridge.o \
	ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o \
	ipa_interrupts.o
	ipa_utils.o ipa_nat.o ipa_intf.o teth_bridge.o ipa_interrupts.o \
	ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o

obj-$(CONFIG_RMNET_IPA) += rmnet_ipa.o ipa_qmi_service_v01.o ipa_qmi_service.o rmnet_ipa_fd_ioctl.o
+3 −25
Original line number Diff line number Diff line
@@ -1170,6 +1170,7 @@ static int ipa_setup_apps_pipes(void)
	sys_in.desc_fifo_sz = IPA_SYS_DESC_FIFO_SZ;
	sys_in.ipa_ep_cfg.mode.mode = IPA_DMA;
	sys_in.ipa_ep_cfg.mode.dst = IPA_CLIENT_APPS_LAN_CONS;
	sys_in.skip_ep_cfg = true;
	if (ipa_setup_sys_pipe(&sys_in, &ipa_ctx->clnt_hdl_cmd)) {
		IPAERR(":setup sys pipe failed.\n");
		result = -EPERM;
@@ -2011,7 +2012,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
	result = sps_register_bam_device(&bam_props, &ipa_ctx->bam_handle);
	if (result) {
		IPAERR(":bam register err.\n");
		result = -ENODEV;
		result = -EPROBE_DEFER;
		goto fail_init_hw;
	}
	IPADBG("IPA BAM is registered\n");
@@ -2148,17 +2149,6 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
	/* enable IPA clocks until the end of the initialization */
	ipa_inc_client_enable_clks();

	/* HW bridge to allow A2<->IPA BAM2BAM communication */
	if (ipa_ctx->use_ipa_bamdma_a2_bridge) {
		result = ipa_bridge_init();
		if (result) {
			IPAERR("ipa bamdma-bridge init err.\n");
			result = -ENODEV;
			goto fail_apps_pipes;
		}
		IPADBG("IPA-A2 HW bridge initialized");
	}

	/*
	 * setup an empty routing table in system memory, this will be used
	 * to delete a routing table cleanly and safely
@@ -2249,19 +2239,9 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
		goto fail_ipa_rm_init;
	}

	if (ipa_ctx->use_a2_service) {
		result = a2_mux_init();
		if (result) {
			IPAERR(":a2 service init failed (%d)\n", -result);
			result = -ENODEV;
			goto fail_a2_service_init;
		}
		IPADBG("A2 service initialized");
	}

	if (ipa_ctx->use_ipa_teth_bridge) {
		/* Initialize the tethering bridge driver */
		result = teth_bridge_driver_init(ipa_ctx->ipa_hw_type);
		result = teth_bridge_driver_init();
		if (result) {
			IPAERR(":teth_bridge init failed (%d)\n", -result);
			result = -ENODEV;
@@ -2277,8 +2257,6 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
	return 0;

fail_teth_bridge_init:
	a2_mux_exit();
fail_a2_service_init:
	ipa_rm_exit();
fail_ipa_rm_init:
	cdev_del(&ipa_ctx->cdev);
+2 −2
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ int ipa_send_cmd(u16 num_desc, struct ipa_desc *descr)

		descr->callback = ipa_sps_irq_cmd_ack;
		descr->user1 = descr;
		if (ipa_send_one(sys, descr, false)) {
		if (ipa_send_one(sys, descr, true)) {
			IPAERR("fail to send immediate command\n");
			result = -EFAULT;
			goto bail;
@@ -602,7 +602,7 @@ int ipa_send_cmd(u16 num_desc, struct ipa_desc *descr)

		desc->callback = ipa_sps_irq_cmd_ack;
		desc->user1 = desc;
		if (ipa_send(sys, num_desc, descr, false)) {
		if (ipa_send(sys, num_desc, descr, true)) {
			IPAERR("fail to send multiple immediate command set\n");
			result = -EFAULT;
			goto bail;
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ static int ipa_generate_flt_hw_rule(enum ipa_ip_type ip,
	if (entry->hw_len == 0) {
		entry->hw_len = buf - start;
	} else if (entry->hw_len != (buf - start)) {
		IPAERR("hw_len differs b/w passes passed=%x calc=%x\n",
		IPAERR("hw_len differs b/w passes passed=%x calc=%td\n",
		       entry->hw_len, (buf - start));
		return -EPERM;
	}
Loading