mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 01:51:34 +00:00
Qualcomm ARM Based Driver Updates for v4.17
* Fix NV upload increment in wcnss_ctrl * Add support in rmtfs-mem driver for assigning memory -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJasG1yAAoJEFKiBbHx2RXVJ/cQANYtQ3wWIyj/VPxqHheYbVb4 WuJ8mlDzE/RsvrGgQnMd8gqdFPbXj93mUJfues8AaMTlKlA1r2Z5d5SZkk+BclYd kt8YuN/XuwrvIuTKwiXRDxVvjocURjC8a9CGtER46m/ZjBzl6uYaOZF4T7y9ZsMZ BzYMC1ySwaSVFKZWk7o4lg5eBr7CxJWIS5IRbRSCT2AkWzLozSE9e4I7iIrjZql7 M65mQMFMHGZ+b8gB5KH1JrK56XtjA6FIaVz/QUoRAJNz2oIkOPKcsZumGF1HD9IV 1m3DHBBLBoCq0LMg65jYL/C5Hyr7qlPNdA/uXXXD2lizmTEKdxpHzSruPlBfl4aT m/IF/Z1PWqjzwbZ9+M5idEvgWqYsfjyDgyiU62YLOOoK/nU+jVoM7g7U15kjazD5 OnMcbzBOhiXOcISo0lkDNjJoXC8MiqLwAIoVyTlREmUcd3UpWeY+KsTXEMa+QHAe 2zjaE/OV3oUWulEwIqE9SpU7omqxHvBNubbTX/Lyu8UjKSj77fPjMkcncOty3+QR vmJUJO3O0A27uGuYqS5khHJpEnv8oHGJlwA8MEZr127yxQQ0WTL+gEkY96nN2HsR L6RvlVsSRRJ4hi1Hz20vvEEvRxUBS3tWRe65I4JiFtUFHKv/WpFOynl30VIm7dMR hwQzrNIWDbdDKYAU+AaD =x+/y -----END PGP SIGNATURE----- Merge tag 'qcom-drivers-for-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/drivers Pull "Qualcomm ARM Based Driver Updates for v4.17" from Andy Gross: * Fix NV upload increment in wcnss_ctrl * Add support in rmtfs-mem driver for assigning memory * tag 'qcom-drivers-for-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/agross/linux: soc: qcom: wcnss_ctrl: Fix increment in NV upload soc: qcom: rmtfs-mem: Add support for assigning memory to remote
This commit is contained in:
commit
b701b41bb4
@ -47,6 +47,7 @@ config QCOM_QMI_HELPERS
|
||||
config QCOM_RMTFS_MEM
|
||||
tristate "Qualcomm Remote Filesystem memory driver"
|
||||
depends on ARCH_QCOM
|
||||
select QCOM_SCM
|
||||
help
|
||||
The Qualcomm remote filesystem memory driver is used for allocating
|
||||
and exposing regions of shared memory with remote processors for the
|
||||
|
@ -37,6 +37,8 @@ struct qcom_rmtfs_mem {
|
||||
phys_addr_t size;
|
||||
|
||||
unsigned int client_id;
|
||||
|
||||
unsigned int perms;
|
||||
};
|
||||
|
||||
static ssize_t qcom_rmtfs_mem_show(struct device *dev,
|
||||
@ -151,9 +153,11 @@ static void qcom_rmtfs_mem_release_device(struct device *dev)
|
||||
static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *node = pdev->dev.of_node;
|
||||
struct qcom_scm_vmperm perms[2];
|
||||
struct reserved_mem *rmem;
|
||||
struct qcom_rmtfs_mem *rmtfs_mem;
|
||||
u32 client_id;
|
||||
u32 vmid;
|
||||
int ret;
|
||||
|
||||
rmem = of_reserved_mem_lookup(node);
|
||||
@ -204,10 +208,31 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
|
||||
|
||||
rmtfs_mem->dev.release = qcom_rmtfs_mem_release_device;
|
||||
|
||||
ret = of_property_read_u32(node, "qcom,vmid", &vmid);
|
||||
if (ret < 0 && ret != -EINVAL) {
|
||||
dev_err(&pdev->dev, "failed to parse qcom,vmid\n");
|
||||
goto remove_cdev;
|
||||
} else if (!ret) {
|
||||
perms[0].vmid = QCOM_SCM_VMID_HLOS;
|
||||
perms[0].perm = QCOM_SCM_PERM_RW;
|
||||
perms[1].vmid = vmid;
|
||||
perms[1].perm = QCOM_SCM_PERM_RW;
|
||||
|
||||
rmtfs_mem->perms = BIT(QCOM_SCM_VMID_HLOS);
|
||||
ret = qcom_scm_assign_mem(rmtfs_mem->addr, rmtfs_mem->size,
|
||||
&rmtfs_mem->perms, perms, 2);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "assign memory failed\n");
|
||||
goto remove_cdev;
|
||||
}
|
||||
}
|
||||
|
||||
dev_set_drvdata(&pdev->dev, rmtfs_mem);
|
||||
|
||||
return 0;
|
||||
|
||||
remove_cdev:
|
||||
cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
|
||||
put_device:
|
||||
put_device(&rmtfs_mem->dev);
|
||||
|
||||
@ -217,6 +242,15 @@ put_device:
|
||||
static int qcom_rmtfs_mem_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_rmtfs_mem *rmtfs_mem = dev_get_drvdata(&pdev->dev);
|
||||
struct qcom_scm_vmperm perm;
|
||||
|
||||
if (rmtfs_mem->perms) {
|
||||
perm.vmid = QCOM_SCM_VMID_HLOS;
|
||||
perm.perm = QCOM_SCM_PERM_RW;
|
||||
|
||||
qcom_scm_assign_mem(rmtfs_mem->addr, rmtfs_mem->size,
|
||||
&rmtfs_mem->perms, &perm, 1);
|
||||
}
|
||||
|
||||
cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
|
||||
put_device(&rmtfs_mem->dev);
|
||||
|
@ -249,7 +249,7 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc)
|
||||
/* Increment for next fragment */
|
||||
req->seq++;
|
||||
|
||||
data += req->hdr.len;
|
||||
data += NV_FRAGMENT_SIZE;
|
||||
left -= NV_FRAGMENT_SIZE;
|
||||
} while (left > 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user