neoverse_n1_pubsub.c 717 Bytes
Newer Older
1
2
3
4
5
6
7
8
/*
 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <cortex_ares.h>
#include <cpuamu.h>
9
#include <lib/el3_runtime/pubsub_events.h>
10
11
12
13
14

static void *cortex_ares_context_save(const void *arg)
{
	if (midr_match(CORTEX_ARES_MIDR) != 0)
		cpuamu_context_save(CORTEX_ARES_AMU_NR_COUNTERS);
15
16

	return (void *)0;
17
18
19
20
21
22
}

static void *cortex_ares_context_restore(const void *arg)
{
	if (midr_match(CORTEX_ARES_MIDR) != 0)
		cpuamu_context_restore(CORTEX_ARES_AMU_NR_COUNTERS);
23
24

	return (void *)0;
25
26
27
28
}

SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_ares_context_save);
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_finish, cortex_ares_context_restore);