summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/qcom
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-05-27 14:55:02 +0200
committerBjorn Andersson <andersson@kernel.org>2024-06-23 23:08:21 +0200
commita33b2579c8d303b353a1f7c743b096f150da70fa (patch)
treed5d309bca5a7b80253e7fcb2b6b2e6b907d4ba1f /drivers/firmware/qcom
parentfirmware: qcom: tzmem: enable SHM Bridge support (diff)
downloadlinux-a33b2579c8d303b353a1f7c743b096f150da70fa.tar.xz
linux-a33b2579c8d303b353a1f7c743b096f150da70fa.zip
firmware: qcom: scm: add support for SHM bridge memory carveout
Parse the "memory-region" property and - if present - use it to assign the dedicated reserved memory to the underlying DMA callbacks which will then allocate memory for the SCM calls from it. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Elliot Berman <quic_eberman@quicinc.com> Link: https://lore.kernel.org/r/20240527-shm-bridge-v10-12-ce7afaa58d3a@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers/firmware/qcom')
-rw-r--r--drivers/firmware/qcom/qcom_scm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 19950ec801c2..df748fa8af4d 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -23,6 +23,7 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/sizes.h>
@@ -1956,6 +1957,11 @@ static int qcom_scm_probe(struct platform_device *pdev)
if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled"))
qcom_scm_disable_sdi();
+ ret = of_reserved_mem_device_init(__scm->dev);
+ if (ret && ret != -ENODEV)
+ return dev_err_probe(__scm->dev, ret,
+ "Failed to setup the reserved memory region for TZ mem\n");
+
ret = qcom_tzmem_enable(__scm->dev);
if (ret)
return dev_err_probe(__scm->dev, ret,