summaryrefslogtreecommitdiff
path: root/lib/power_management/suspend/tftf_suspend.c
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2015-11-06 10:09:16 +0000
committerSoby Mathew <soby.mathew@arm.com>2016-02-04 16:59:19 +0000
commitaf059017bbba5cf5626c9dbfe8391e086158ca8e (patch)
tree228b37c6b95f1d9ac49bedd136dd1dc5a7934c2f /lib/power_management/suspend/tftf_suspend.c
parentb122cb138c83402a1a5f1b9b04c41bf48ff7cae9 (diff)
Introduce GIC context save and restore functionality
This patch defines a set of APIs that help to save and restore the GIC state during suspend use cases. Earlier, the GIC was reinitialized by suspend framework and then the appropriate SGI state was restored by the SGI framework. Now the save and restore infrastructure is within the GIC driver and the framework invokes the appropriate save/restore functions of the ARM GIC layer. Change-Id: I7086316b50db09665886d2b31d1bec641568b6b5
Diffstat (limited to 'lib/power_management/suspend/tftf_suspend.c')
-rw-r--r--lib/power_management/suspend/tftf_suspend.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/power_management/suspend/tftf_suspend.c b/lib/power_management/suspend/tftf_suspend.c
index 1c1a216..69eff9f 100644
--- a/lib/power_management/suspend/tftf_suspend.c
+++ b/lib/power_management/suspend/tftf_suspend.c
@@ -86,8 +86,8 @@ void tftf_restore_system_ctx(tftf_suspend_ctx_t *ctx)
INFO("Restoring system context\n");
- arm_gic_setup_global();
- tftf_sgi_state_restore();
+ /* restore the global GIC context */
+ arm_gic_restore_context_global();
tftf_timer_gic_state_restore();
}
@@ -98,6 +98,9 @@ void tftf_save_system_ctx(tftf_suspend_ctx_t *ctx)
/* Nothing to do here currently */
INFO("Saving system context\n");
+
+ /* Save the global GIC context */
+ arm_gic_save_context_global();
}
int tftf_suspend(const suspend_info_t *info)
@@ -109,13 +112,13 @@ int tftf_suspend(const suspend_info_t *info)
INFO("Going into suspend state\n");
+ /* Save the local GIC context */
+ arm_gic_save_context_local();
+
rc = __tftf_suspend(info);
- /*
- * HACK: ARM TF is disabling Group 1 interrupts while
- * entering suspend but does not restore it
- */
- arm_gic_setup_local();
+ /* Restore the local GIC context */
+ arm_gic_restore_context_local();
/*
* DAIF flags should be restored last because it could be an issue