Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Alexey Brodkin | 544c5f5 | 2014-02-04 12:56:13 +0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved. |
Alexey Brodkin | 544c5f5 | 2014-02-04 12:56:13 +0400 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __ASM_ARC_CACHE_H |
| 7 | #define __ASM_ARC_CACHE_H |
| 8 | |
| 9 | #include <config.h> |
| 10 | |
Alexey Brodkin | dff5df2 | 2015-12-14 17:14:46 +0300 | [diff] [blame] | 11 | /* |
| 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 Brodkin | 544c5f5 | 2014-02-04 12:56:13 +0400 | [diff] [blame] | 18 | |
Alexey Brodkin | 275583e | 2015-03-30 13:36:04 +0300 | [diff] [blame] | 19 | #ifndef __ASSEMBLY__ |
| 20 | |
Alexey Brodkin | 9f916ee | 2015-05-18 16:56:26 +0300 | [diff] [blame] | 21 | void cache_init(void); |
Eugeniy Paltsev | bcedf4d | 2018-03-21 15:58:50 +0300 | [diff] [blame] | 22 | void flush_n_invalidate_dcache_all(void); |
Eugeniy Paltsev | 67fd56a | 2018-03-21 15:59:02 +0300 | [diff] [blame] | 23 | void sync_n_cleanup_cache_all(void); |
Alexey Brodkin | 275583e | 2015-03-30 13:36:04 +0300 | [diff] [blame] | 24 | |
Eugeniy Paltsev | 04011ab | 2018-03-21 15:58:59 +0300 | [diff] [blame] | 25 | static const inline int is_ioc_enabled(void) |
| 26 | { |
| 27 | return IS_ENABLED(CONFIG_ARC_DBG_IOC_ENABLE); |
| 28 | } |
| 29 | |
Eugeniy Paltsev | 67c3492 | 2020-03-11 15:00:43 +0300 | [diff] [blame] | 30 | /* |
| 31 | * We export SLC control functions to use them in platform configuration code. |
| 32 | * They maust not be used in any generic code! |
| 33 | */ |
| 34 | void slc_enable(void); |
| 35 | void slc_disable(void); |
| 36 | |
Alexey Brodkin | 275583e | 2015-03-30 13:36:04 +0300 | [diff] [blame] | 37 | #endif /* __ASSEMBLY__ */ |
| 38 | |
Alexey Brodkin | 544c5f5 | 2014-02-04 12:56:13 +0400 | [diff] [blame] | 39 | #endif /* __ASM_ARC_CACHE_H */ |