From: Mukesh Ojha <quic_mojha@quicinc.com>
To: <agross@kernel.org>, <andersson@kernel.org>,
<konrad.dybcio@linaro.org>, <linus.walleij@linaro.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"Mukesh Ojha" <quic_mojha@quicinc.com>
Subject: [PATCH v10 3/4] firmware: qcom: scm: Rework dload mode availability check
Date: Thu, 2 Nov 2023 22:44:06 +0530 [thread overview]
Message-ID: <1698945247-16033-4-git-send-email-quic_mojha@quicinc.com> (raw)
In-Reply-To: <1698945247-16033-1-git-send-email-quic_mojha@quicinc.com>
QCOM_SCM_BOOT_SET_DLOAD_MODE was only valid for very older
target and firmware and for recent targets there is dload
mode tcsr registers is available to set the download mode.
So, it is better to keep it as fallback check instead of
checking its availability and failing it always.
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
drivers/firmware/qcom/qcom_scm.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 4421f219fe9a..87bcd5c02f2b 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -532,18 +532,16 @@ static int __qcom_scm_set_dload_mode(struct device *dev, bool enable)
static void qcom_scm_set_download_mode(bool enable)
{
u32 val = enable ? QCOM_DLOAD_FULLDUMP : QCOM_DLOAD_NODUMP;
- bool avail;
int ret = 0;
- avail = __qcom_scm_is_call_available(__scm->dev,
- QCOM_SCM_SVC_BOOT,
- QCOM_SCM_BOOT_SET_DLOAD_MODE);
- if (avail) {
- ret = __qcom_scm_set_dload_mode(__scm->dev, enable);
- } else if (__scm->dload_mode_addr) {
+ if (__scm->dload_mode_addr) {
ret = qcom_scm_io_rmw(__scm->dload_mode_addr,
QCOM_DLOAD_MASK,
FIELD_PREP(QCOM_DLOAD_MASK, val));
+ } else if (__qcom_scm_is_call_available(__scm->dev,
+ QCOM_SCM_SVC_BOOT,
+ QCOM_SCM_BOOT_SET_DLOAD_MODE)) {
+ ret = __qcom_scm_set_dload_mode(__scm->dev, enable);
} else {
dev_err(__scm->dev,
"No available mechanism for setting download mode\n");
--
2.7.4
next prev parent reply other threads:[~2023-11-02 17:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 17:14 [PATCH v10 0/4] Misc SCM driver changes Mukesh Ojha
2023-11-02 17:14 ` [PATCH v10 1/4] firmware: qcom: scm: provide a read-modify-write function Mukesh Ojha
2023-11-02 17:14 ` [PATCH v10 2/4] firmware: qcom: scm: Modify only the download bits in TCSR register Mukesh Ojha
2023-11-02 17:14 ` Mukesh Ojha [this message]
2023-11-02 17:14 ` [PATCH v10 4/4] pinctrl: qcom: Use qcom_scm_io_rmw() function Mukesh Ojha
2023-11-27 19:50 ` [PATCH v10 0/4] Misc SCM driver changes Mukesh Ojha
2023-12-15 14:44 ` Mukesh Ojha
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=1698945247-16033-4-git-send-email-quic_mojha@quicinc.com \
--to=quic_mojha@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®