linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sibi Sankar <sibis@codeaurora.org>
To: bjorn.andersson@linaro.org, robh+dt@kernel.org
Cc: agross@kernel.org, linux-arm-msm@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	evgreen@chromium.org, ohad@wizery.com, mka@chromium.org,
	dianders@chromium.org, devicetree@vger.kernel.org,
	Sibi Sankar <sibis@codeaurora.org>
Subject: [PATCH v2 4/7] remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region
Date: Tue, 21 Apr 2020 20:02:25 +0530	[thread overview]
Message-ID: <20200421143228.8981-5-sibis@codeaurora.org> (raw)
In-Reply-To: <20200421143228.8981-1-sibis@codeaurora.org>

In the absence of mba and mpss sub-child extract the mba/mpss regions
from the memory-region property.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 3a7352776a319..5c8d04c51af71 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1503,8 +1503,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");
@@ -1521,8 +1530,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");
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2020-04-21 14:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 14:32 [PATCH v2 0/7] Add PAS and MSA based Modem support Sibi Sankar
2020-04-21 14:32 ` [PATCH v2 1/7] dt-bindings: remoteproc: qcom: Add SC7180 MPSS support Sibi Sankar
2020-04-21 14:32   ` Sibi Sankar
2020-05-11 19:00   ` Rob Herring
2020-04-21 14:32 ` [PATCH v2 2/7] remoteproc: qcom: pas: Add SC7180 Modem support Sibi Sankar
2020-04-21 14:32   ` Sibi Sankar
2020-04-21 14:32 ` [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Use memory-region to reference memory Sibi Sankar
2020-04-21 14:32   ` Sibi Sankar
2020-05-11 19:00   ` Rob Herring
2020-04-21 14:32 ` Sibi Sankar [this message]
2020-04-21 14:32   ` [PATCH v2 4/7] remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region Sibi Sankar
2020-04-21 14:32 ` [PATCH v2 5/7] arm64: dts: qcom: sc7180: Update reserved memory map Sibi Sankar
2020-04-21 14:32   ` Sibi Sankar
2020-04-21 14:32 ` [PATCH v2 6/7] arm64: dts: qcom: sc7180: Add Q6V5 MSS node Sibi Sankar
2020-04-21 14:32   ` Sibi Sankar
2020-05-11 19:29   ` Bjorn Andersson
2020-04-21 14:32 ` [PATCH v2 7/7] arm64: dts: qcom: sc7180: Update " Sibi Sankar
2020-04-21 14:32   ` Sibi Sankar
2020-05-11 19:29   ` Bjorn Andersson
2020-04-29 17:25 ` [PATCH v2 0/7] Add PAS and MSA based Modem support Evan Green

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200421143228.8981-5-sibis@codeaurora.org \
    --to=sibis@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=ohad@wizery.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).