All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch
@ 2024-03-04 10:47 bence.balogh
  2024-03-04 10:47 ` [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver bence.balogh
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: bence.balogh @ 2024-03-04 10:47 UTC (permalink / raw)
  To: meta-arm; +Cc: Bence Balogh

From: Bence Balogh <bence.balogh@arm.com>

Bence Balogh (2):
  arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the
    PSCI driver
  arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES
    discovery workaround

 ...stone1000-add-cpuhelper-to-makefile.patch} |  0
 ...URES-discovery-through-PSCI_FEATURES.patch | 29 ----------
 .../trusted-firmware-a-corstone1000.inc       |  3 +-
 ...i-Fix-bind_smccc_features-psci-check.patch | 56 +++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot_%.bbappend      |  4 ++
 5 files changed, 61 insertions(+), 31 deletions(-)
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/{0004-fix-corstone1000-add-cpuhelper-to-makefile.patch => 0003-fix-corstone1000-add-cpuhelper-to-makefile.patch} (100%)
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch

--
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver
  2024-03-04 10:47 [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch bence.balogh
@ 2024-03-04 10:47 ` bence.balogh
  2024-03-13 12:53   ` [meta-arm] " Ross Burton
  2024-03-04 10:47 ` [PATCH 2/2] arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES discovery workaround bence.balogh
  2024-03-18 18:25 ` [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch Jon Mason
  2 siblings, 1 reply; 5+ messages in thread
From: bence.balogh @ 2024-03-04 10:47 UTC (permalink / raw)
  To: meta-arm; +Cc: Bence Balogh

From: Bence Balogh <bence.balogh@arm.com>

The u-boot PSCI driver was not compliant with the PSCI specifications so
this patch had to be added.

Signed-off-by: Bence Balogh <bence.balogh@arm.com>
---
 ...i-Fix-bind_smccc_features-psci-check.patch | 56 +++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot_%.bbappend      |  4 ++
 2 files changed, 60 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch
new file mode 100644
index 00000000..c4b1b1ec
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch
@@ -0,0 +1,56 @@
+Subject: [PATCH v3 1/3] firmware: psci: Fix bind_smccc_features psci check
+Date: Wed, 31 Jan 2024 14:14:24 +0000	[thread overview]
+Message-ID: <20240131141426.34926-2-o451686892@gmail.com> (raw)
+In-Reply-To: <20240131141426.34926-1-o451686892@gmail.com>
+
+According to PSCI specification DEN0022F, PSCI_FEATURES is used to check
+whether the SMCCC is implemented by discovering SMCCC_VERSION.
+
+Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
+Upstream-Status: Submitted [https://lore.kernel.org/all/20240131141426.34926-2-o451686892@gmail.com/]
+---
+ drivers/firmware/psci.c   | 5 ++++-
+ include/linux/arm-smccc.h | 6 ++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
+index c6b9efab41..03544d76ed 100644
+--- a/drivers/firmware/psci.c
++++ b/drivers/firmware/psci.c
+@@ -135,10 +135,13 @@ static int bind_smccc_features(struct udevice *dev, int psci_method)
+ 	    PSCI_VERSION_MAJOR(psci_0_2_get_version()) == 0)
+ 		return 0;
+ 
+-	if (request_psci_features(ARM_SMCCC_ARCH_FEATURES) ==
++	if (request_psci_features(ARM_SMCCC_VERSION) ==
+ 	    PSCI_RET_NOT_SUPPORTED)
+ 		return 0;
+ 
++	if (invoke_psci_fn(ARM_SMCCC_VERSION, 0, 0, 0) < ARM_SMCCC_VERSION_1_1)
++		return 0;
++
+ 	if (psci_method == PSCI_METHOD_HVC)
+ 		pdata->invoke_fn = smccc_invoke_hvc;
+ 	else
+diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
+index f44e9e8f93..da3d29aabe 100644
+--- a/include/linux/arm-smccc.h
++++ b/include/linux/arm-smccc.h
+@@ -55,8 +55,14 @@
+ #define ARM_SMCCC_QUIRK_NONE		0
+ #define ARM_SMCCC_QUIRK_QCOM_A6		1 /* Save/restore register a6 */
+ 
++#define ARM_SMCCC_VERSION		0x80000000
+ #define ARM_SMCCC_ARCH_FEATURES		0x80000001
+ 
++#define ARM_SMCCC_VERSION_1_0		0x10000
++#define ARM_SMCCC_VERSION_1_1		0x10001
++#define ARM_SMCCC_VERSION_1_2		0x10002
++#define ARM_SMCCC_VERSION_1_3		0x10003
++
+ #define ARM_SMCCC_RET_NOT_SUPPORTED	((unsigned long)-1)
+ 
+ #ifndef __ASSEMBLY__
+-- 
+2.39.2
+
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
index 11f332ad..77732859 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -6,5 +6,9 @@ MACHINE_U-BOOT_REQUIRE:fvp-base = "u-boot-fvp-base.inc"
 MACHINE_U-BOOT_REQUIRE:juno = "u-boot-juno.inc"
 MACHINE_U-BOOT_REQUIRE:tc = "u-boot-tc.inc"
 
+SRC_URI:append = " \
+    file://0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch \
+"
+
 require ${MACHINE_U-BOOT_REQUIRE}
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES discovery workaround
  2024-03-04 10:47 [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch bence.balogh
  2024-03-04 10:47 ` [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver bence.balogh
@ 2024-03-04 10:47 ` bence.balogh
  2024-03-18 18:25 ` [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch Jon Mason
  2 siblings, 0 replies; 5+ messages in thread
From: bence.balogh @ 2024-03-04 10:47 UTC (permalink / raw)
  To: meta-arm; +Cc: Bence Balogh

From: Bence Balogh <bence.balogh@arm.com>

The workaround is no longer needed because with the
0043-firmware-psci-Fix-bind_smccc_features-psci-check.patch file the
u-boot PSCI driver is compliant with the PSCI specifications.

Signed-off-by: Bence Balogh <bence.balogh@arm.com>
---
 ...stone1000-add-cpuhelper-to-makefile.patch} |  0
 ...URES-discovery-through-PSCI_FEATURES.patch | 29 -------------------
 .../trusted-firmware-a-corstone1000.inc       |  3 +-
 3 files changed, 1 insertion(+), 31 deletions(-)
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/{0004-fix-corstone1000-add-cpuhelper-to-makefile.patch => 0003-fix-corstone1000-add-cpuhelper-to-makefile.patch} (100%)
 delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch

diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0004-fix-corstone1000-add-cpuhelper-to-makefile.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-fix-corstone1000-add-cpuhelper-to-makefile.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0004-fix-corstone1000-add-cpuhelper-to-makefile.patch
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-fix-corstone1000-add-cpuhelper-to-makefile.patch
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch
deleted file mode 100644
index 2a7cd47e..00000000
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/corstone1000/0003-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 16937460429d6bcd502b21c20d16222541ed8d48 Mon Sep 17 00:00:00 2001
-From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
-Date: Mon, 6 Mar 2023 15:57:59 +0000
-Subject: [PATCH] psci: SMCCC_ARCH_FEATURES discovery through PSCI_FEATURES
-
-allow normal world use PSCI_FEATURES to discover SMCCC_ARCH_FEATURES
-
-Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
-Upstream-Status: Inappropriate [A U-Boot patch will be released to fix an issue in the PSCI driver]
----
- lib/psci/psci_main.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
-index a631f3ffbf..cc8904b006 100644
---- a/lib/psci/psci_main.c
-+++ b/lib/psci/psci_main.c
-@@ -337,7 +337,7 @@ int psci_features(unsigned int psci_fid)
- {
- 	unsigned int local_caps = psci_caps;
- 
--	if (psci_fid == SMCCC_VERSION)
-+	if (psci_fid == SMCCC_VERSION || psci_fid == SMCCC_ARCH_FEATURES)
- 		return PSCI_E_SUCCESS;
- 
- 	/* Check if it is a 64 bit function */
--- 
-2.25.1
-
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc
index 8673199d..db83e8e5 100644
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone1000.inc
@@ -6,8 +6,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files/corstone1000:"
 SRC_URI:append = " \
 	file://0001-Fix-FF-A-version-in-SPMC-manifest.patch \
 	file://0002-feat-corstone1000-bl2-loads-fip-based-on-metadata.patch \
-	file://0003-psci-SMCCC_ARCH_FEATURES-discovery-through-PSCI_FEATURES.patch \
-	file://0004-fix-corstone1000-add-cpuhelper-to-makefile.patch \
+	file://0003-fix-corstone1000-add-cpuhelper-to-makefile.patch \
        "
 
 TFA_DEBUG = "1"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [meta-arm] [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver
  2024-03-04 10:47 ` [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver bence.balogh
@ 2024-03-13 12:53   ` Ross Burton
  0 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2024-03-13 12:53 UTC (permalink / raw)
  To: Bence Balogh; +Cc: meta-arm

On 4 Mar 2024, at 10:47, bence.balogh via lists.yoctoproject.org <bence.balogh=arm.com@lists.yoctoproject.org> wrote:
> +SRC_URI:append = " \
> +    file://0001-firmware-psci-Fix-bind_smccc_features-psci-check.patch \
> +"

The commit message implies this is specific to the CS1K, but this patch is applied to _everyone_ building u-boot, even people who add meta-arm to their layer setup but don’t use the machines.

It feels like this should be moved to the CS1K specific override, unless its genuinely a useful fix for everyone in which case we should patch oe-core instead.

Ross


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch
  2024-03-04 10:47 [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch bence.balogh
  2024-03-04 10:47 ` [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver bence.balogh
  2024-03-04 10:47 ` [PATCH 2/2] arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES discovery workaround bence.balogh
@ 2024-03-18 18:25 ` Jon Mason
  2 siblings, 0 replies; 5+ messages in thread
From: Jon Mason @ 2024-03-18 18:25 UTC (permalink / raw)
  To: meta-arm, bence.balogh


On Mon, 04 Mar 2024 11:47:13 +0100, bence.balogh@arm.com wrote:
> From: Bence Balogh <bence.balogh@arm.com>
> 
> Bence Balogh (2):
>   arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the
>     PSCI driver
>   arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES
>     discovery workaround
> 
> [...]

Applied, thanks!

[1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver
      commit: fb1a85a43c663d9e44047fc5e93af5c02c711c98
[2/2] arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES discovery workaround
      commit: 0792a314f623b4143652563d6db9a840b2b8226f

Best regards,
-- 
Jon Mason <jon.mason@arm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-18 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-04 10:47 [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch bence.balogh
2024-03-04 10:47 ` [PATCH 1/2] arm-bsp/u-boot: corstone1000: fix SMCCC_ARCH_FEATURES detection in the PSCI driver bence.balogh
2024-03-13 12:53   ` [meta-arm] " Ross Burton
2024-03-04 10:47 ` [PATCH 2/2] arm-bsp/trusted-firmware-a: corstone1000: remove SMCCC_ARCH_FEATURES discovery workaround bence.balogh
2024-03-18 18:25 ` [PATCH 0/2] Add fix for the uboot PSCI driver and remove TF-A workaround patch Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.