summaryrefslogtreecommitdiff
path: root/lib/power_management/suspend/tftf_suspend.c
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2015-11-02 10:56:26 +0000
committerSoby Mathew <soby.mathew@arm.com>2016-02-04 16:59:18 +0000
commitb122cb138c83402a1a5f1b9b04c41bf48ff7cae9 (patch)
tree1b268ab206a73d8f1644e0e374059944deac7982 /lib/power_management/suspend/tftf_suspend.c
parent6c89ade9b2251c81a06759ca3189c8c9e70d0588 (diff)
Introduce the ARM GIC layer and refactor GICv2 driver
The TFTF assumed that the GIC driver architecture is v2.0 and made inherent assumptions about the same in the framework. In order to add support for GICv3 systems, this assumption needs to be removed and a new ARM GIC layer is introduced which abstracts the GIC Architecture details. The `arm_gic.c` and `arm_gic.h` contain the prototypes and definitions for this new layer. Also the GICv2 driver is refactored such that all the functionality is contained within the driver and the driver is accessed through well defined API. This essentially means that the GICv2 specific functionality present earlier in the interrupt framework and SGI framework is now removed. Also certain functionality of GICv2 like clearing the interrupt target register (GICD_ITARGETSR) to leave an interrupt untargeted cannot be supported generically in GICv3 and hence it is removed. The timer framework, which made use of this feature, is modified to not use it anymore. All the framework and testcases are modified to use the ARM GIC layer rather than the GICv2 driver directly. The functionality common across GICv3 and GICv2 drivers are defined in gic_common.c. Change-Id: Idf50fa14be42cb4dfb507087e340b0404e681e98
Diffstat (limited to 'lib/power_management/suspend/tftf_suspend.c')
-rw-r--r--lib/power_management/suspend/tftf_suspend.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/power_management/suspend/tftf_suspend.c b/lib/power_management/suspend/tftf_suspend.c
index ae607f8..1c1a216 100644
--- a/lib/power_management/suspend/tftf_suspend.c
+++ b/lib/power_management/suspend/tftf_suspend.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2014, ARM Limited. All rights reserved.
+* Copyright (c) 2014-2016, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -86,7 +86,7 @@ void tftf_restore_system_ctx(tftf_suspend_ctx_t *ctx)
INFO("Restoring system context\n");
- arm_gic_setup();
+ arm_gic_setup_global();
tftf_sgi_state_restore();
tftf_timer_gic_state_restore();
}
@@ -111,13 +111,11 @@ int tftf_suspend(const suspend_info_t *info)
rc = __tftf_suspend(info);
- if (!info->save_system_context) {
- /*
- * HACK: ARM TF is disabling Group 1 interrupts while
- * entering suspend but does not restore it
- */
- arm_gic_cpuif_setup();
- }
+ /*
+ * HACK: ARM TF is disabling Group 1 interrupts while
+ * entering suspend but does not restore it
+ */
+ arm_gic_setup_local();
/*
* DAIF flags should be restored last because it could be an issue