diff options
Diffstat (limited to 'arch/arm/mach-npcm/npcm7xx/l2_cache_pl310.c')
-rw-r--r-- | arch/arm/mach-npcm/npcm7xx/l2_cache_pl310.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-npcm/npcm7xx/l2_cache_pl310.c b/arch/arm/mach-npcm/npcm7xx/l2_cache_pl310.c new file mode 100644 index 0000000000..cba2e342dc --- /dev/null +++ b/arch/arm/mach-npcm/npcm7xx/l2_cache_pl310.c @@ -0,0 +1,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 *)CONFIG_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); +} |