Loading drivers/platform/msm/mhi_dev/mhi.c +20 −6 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ #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 3 #define MHI_HW_ACC_EVT_RING_END 1 #define MHI_HOST_REGION_NUM 2 Loading Loading @@ -306,7 +305,7 @@ static void mhi_dev_get_erdb_db_cfg(struct mhi_dev *mhi, break; default: erdb_cfg->base = mhi->cfg.event_rings - MHI_HW_ACC_EVT_RING_START; (mhi->cfg.hw_event_rings); erdb_cfg->end = mhi->cfg.event_rings - MHI_HW_ACC_EVT_RING_END; break; Loading Loading @@ -496,17 +495,32 @@ 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 == MHI_CLIENT_ADPL_IN) switch (chid) { case MHI_CLIENT_ADPL_IN: connect_params.sys.client = IPA_CLIENT_MHI_DPL_CONS; else if ((chid % 2) == 0x0) break; case MHI_CLIENT_IP_HW_0_OUT: connect_params.sys.client = IPA_CLIENT_MHI_PROD; else break; case MHI_CLIENT_IP_HW_0_IN: connect_params.sys.client = IPA_CLIENT_MHI_CONS; break; case MHI_CLIENT_IP_HW_1_OUT: connect_params.sys.client = IPA_CLIENT_MHI2_PROD; break; case MHI_CLIENT_IP_HW_1_IN: connect_params.sys.client = IPA_CLIENT_MHI2_CONS; break; default: pr_err("Invalid channel = 0x%X\n", chid); return -EINVAL; } rc = ipa_mhi_connect_pipe(&connect_params, &mhi->ipa_clnt_hndl[chid-HW_CHANNEL_BASE]); if (rc) pr_err("HW Channel%d start failed 0x%X\n", pr_err("HW Channel%d start failed : %d\n", chid, rc); break; case MHI_DEV_RING_EL_INVALID: Loading drivers/platform/msm/mhi_dev/mhi.h +1 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,7 @@ struct mhi_config { uint32_t mhi_reg_len; uint32_t version; uint32_t event_rings; uint32_t hw_event_rings; uint32_t channels; uint32_t chdb_offset; uint32_t erdb_offset; Loading drivers/platform/msm/mhi_dev/mhi_hwio.h +3 −3 Original line number Diff line number Diff line /* Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2015, 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -65,8 +65,8 @@ #define MHIVER_MHIVER_SHIFT 0x0 #define MHICFG (0x0110) #define MHICFG_RESERVED_BITS31_24_MASK 0xff000000 #define MHICFG_RESERVED_BITS31_24_SHIFT 0x18 #define MHICFG_NHWER_MASK 0xff000000 #define MHICFG_NHWER_SHIFT 0x18 #define MHICFG_NER_MASK 0xff0000 #define MHICFG_NER_SHIFT 0x10 #define MHICFG_RESERVED_BITS15_8_MASK 0xff00 Loading drivers/platform/msm/mhi_dev/mhi_mmio.c +6 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2015, 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -953,6 +953,11 @@ int mhi_dev_mmio_init(struct mhi_dev *dev) if (rc) return rc; rc = mhi_dev_mmio_masked_read(dev, MHICFG, MHICFG_NHWER_MASK, MHICFG_NHWER_SHIFT, &dev->cfg.hw_event_rings); if (rc) return rc; rc = mhi_dev_mmio_read(dev, CHDBOFF, &dev->cfg.chdb_offset); if (rc) return rc; Loading drivers/platform/msm/mhi_dev/mhi_uci.c +24 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #define MAX_NR_TRBS_PER_CHAN 9 #define MHI_QTI_IFACE_ID 4 #define MHI_ADPL_IFACE_ID 5 #define MHI_CV2X_IFACE_ID 6 #define DEVICE_NAME "mhi" #define MAX_DEVICE_NAME_SIZE 80 Loading Loading @@ -1576,6 +1577,29 @@ static long mhi_uci_client_ioctl(struct file *file, unsigned int cmd, 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 if (cmd == MHI_UCI_CV2X_EP_LOOKUP) { uci_log(UCI_DBG_DBG, "CV2X 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_CV2X_IFACE_ID; epinfo.ipa_ep_pair.cons_pipe_num = ipa_get_ep_mapping(IPA_CLIENT_MHI2_PROD); epinfo.ipa_ep_pair.prod_pipe_num = ipa_get_ep_mapping(IPA_CLIENT_MHI2_CONS); 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, "ipa_cons2_idx:%d ipa_prod2_idx:%d\n", epinfo.ipa_ep_pair.cons_pipe_num, epinfo.ipa_ep_pair.prod_pipe_num); rc = copy_to_user((void __user *)arg, &epinfo, sizeof(epinfo)); if (rc) Loading Loading
drivers/platform/msm/mhi_dev/mhi.c +20 −6 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ #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 3 #define MHI_HW_ACC_EVT_RING_END 1 #define MHI_HOST_REGION_NUM 2 Loading Loading @@ -306,7 +305,7 @@ static void mhi_dev_get_erdb_db_cfg(struct mhi_dev *mhi, break; default: erdb_cfg->base = mhi->cfg.event_rings - MHI_HW_ACC_EVT_RING_START; (mhi->cfg.hw_event_rings); erdb_cfg->end = mhi->cfg.event_rings - MHI_HW_ACC_EVT_RING_END; break; Loading Loading @@ -496,17 +495,32 @@ 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 == MHI_CLIENT_ADPL_IN) switch (chid) { case MHI_CLIENT_ADPL_IN: connect_params.sys.client = IPA_CLIENT_MHI_DPL_CONS; else if ((chid % 2) == 0x0) break; case MHI_CLIENT_IP_HW_0_OUT: connect_params.sys.client = IPA_CLIENT_MHI_PROD; else break; case MHI_CLIENT_IP_HW_0_IN: connect_params.sys.client = IPA_CLIENT_MHI_CONS; break; case MHI_CLIENT_IP_HW_1_OUT: connect_params.sys.client = IPA_CLIENT_MHI2_PROD; break; case MHI_CLIENT_IP_HW_1_IN: connect_params.sys.client = IPA_CLIENT_MHI2_CONS; break; default: pr_err("Invalid channel = 0x%X\n", chid); return -EINVAL; } rc = ipa_mhi_connect_pipe(&connect_params, &mhi->ipa_clnt_hndl[chid-HW_CHANNEL_BASE]); if (rc) pr_err("HW Channel%d start failed 0x%X\n", pr_err("HW Channel%d start failed : %d\n", chid, rc); break; case MHI_DEV_RING_EL_INVALID: Loading
drivers/platform/msm/mhi_dev/mhi.h +1 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,7 @@ struct mhi_config { uint32_t mhi_reg_len; uint32_t version; uint32_t event_rings; uint32_t hw_event_rings; uint32_t channels; uint32_t chdb_offset; uint32_t erdb_offset; Loading
drivers/platform/msm/mhi_dev/mhi_hwio.h +3 −3 Original line number Diff line number Diff line /* Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2015, 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -65,8 +65,8 @@ #define MHIVER_MHIVER_SHIFT 0x0 #define MHICFG (0x0110) #define MHICFG_RESERVED_BITS31_24_MASK 0xff000000 #define MHICFG_RESERVED_BITS31_24_SHIFT 0x18 #define MHICFG_NHWER_MASK 0xff000000 #define MHICFG_NHWER_SHIFT 0x18 #define MHICFG_NER_MASK 0xff0000 #define MHICFG_NER_SHIFT 0x10 #define MHICFG_RESERVED_BITS15_8_MASK 0xff00 Loading
drivers/platform/msm/mhi_dev/mhi_mmio.c +6 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2015, 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -953,6 +953,11 @@ int mhi_dev_mmio_init(struct mhi_dev *dev) if (rc) return rc; rc = mhi_dev_mmio_masked_read(dev, MHICFG, MHICFG_NHWER_MASK, MHICFG_NHWER_SHIFT, &dev->cfg.hw_event_rings); if (rc) return rc; rc = mhi_dev_mmio_read(dev, CHDBOFF, &dev->cfg.chdb_offset); if (rc) return rc; Loading
drivers/platform/msm/mhi_dev/mhi_uci.c +24 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #define MAX_NR_TRBS_PER_CHAN 9 #define MHI_QTI_IFACE_ID 4 #define MHI_ADPL_IFACE_ID 5 #define MHI_CV2X_IFACE_ID 6 #define DEVICE_NAME "mhi" #define MAX_DEVICE_NAME_SIZE 80 Loading Loading @@ -1576,6 +1577,29 @@ static long mhi_uci_client_ioctl(struct file *file, unsigned int cmd, 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 if (cmd == MHI_UCI_CV2X_EP_LOOKUP) { uci_log(UCI_DBG_DBG, "CV2X 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_CV2X_IFACE_ID; epinfo.ipa_ep_pair.cons_pipe_num = ipa_get_ep_mapping(IPA_CLIENT_MHI2_PROD); epinfo.ipa_ep_pair.prod_pipe_num = ipa_get_ep_mapping(IPA_CLIENT_MHI2_CONS); 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, "ipa_cons2_idx:%d ipa_prod2_idx:%d\n", epinfo.ipa_ep_pair.cons_pipe_num, epinfo.ipa_ep_pair.prod_pipe_num); rc = copy_to_user((void __user *)arg, &epinfo, sizeof(epinfo)); if (rc) Loading