blob: ed4b1ca5c9833483d63e83ab488a2f31a7de7899 [file] [log] [blame]
Jim Liu4359b332022-04-19 13:32:19 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (c) 2021 Nuvoton Technology Corp.
4 */
5
Tom Riniabb9a042024-05-18 20:20:43 -06006#include <common.h>
Jim Liu4359b332022-04-19 13:32:19 +08007#include <asm/io.h>
8#include <asm/pl310.h>
9
10void l2_pl310_init(void);
11
12void set_pl310_ctrl(u32 enable)
13{
Tom Rini6a5dccc2022-11-16 13:10:41 -050014 struct pl310_regs *const pl310 = (struct pl310_regs *)CFG_SYS_PL310_BASE;
Jim Liu4359b332022-04-19 13:32:19 +080015
16 writel(enable, &pl310->pl310_ctrl);
17}
18
19void v7_outer_cache_enable(void)
20{
21 l2_pl310_init();
22
23 set_pl310_ctrl(1);
24}
25
26void v7_outer_cache_disable(void)
27{
28 set_pl310_ctrl(0);
29}