scu.c 660 Bytes
Newer Older
1
/*
Leon Chen's avatar
Leon Chen committed
2
 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

Leon Chen's avatar
Leon Chen committed
7
#include <arch.h>
8
9
#include <lib/mmio.h>

Leon Chen's avatar
Leon Chen committed
10
#include <mcucfg.h>
11

Leon Chen's avatar
Leon Chen committed
12
13
14
15
16
17
18
19
20
void disable_scu(unsigned long mpidr)
{
	if (mpidr & MPIDR_CLUSTER_MASK)
		mmio_setbits_32((uintptr_t)&mt6795_mcucfg->mp1_miscdbg,
			MP1_ACINACTM);
	else
		mmio_setbits_32((uintptr_t)&mt6795_mcucfg->mp0_axi_config,
			MP0_ACINACTM);
}
21

Leon Chen's avatar
Leon Chen committed
22
23
24
25
26
27
28
29
30
void enable_scu(unsigned long mpidr)
{
	if (mpidr & MPIDR_CLUSTER_MASK)
		mmio_clrbits_32((uintptr_t)&mt6795_mcucfg->mp1_miscdbg,
			MP1_ACINACTM);
	else
		mmio_clrbits_32((uintptr_t)&mt6795_mcucfg->mp0_axi_config,
			MP0_ACINACTM);
}