From 7b161ee9c9a1bd89ddd4d7f085ce1d9721cca8fc Mon Sep 17 00:00:00 2001 From: Gokul krishna Krishnakumar Date: Wed, 9 Nov 2022 11:04:05 -0800 Subject: [PATCH] remoteproc: qcom_q6v5_pas: Map modem DSM memory ownership to MPSS Replace the hyp_assign_phys with upstream friendly qcom_scm_assign_mem. dsm memory region is needed by MPSS PDs, this call reassigns the ownership to MPSS. Change-Id: I1ae7e61d1bc74d45bb1bc58b762c5d3d59e12501 Signed-off-by: Gokul krishna Krishnakumar --- drivers/remoteproc/qcom_q6v5_pas.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 1304d7830094..5d9a9fa025d6 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -957,14 +957,16 @@ static int adsp_setup_32b_dma_allocs(struct qcom_adsp *adsp) static int setup_mpss_dsm_mem(struct platform_device *pdev) { + struct qcom_scm_vmperm newvm[1]; struct device_node *node; struct resource res; - int hlosvm[1] = {VMID_HLOS}; - int mssvm[1] = {VMID_MSS_MSA}; - int vmperm[1] = {PERM_READ | PERM_WRITE}; phys_addr_t mem_phys; + int curr_perm; u64 mem_size; int ret; + newvm[0].vmid = QCOM_SCM_VMID_MSS_MSA; + newvm[0].perm = QCOM_SCM_PERM_RW; + curr_perm = BIT(QCOM_SCM_VMID_HLOS); node = of_parse_phandle(pdev->dev.of_node, "mpss_dsm_mem_reg", 0); if (!node) { @@ -980,7 +982,7 @@ static int setup_mpss_dsm_mem(struct platform_device *pdev) mem_phys = res.start; mem_size = resource_size(&res); - ret = hyp_assign_phys(mem_phys, mem_size, hlosvm, 1, mssvm, vmperm, 1); + ret = qcom_scm_assign_mem(mem_phys, mem_size, &curr_perm, newvm, 1); if (ret) { dev_err(&pdev->dev, "hyp assign for mpss dsm mem failed\n"); return ret;