summaryrefslogtreecommitdiff
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorSibi Sankar <sibis@codeaurora.org>2020-04-21 17:32:25 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2020-05-11 22:20:17 +0300
commit6663ce6facf93727a3a08c5a6408405cd6094c48 (patch)
tree98acf2ce22cb436cbdd79c5fc95bf4a35f021600 /drivers/remoteproc
parentd964b0b1a863cceaa694a2db485b1347e49a8082 (diff)
downloadlinux-6663ce6facf93727a3a08c5a6408405cd6094c48.tar.xz
remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region
In the absence of mba and mpss sub-child extract the mba/mpss regions from the memory-region property. Tested-by: Evan Green <evgreen@chromium.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200421143228.8981-5-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/qcom_q6v5_mss.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 38d2b21735da..3a7fcd6485eb 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1568,8 +1568,17 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
struct resource r;
int ret;
+ /*
+ * In the absence of mba/mpss sub-child, extract the mba and mpss
+ * reserved memory regions from device's memory-region property.
+ */
child = of_get_child_by_name(qproc->dev->of_node, "mba");
- node = of_parse_phandle(child, "memory-region", 0);
+ if (!child)
+ node = of_parse_phandle(qproc->dev->of_node,
+ "memory-region", 0);
+ else
+ node = of_parse_phandle(child, "memory-region", 0);
+
ret = of_address_to_resource(node, 0, &r);
if (ret) {
dev_err(qproc->dev, "unable to resolve mba region\n");
@@ -1586,8 +1595,14 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
return -EBUSY;
}
- child = of_get_child_by_name(qproc->dev->of_node, "mpss");
- node = of_parse_phandle(child, "memory-region", 0);
+ if (!child) {
+ node = of_parse_phandle(qproc->dev->of_node,
+ "memory-region", 1);
+ } else {
+ child = of_get_child_by_name(qproc->dev->of_node, "mpss");
+ node = of_parse_phandle(child, "memory-region", 0);
+ }
+
ret = of_address_to_resource(node, 0, &r);
if (ret) {
dev_err(qproc->dev, "unable to resolve mpss region\n");