From c8cfec0a1b959f6a0d868f66157879727907a3a9 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Wed, 11 Mar 2015 15:48:50 +0000 Subject: Add TFTF framework and platform support for extended State-id This patch adds the necessary platform and framework support for extended state-id power state format. Also the existing suspend tests have been reworked to use the new framework. The framework detects the correct power state format during cold boot and implements helper functions to create the power state function in the detected format. Change-Id: Ie729d947a0f2693aa7e943544a2c4c006e526c63 --- framework/include/tftf.h | 9 +++++++++ framework/main.c | 3 +++ 2 files changed, 12 insertions(+) (limited to 'framework') diff --git a/framework/include/tftf.h b/framework/include/tftf.h index 44c6c02..3e0c1e9 100644 --- a/framework/include/tftf.h +++ b/framework/include/tftf.h @@ -155,6 +155,15 @@ uint8_t tftf_get_cpu_id_from_gic_id(uint8_t gic_id); int tftf_systimer_setup(void); +/* + * This function detects the power state format used by PSCI which can + * be either extended or original format. For the Original format, + * the State-ID can either be NULL or can be using the recommended encoding. + * This function needs to be invoked once during cold boot prior to the + * invocation of any PSCI power state helper functions. + */ +void tftf_detect_psci_pstate_format(void); + /* * Run the next test on the calling CPU. * Once the test is complete, if the calling CPU is the last one to exit the diff --git a/framework/main.c b/framework/main.c index ce64b82..a592aa9 100644 --- a/framework/main.c +++ b/framework/main.c @@ -527,6 +527,9 @@ void __dead2 tftf_cold_boot_main(void) /* Mark the primary CPU as online */ tftf_set_cpu_online(); + /* Detect the PSCI power state format used. */ + tftf_detect_psci_pstate_format(); + /* * TODO: Make the lead CPU configurable from the tests description. * Each test should be able to specify its lead CPU in the tests.xml -- cgit v1.2.3