blob: fe75409b5c3065444ee601ce6aaccbe39254244a [file] [log] [blame]
Alexey Brodkin288aaac2014-02-04 12:56:13 +04001/*
2 * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __ASM_ARC_CACHE_H
8#define __ASM_ARC_CACHE_H
9
10#include <config.h>
11
Alexey Brodkin379b3282015-12-14 17:14:46 +030012/*
13 * As of today we may handle any L1 cache line length right in software.
14 * For that essentially cache line length is a variable not constant.
15 * And to satisfy users of ARCH_DMA_MINALIGN we just use largest line length
16 * that may exist in either L1 or L2 (AKA SLC) caches on ARC.
17 */
18#define ARCH_DMA_MINALIGN 128
Alexey Brodkin288aaac2014-02-04 12:56:13 +040019
Alexey Brodkinf13606b2015-01-13 18:35:46 +030020#if defined(ARC_MMU_ABSENT)
21#define CONFIG_ARC_MMU_VER 0
22#elif defined(CONFIG_ARC_MMU_V2)
Alexey Brodkin812980b2015-02-03 13:58:11 +030023#define CONFIG_ARC_MMU_VER 2
24#elif defined(CONFIG_ARC_MMU_V3)
25#define CONFIG_ARC_MMU_VER 3
Alexey Brodkinf13606b2015-01-13 18:35:46 +030026#elif defined(CONFIG_ARC_MMU_V4)
27#define CONFIG_ARC_MMU_VER 4
Alexey Brodkin812980b2015-02-03 13:58:11 +030028#endif
29
Alexey Brodkin6eb15e52015-03-30 13:36:04 +030030#ifndef __ASSEMBLY__
31
Alexey Brodkinef639e62015-05-18 16:56:26 +030032void cache_init(void);
Eugeniy Paltsevc27814b2018-03-21 15:58:50 +030033void flush_n_invalidate_dcache_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
Alexey Brodkin6eb15e52015-03-30 13:36:04 +030040#endif /* __ASSEMBLY__ */
41
Alexey Brodkin288aaac2014-02-04 12:56:13 +040042#endif /* __ASM_ARC_CACHE_H */