blob: e0ced79dbffaaa01a7ea380ef6464a987d253220 [file] [log] [blame]
Boyan Karatotev512aef92025-03-27 12:04:09 +00001diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
2index 25e30d489..8ff7fee51 100644
3--- a/lib/psci/psci_common.c
4+++ b/lib/psci/psci_common.c
5@@ -1284,6 +1284,10 @@ void __dead2 psci_pwrdown_cpu_end_terminal(void)
6 panic();
7 }
8
9+#include <travis.h>
10+#include <cortex_gelas.h>
11+static bool should_abandon[PLATFORM_CORE_COUNT];
12+
13 /*******************************************************************************
14 * Finish a non-terminal power down sequence, ending with a wfi. In case of
15 * wakeup will unwind any CPU specific actions and return.
16@@ -1294,11 +1298,23 @@ void psci_pwrdown_cpu_end_wakeup(unsigned int power_level)
17 /* ensure write buffer empty */
18 dsbsy();
19
20+ long pos = plat_my_core_pos();
21+ bool abandon = should_abandon[pos];
22+ /* abandon every other time */
23+ should_abandon[pos] = !should_abandon[pos];
24+ long midr = EXTRACT_PARTNUM(read_midr());
25+
26 /*
27 * Turn the core off. Usually, will be terminal. In some circumstances
28 * the powerdown will be denied and we'll need to unwind.
29 */
30- wfi();
31+ /* only abandon for cores that support it */
32+ if (!(abandon &&
33+ (midr == EXTRACT_PARTNUM(CORTEX_GELAS_MIDR)
34+ || midr == EXTRACT_PARTNUM(TRAVIS_MIDR))))
35+ {
36+ wfi();
37+ }
38
39 /*
40 * Waking up does not require hardware-assisted coherency, but that is