blob: 83165d5c9705fcc2f41eb501eb363b15e556aba3 [file] [log] [blame]
Anton Staaf66d6dbf2011-10-17 16:46:11 -07001/*
2 * Copyright (c) 2011 The Chromium OS Authors.
Anton Staaf66d6dbf2011-10-17 16:46:11 -07003 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Anton Staaf66d6dbf2011-10-17 16:46:11 -07005 */
6
7#ifndef __MIPS_CACHE_H__
8#define __MIPS_CACHE_H__
9
Daniel Schwierzeck02ca55e2016-01-09 17:32:50 +010010#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT
11#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
12
13#define ARCH_DMA_MINALIGN (L1_CACHE_BYTES)
Anton Staaf66d6dbf2011-10-17 16:46:11 -070014
Paul Burton62f13522016-05-27 14:28:05 +010015/*
16 * CONFIG_SYS_CACHELINE_SIZE is still used in various drivers primarily for
17 * DMA buffer alignment. Satisfy those drivers by providing it as a synonym
18 * of ARCH_DMA_MINALIGN for now.
19 */
20#define CONFIG_SYS_CACHELINE_SIZE ARCH_DMA_MINALIGN
21
Marek Vasutfde25722016-11-25 23:32:22 +010022#ifndef __ASSEMBLY__
Paul Burtondc2037e2016-09-21 11:18:48 +010023/**
24 * mips_cache_probe() - Probe the properties of the caches
25 *
26 * Call this to probe the properties such as line sizes of the caches
27 * present in the system, if any. This must be done before cache maintenance
28 * functions such as flush_cache may be called.
29 */
30void mips_cache_probe(void);
Marek Vasutfde25722016-11-25 23:32:22 +010031#endif
Paul Burtondc2037e2016-09-21 11:18:48 +010032
Anton Staaf66d6dbf2011-10-17 16:46:11 -070033#endif /* __MIPS_CACHE_H__ */