ci: test with pabandon
Gelas and Travis support powerdown abandon which is not modelled by the
FVP. TC includes these cores and on a real system should be able to deal
with pabandon. So add a fake pabandon to the main TC4 config so we can
test it.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I4b9b306f49b3b1c90593b424057816e9ea9cc0d0
diff --git a/patch/pabandon/pabandon_on_half_powerdowns.patch b/patch/pabandon/pabandon_on_half_powerdowns.patch
new file mode 100644
index 0000000..e0ced79
--- /dev/null
+++ b/patch/pabandon/pabandon_on_half_powerdowns.patch
@@ -0,0 +1,40 @@
+diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
+index 25e30d489..8ff7fee51 100644
+--- a/lib/psci/psci_common.c
++++ b/lib/psci/psci_common.c
+@@ -1284,6 +1284,10 @@ void __dead2 psci_pwrdown_cpu_end_terminal(void)
+ panic();
+ }
+
++#include <travis.h>
++#include <cortex_gelas.h>
++static bool should_abandon[PLATFORM_CORE_COUNT];
++
+ /*******************************************************************************
+ * Finish a non-terminal power down sequence, ending with a wfi. In case of
+ * wakeup will unwind any CPU specific actions and return.
+@@ -1294,11 +1298,23 @@ void psci_pwrdown_cpu_end_wakeup(unsigned int power_level)
+ /* ensure write buffer empty */
+ dsbsy();
+
++ long pos = plat_my_core_pos();
++ bool abandon = should_abandon[pos];
++ /* abandon every other time */
++ should_abandon[pos] = !should_abandon[pos];
++ long midr = EXTRACT_PARTNUM(read_midr());
++
+ /*
+ * Turn the core off. Usually, will be terminal. In some circumstances
+ * the powerdown will be denied and we'll need to unwind.
+ */
+- wfi();
++ /* only abandon for cores that support it */
++ if (!(abandon &&
++ (midr == EXTRACT_PARTNUM(CORTEX_GELAS_MIDR)
++ || midr == EXTRACT_PARTNUM(TRAVIS_MIDR))))
++ {
++ wfi();
++ }
+
+ /*
+ * Waking up does not require hardware-assisted coherency, but that is