From: Meng Li <[email protected]>

commit 0eee61da3433d22534098984ebdc5b41aebbac4d from
git://git.yoctoproject.org/linux-yocto 
v5.10/standard/intel-sdk-5.10/intel-socfpga.

After upgrading u-boot to v2021.07, it creates the fit bootloader image
that includes atf and u-boot by default. As known, the cpu hardware
off/on action is processed in atf code, but for intel socfpga platform,
system resets when do cpu0 up. So, create this workaround in kernel
code to avoid operating cpu0 off/on interface online file firstly, and
then try to fix the root cause in atf code in later.

Signed-off-by: Meng Li <[email protected]>
Signed-off-by: Liwei Song <[email protected]>
---
 arch/arm64/kernel/psci.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c
index ab7f4c476104..c5c7d3452aac 100644
--- a/arch/arm64/kernel/psci.c
+++ b/arch/arm64/kernel/psci.c
@@ -49,7 +49,14 @@ static int cpu_psci_cpu_boot(unsigned int cpu)
 #ifdef CONFIG_HOTPLUG_CPU
 static bool cpu_psci_cpu_can_disable(unsigned int cpu)
 {
-       return !psci_tos_resident_on(cpu);
+       /* This is a work around for Intel socfpga platforms that don't support
+        * for shutting down cpu0. So add the limitation to disable offline 
cpu0.
+        */
+       if ((of_machine_is_compatible("altr,socfpga-stratix10") ||
+                       of_machine_is_compatible("intel,socfpga-agilex")) && 
cpu == 0)
+               return false;
+       else
+               return !psci_tos_resident_on(cpu);
 }
 
 static int cpu_psci_cpu_disable(unsigned int cpu)
-- 
2.36.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11507): 
https://lists.yoctoproject.org/g/linux-yocto/message/11507
Mute This Topic: https://lists.yoctoproject.org/mt/92522889/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to