2017-12-11 11:45:35 +00:00
|
|
|
/*
|
2018-02-14 10:28:36 +00:00
|
|
|
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
|
2017-12-11 11:45:35 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cortex_a75.h>
|
2018-02-14 10:28:36 +00:00
|
|
|
#include <cpuamu.h>
|
2017-12-21 15:21:20 +00:00
|
|
|
#include <pubsub_events.h>
|
2017-12-11 11:45:35 +00:00
|
|
|
|
|
|
|
static void *cortex_a75_context_save(const void *arg)
|
|
|
|
{
|
2018-02-14 10:28:36 +00:00
|
|
|
if (midr_match(CORTEX_A75_MIDR))
|
|
|
|
cpuamu_context_save(CORTEX_A75_AMU_NR_COUNTERS);
|
2017-12-11 11:45:35 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *cortex_a75_context_restore(const void *arg)
|
|
|
|
{
|
2018-02-14 10:28:36 +00:00
|
|
|
if (midr_match(CORTEX_A75_MIDR))
|
|
|
|
cpuamu_context_restore(CORTEX_A75_AMU_NR_COUNTERS);
|
2017-12-11 11:45:35 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_a75_context_save);
|
|
|
|
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_finish, cortex_a75_context_restore);
|