summaryrefslogtreecommitdiff
path: root/lib/cpus/aarch64/cortex_a75_pubsub.c
blob: 87beca273369447b0c9182bfba63cb623d7dc187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <cortex_a75.h>
#include <cpuamu.h>
#include <pubsub_events.h>

static void *cortex_a75_context_save(const void *arg)
{
	if (midr_match(CORTEX_A75_MIDR))
		cpuamu_context_save(CORTEX_A75_AMU_NR_COUNTERS);
	return 0;
}

static void *cortex_a75_context_restore(const void *arg)
{
	if (midr_match(CORTEX_A75_MIDR))
		cpuamu_context_restore(CORTEX_A75_AMU_NR_COUNTERS);
	return 0;
}

SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_a75_context_save);
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_finish, cortex_a75_context_restore);