mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-23 10:28:51 +09:00
![Alexey Brodkin](/assets/img/avatar_default.png)
ARCv2 cores may have built-in SLC (System Level Cache, AKA L2-cache). This change adds functions required for controlling SLC: * slc_enable/disable * slc_flush/invalidate For now we just disable SLC to escape DMA coherency issues until either: * SLC flush/invalidate is supported in DMA APIin U-Boot * hardware DMA coherency is implemented (that might be board specific so probably we'll need to have a separate Kconfig option for controlling SLC explicitly) Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
42 lines
887 B
C
42 lines
887 B
C
/*
|
|
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#ifndef __ASM_ARC_CACHE_H
|
|
#define __ASM_ARC_CACHE_H
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef CONFIG_ARC_CACHE_LINE_SHIFT
|
|
#define CONFIG_SYS_CACHELINE_SIZE (1 << CONFIG_ARC_CACHE_LINE_SHIFT)
|
|
#define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
|
|
#else
|
|
/* Satisfy users of ARCH_DMA_MINALIGN */
|
|
#define ARCH_DMA_MINALIGN 128
|
|
#endif
|
|
|
|
#if defined(ARC_MMU_ABSENT)
|
|
#define CONFIG_ARC_MMU_VER 0
|
|
#elif defined(CONFIG_ARC_MMU_V2)
|
|
#define CONFIG_ARC_MMU_VER 2
|
|
#elif defined(CONFIG_ARC_MMU_V3)
|
|
#define CONFIG_ARC_MMU_VER 3
|
|
#elif defined(CONFIG_ARC_MMU_V4)
|
|
#define CONFIG_ARC_MMU_VER 4
|
|
#endif
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#ifdef CONFIG_ISA_ARCV2
|
|
void slc_enable(void);
|
|
void slc_disable(void);
|
|
void slc_flush(void);
|
|
void slc_invalidate(void);
|
|
#endif
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* __ASM_ARC_CACHE_H */
|