test(psci): add test to validate "psci_is_last_cpu_to_idle_at_pwrlvl"

* This patch adds a test that suspends to affinity level 2 with another
  CPU running in a different power domain.

* Previously with the bug identified and resolved in commit (01959a1),
  the function "psci_is_last_cpu_to_idle_at_pwrlvl" checked only one
  power domain when suspending to level2. This meant that if there was
  a cpu running outside the power domain of the calling CPU, the suspend
  request would be allowed. But in this case, the request should be
  denied. This test case validates this behaviour and ensures the
  request is denied.

* This patch also adds the following global variables to parameterise
  and reuse the existing functions for the new test.
   * test_should_suspend - an boolean array that allows you to leave
     some CPUs running.
   * test_should_deny - a boolean to specify if the suspend request
     should be denied.
   * cpu_finished - an array of events so that the running CPUs know
     when to terminate.

* Additionally this patch also adds a function to get a CPU that is
  in a different cluster to the lead CPU.

Refer to TF-A commit (01959a1) for more information on the bug.

Change-Id: Ib163aa8d5347baeaa47d1ae6f59599f1c68c11a8
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
4 files changed