public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Etienne Carriere <etienne.carriere@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, maz@kernel.org,
	steven.price@arm.com, alexios.zavras@intel.com,
	tglx@linutronix.de, etienne.carriere@linaro.org, will@kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit
Date: Thu, 14 May 2020 10:21:09 +0200	[thread overview]
Message-ID: <20200514082109.27573-2-etienne.carriere@linaro.org> (raw)
In-Reply-To: <20200514082109.27573-1-etienne.carriere@linaro.org>

Update PSCI driver to support SMCCC v1.2 reported by secure firmware
and indirectly make SMCCC conduit properly set when so. TF-A release
v2.3 implements and reports SMCCC v1.2 since commit [1].

Link: [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e34cc0cedca6e229847c232fe58d37fad2610ce9
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
 drivers/firmware/psci/psci.c | 14 ++++++++++----
 include/linux/psci.h         |  1 +
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index 2937d44b5df4..80cf73bea4b0 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -409,11 +409,17 @@ static void __init psci_init_smccc(void)
 	feature = psci_features(ARM_SMCCC_VERSION_FUNC_ID);
 
 	if (feature != PSCI_RET_NOT_SUPPORTED) {
-		u32 ret;
-		ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
-		if (ret == ARM_SMCCC_VERSION_1_1) {
+		ver = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
+
+		switch (ver) {
+		case ARM_SMCCC_VERSION_1_1:
 			psci_ops.smccc_version = SMCCC_VERSION_1_1;
-			ver = ret;
+			break;
+		case ARM_SMCCC_VERSION_1_2:
+			psci_ops.smccc_version = SMCCC_VERSION_1_2;
+			break;
+		default:
+			break;
 		}
 	}
 
diff --git a/include/linux/psci.h b/include/linux/psci.h
index a67712b73b6c..c7d99b7f34ed 100644
--- a/include/linux/psci.h
+++ b/include/linux/psci.h
@@ -24,6 +24,7 @@ bool psci_has_osi_support(void);
 enum smccc_version {
 	SMCCC_VERSION_1_0,
 	SMCCC_VERSION_1_1,
+	SMCCC_VERSION_1_2,
 };
 
 struct psci_operations {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-05-14  8:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14  8:21 [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Etienne Carriere
2020-05-14  8:21 ` Etienne Carriere [this message]
2020-05-14 14:24   ` [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit Sudeep Holla
2020-05-14 14:56     ` Etienne Carriere
2020-05-15  9:24       ` Sudeep Holla
2020-05-14 12:38 ` [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Steven Price
2020-05-14 12:52   ` Etienne Carriere

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=20200514082109.27573-2-etienne.carriere@linaro.org \
    --to=etienne.carriere@linaro.org \
    --cc=alexios.zavras@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=steven.price@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will@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