mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
FSICOM: IOVA per client kernel changes
- IOCTL datatype and call added for sending IOVA, offset and channel id data to FSI JIRA SS-3385 JIRA SS-4628 Bug 3855033 Change-Id: I1212913a7ede879108800a68eafbe8240211572b Signed-off-by: Rahul Bedarkar <rabedarkar@nvidia.com> Signed-off-by: Prashant Kumar Shaw <pshaw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2819743 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
6a69011d7c
commit
f6d27d0561
@@ -19,6 +19,8 @@
|
|||||||
/* Timeout in milliseconds */
|
/* Timeout in milliseconds */
|
||||||
#define TIMEOUT 1000
|
#define TIMEOUT 1000
|
||||||
|
|
||||||
|
#define IOVA_UNI_CODE 0xFE0D
|
||||||
|
|
||||||
/*Data type for mailbox client and channel details*/
|
/*Data type for mailbox client and channel details*/
|
||||||
struct fsi_hsp_sm {
|
struct fsi_hsp_sm {
|
||||||
struct mbox_client client;
|
struct mbox_client client;
|
||||||
@@ -118,15 +120,16 @@ static ssize_t device_file_ioctl(
|
|||||||
struct rw_data *user_input;
|
struct rw_data *user_input;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
uint32_t pdata[4] = {0};
|
uint32_t pdata[4] = {0};
|
||||||
|
struct iova_data ldata;
|
||||||
|
|
||||||
user_input = (struct rw_data *)arg;
|
|
||||||
if (copy_from_user(&input, (void __user *)arg,
|
|
||||||
sizeof(struct rw_data)))
|
|
||||||
return -EACCES;
|
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case NVMAP_SMMU_MAP:
|
case NVMAP_SMMU_MAP:
|
||||||
|
user_input = (struct rw_data *)arg;
|
||||||
|
if (copy_from_user(&input, (void __user *)arg,
|
||||||
|
sizeof(struct rw_data)))
|
||||||
|
return -EACCES;
|
||||||
dmabuf = dma_buf_get(input.handle);
|
dmabuf = dma_buf_get(input.handle);
|
||||||
|
|
||||||
if (IS_ERR_OR_NULL(dmabuf))
|
if (IS_ERR_OR_NULL(dmabuf))
|
||||||
@@ -159,6 +162,9 @@ static ssize_t device_file_ioctl(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TEGRA_HSP_WRITE:
|
case TEGRA_HSP_WRITE:
|
||||||
|
if (copy_from_user(&input, (void __user *)arg,
|
||||||
|
sizeof(struct rw_data)))
|
||||||
|
return -EACCES;
|
||||||
pdata[0] = input.handle;
|
pdata[0] = input.handle;
|
||||||
ret = mbox_send_message(fsi_hsp_v->tx.chan,
|
ret = mbox_send_message(fsi_hsp_v->tx.chan,
|
||||||
(void *)pdata);
|
(void *)pdata);
|
||||||
@@ -168,6 +174,18 @@ static ssize_t device_file_ioctl(
|
|||||||
task = get_current();
|
task = get_current();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TEGRA_IOVA_DATA:
|
||||||
|
if (copy_from_user(&ldata, (void __user *)arg,
|
||||||
|
sizeof(struct iova_data)))
|
||||||
|
return -EACCES;
|
||||||
|
pdata[0] = ldata.offset;
|
||||||
|
pdata[1] = ldata.iova;
|
||||||
|
pdata[2] = ldata.chid;
|
||||||
|
pdata[3] = IOVA_UNI_CODE;
|
||||||
|
ret = mbox_send_message(fsi_hsp_v->tx.chan,
|
||||||
|
(void *)pdata);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ struct rw_data {
|
|||||||
uint64_t iova;
|
uint64_t iova;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*Data type for sending the offset,IOVA and channel Id details to FSI */
|
||||||
|
struct iova_data {
|
||||||
|
uint32_t offset;
|
||||||
|
uint32_t iova;
|
||||||
|
uint32_t chid;
|
||||||
|
};
|
||||||
|
|
||||||
/* signal value */
|
/* signal value */
|
||||||
#define SIG_DRIVER_RESUME 43
|
#define SIG_DRIVER_RESUME 43
|
||||||
#define SIG_FSI_WRITE_EVENT 44
|
#define SIG_FSI_WRITE_EVENT 44
|
||||||
@@ -23,5 +30,6 @@ struct rw_data {
|
|||||||
#define NVMAP_SMMU_UNMAP _IOWR('q', 2, struct rw_data *)
|
#define NVMAP_SMMU_UNMAP _IOWR('q', 2, struct rw_data *)
|
||||||
#define TEGRA_HSP_WRITE _IOWR('q', 3, struct rw_data *)
|
#define TEGRA_HSP_WRITE _IOWR('q', 3, struct rw_data *)
|
||||||
#define TEGRA_SIGNAL_REG _IOWR('q', 4, struct rw_data *)
|
#define TEGRA_SIGNAL_REG _IOWR('q', 4, struct rw_data *)
|
||||||
|
#define TEGRA_IOVA_DATA _IOWR('q', 5, struct iova_data *)
|
||||||
|
|
||||||
#endif /* _UAPI_TEGRA_FSICOM_H_ */
|
#endif /* _UAPI_TEGRA_FSICOM_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user