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

Commit d8283ab4 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi Committed by Siddartha Mohanadoss
Browse files

msm: mhi_dev: Add ADPL HW channel support in MHI driver



Accelerated Data Path Logging channel is used to communicate
between host and modem using the IPA HW-accelerated path.

Change-Id: I649cbc136f404e44c78c6443d5586cbdeb0fd767
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent 711b668b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
#define MHI_RING_PRIMARY_EVT_ID		1
#define MHI_1K_SIZE			0x1000
/* Updated Specification for event start is NER - 2 and end - NER -1 */
#define MHI_HW_ACC_EVT_RING_START	2
#define MHI_HW_ACC_EVT_RING_START	3
#define MHI_HW_ACC_EVT_RING_END		1

#define MHI_HOST_REGION_NUM             2
@@ -843,7 +843,9 @@ static int mhi_hwc_chcmd(struct mhi_dev *mhi, uint chid,
	case MHI_DEV_RING_EL_START:
		connect_params.channel_id = chid;
		connect_params.sys.skip_ep_cfg = true;
		if ((chid % 2) == 0x0)
		if (chid == MHI_CLIENT_ADPL_IN)
			connect_params.sys.client = IPA_CLIENT_MHI_DPL_CONS;
		else if ((chid % 2) == 0x0)
			connect_params.sys.client = IPA_CLIENT_MHI_PROD;
		else
			connect_params.sys.client = IPA_CLIENT_MHI_CONS;
+23 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#define MAX_UCI_WR_REQ			10
#define MAX_NR_TRBS_PER_CHAN		9
#define MHI_QTI_IFACE_ID		4
#define MHI_ADPL_IFACE_ID		5
#define DEVICE_NAME			"mhi"
#define MAX_DEVICE_NAME_SIZE		80

@@ -1374,6 +1375,28 @@ static long mhi_uci_client_ioctl(struct file *file, unsigned int cmd,
		if (rc)
			return rc;
		rc = mhi_uci_ctrl_set_tiocm(uci_handle, tiocm);
	} else if (cmd == MHI_UCI_DPL_EP_LOOKUP) {
		uci_log(UCI_DBG_DBG, "DPL EP_LOOKUP for client:%d\n",
			uci_handle->client_index);
		epinfo.ph_ep_info.ep_type = DATA_EP_TYPE_PCIE;
		epinfo.ph_ep_info.peripheral_iface_id = MHI_ADPL_IFACE_ID;
		epinfo.ipa_ep_pair.prod_pipe_num =
			ipa_get_ep_mapping(IPA_CLIENT_MHI_DPL_CONS);
		/* For DPL set cons pipe to -1 to indicate it is unused */
		epinfo.ipa_ep_pair.cons_pipe_num = -1;

		uci_log(UCI_DBG_DBG, "client:%d ep_type:%d intf:%d\n",
			uci_handle->client_index,
			epinfo.ph_ep_info.ep_type,
			epinfo.ph_ep_info.peripheral_iface_id);

		uci_log(UCI_DBG_DBG, "DPL ipa_prod_idx:%d\n",
			epinfo.ipa_ep_pair.prod_pipe_num);

		rc = copy_to_user((void __user *)arg, &epinfo,
			sizeof(epinfo));
		if (rc)
			uci_log(UCI_DBG_ERROR, "copying to user space failed");
	} else {
		uci_log(UCI_DBG_ERROR, "wrong parameter:%d\n", cmd);
		rc = -EINVAL;
+1 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ enum mhi_client_channel {
	MHI_CLIENT_RESERVED_1_UPPER = 99,
	MHI_CLIENT_IP_HW_0_OUT = 100,
	MHI_CLIENT_IP_HW_0_IN = 101,
	MHI_CLIENT_ADPL_IN = 102,
	MHI_CLIENT_RESERVED_2_LOWER = 102,
	MHI_CLIENT_RESERVED_2_UPPER = 127,
	MHI_MAX_CHANNELS = 102,
+1 −0
Original line number Diff line number Diff line
@@ -32,5 +32,6 @@ struct ep_info {
#define MHI_UCI_IOCTL_MAGIC	'm'

#define MHI_UCI_EP_LOOKUP _IOR(MHI_UCI_IOCTL_MAGIC, 2, struct ep_info)
#define MHI_UCI_DPL_EP_LOOKUP _IOR(MHI_UCI_IOCTL_MAGIC, 3, struct ep_info)

#endif /* _UAPI_MHI_H */