blob: 65dff42148303289bb20b81201fda07e2ff62d83 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Alexey Brodkin544c5f52014-02-04 12:56:13 +04002/*
3 * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
Alexey Brodkin544c5f52014-02-04 12:56:13 +04004 */
5
6#ifndef __ASM_ARC_CACHE_H
7#define __ASM_ARC_CACHE_H
8
Alexey Brodkindff5df22015-12-14 17:14:46 +03009/*
10 * As of today we may handle any L1 cache line length right in software.
11 * For that essentially cache line length is a variable not constant.
12 * And to satisfy users of ARCH_DMA_MINALIGN we just use largest line length
13 * that may exist in either L1 or L2 (AKA SLC) caches on ARC.
14 */
15#define ARCH_DMA_MINALIGN 128
Alexey Brodkin544c5f52014-02-04 12:56:13 +040016
Alexey Brodkin275583e2015-03-30 13:36:04 +030017#ifndef __ASSEMBLY__
18
Alexey Brodkin9f916ee2015-05-18 16:56:26 +030019void cache_init(void);
Eugeniy Paltsevbcedf4d2018-03-21 15:58:50 +030020void flush_n_invalidate_dcache_all(void);
Eugeniy Paltsev67fd56a2018-03-21 15:59:02 +030021void sync_n_cleanup_cache_all(void);
Alexey Brodkin275583e2015-03-30 13:36:04 +030022
Eugeniy Paltsev04011ab2018-03-21 15:58:59 +030023static const inline int is_ioc_enabled(void)
24{
25 return IS_ENABLED(CONFIG_ARC_DBG_IOC_ENABLE);
26}
27
Eugeniy Paltsev67c34922020-03-11 15:00:43 +030028/*
29 * We export SLC control functions to use them in platform configuration code.
30 * They maust not be used in any generic code!
31 */
32void slc_enable(void);
33void slc_disable(void);
34
Alexey Brodkin275583e2015-03-30 13:36:04 +030035#endif /* __ASSEMBLY__ */
36
Alexey Brodkin544c5f52014-02-04 12:56:13 +040037#endif /* __ASM_ARC_CACHE_H */