blob: a48e1aec6889e0d2578085a67c295aca5ac06054 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Alexey Brodkin288aaac2014-02-04 12:56:13 +04002/*
3 * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
Alexey Brodkin288aaac2014-02-04 12:56:13 +04004 */
5
6#ifndef __ASM_ARC_CACHE_H
7#define __ASM_ARC_CACHE_H
8
9#include <config.h>
10
Alexey Brodkin379b3282015-12-14 17:14:46 +030011/*
12 * As of today we may handle any L1 cache line length right in software.
13 * For that essentially cache line length is a variable not constant.
14 * And to satisfy users of ARCH_DMA_MINALIGN we just use largest line length
15 * that may exist in either L1 or L2 (AKA SLC) caches on ARC.
16 */
17#define ARCH_DMA_MINALIGN 128
Alexey Brodkin288aaac2014-02-04 12:56:13 +040018
Alexey Brodkinf13606b2015-01-13 18:35:46 +030019#if defined(ARC_MMU_ABSENT)
20#define CONFIG_ARC_MMU_VER 0
21#elif defined(CONFIG_ARC_MMU_V2)
Alexey Brodkin812980b2015-02-03 13:58:11 +030022#define CONFIG_ARC_MMU_VER 2
23#elif defined(CONFIG_ARC_MMU_V3)
24#define CONFIG_ARC_MMU_VER 3
Alexey Brodkinf13606b2015-01-13 18:35:46 +030025#elif defined(CONFIG_ARC_MMU_V4)
26#define CONFIG_ARC_MMU_VER 4
Alexey Brodkin812980b2015-02-03 13:58:11 +030027#endif
28
Alexey Brodkin6eb15e52015-03-30 13:36:04 +030029#ifndef __ASSEMBLY__
30
Alexey Brodkinef639e62015-05-18 16:56:26 +030031void cache_init(void);
Eugeniy Paltsevc27814b2018-03-21 15:58:50 +030032void flush_n_invalidate_dcache_all(void);
Eugeniy Paltsev375945b2018-03-21 15:59:02 +030033void sync_n_cleanup_cache_all(void);
Alexey Brodkin6eb15e52015-03-30 13:36:04 +030034
Eugeniy Paltsev48b04832018-03-21 15:58:59 +030035static const inline int is_ioc_enabled(void)
36{
37 return IS_ENABLED(CONFIG_ARC_DBG_IOC_ENABLE);
38}
39
Eugeniy Paltsevb15cb0b2020-03-11 15:00:43 +030040/*
41 * We export SLC control functions to use them in platform configuration code.
42 * They maust not be used in any generic code!
43 */
44void slc_enable(void);
45void slc_disable(void);
46
Alexey Brodkin6eb15e52015-03-30 13:36:04 +030047#endif /* __ASSEMBLY__ */
48
Alexey Brodkin288aaac2014-02-04 12:56:13 +040049#endif /* __ASM_ARC_CACHE_H */