~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: ed4b1ca5c9833483d63e83ab488a2f31a7de7899 (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
27
28
29
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (c) 2021 Nuvoton Technology Corp.
 */

#include <common.h>
#include <asm/io.h>
#include <asm/pl310.h>

void l2_pl310_init(void);

void set_pl310_ctrl(u32 enable)
{
	struct pl310_regs *const pl310 = (struct pl310_regs *)CFG_SYS_PL310_BASE;

	writel(enable, &pl310->pl310_ctrl);
}

void v7_outer_cache_enable(void)
{
	l2_pl310_init();

	set_pl310_ctrl(1);
}

void v7_outer_cache_disable(void)
{
	set_pl310_ctrl(0);
}