xref: /linux/arch/nios2/include/asm/cache.h (revision 93c91cb228e76bd93a34979d17151862b4b22c28)
1*93c91cb2SLey Foon Tan /*
2*93c91cb2SLey Foon Tan  * Copyright (C) 2004 Microtronix Datacom Ltd.
3*93c91cb2SLey Foon Tan  *
4*93c91cb2SLey Foon Tan  * All rights reserved.
5*93c91cb2SLey Foon Tan  *
6*93c91cb2SLey Foon Tan  * This program is free software; you can redistribute it and/or modify
7*93c91cb2SLey Foon Tan  * it under the terms of the GNU General Public License as published by
8*93c91cb2SLey Foon Tan  * the Free Software Foundation; either version 2 of the License, or
9*93c91cb2SLey Foon Tan  * (at your option) any later version.
10*93c91cb2SLey Foon Tan  *
11*93c91cb2SLey Foon Tan  * This program is distributed in the hope that it will be useful, but
12*93c91cb2SLey Foon Tan  * WITHOUT ANY WARRANTY; without even the implied warranty of
13*93c91cb2SLey Foon Tan  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14*93c91cb2SLey Foon Tan  * NON INFRINGEMENT.  See the GNU General Public License for more
15*93c91cb2SLey Foon Tan  * details.
16*93c91cb2SLey Foon Tan  */
17*93c91cb2SLey Foon Tan 
18*93c91cb2SLey Foon Tan #ifndef _ASM_NIOS2_CACHE_H
19*93c91cb2SLey Foon Tan #define _ASM_NIOS2_CACHE_H
20*93c91cb2SLey Foon Tan 
21*93c91cb2SLey Foon Tan #define NIOS2_DCACHE_SIZE	CONFIG_NIOS2_DCACHE_SIZE
22*93c91cb2SLey Foon Tan #define NIOS2_ICACHE_SIZE	CONFIG_NIOS2_ICACHE_SIZE
23*93c91cb2SLey Foon Tan #define NIOS2_DCACHE_LINE_SIZE	CONFIG_NIOS2_DCACHE_LINE_SIZE
24*93c91cb2SLey Foon Tan #define NIOS2_ICACHE_LINE_SHIFT	5
25*93c91cb2SLey Foon Tan #define NIOS2_ICACHE_LINE_SIZE	(1 << NIOS2_ICACHE_LINE_SHIFT)
26*93c91cb2SLey Foon Tan 
27*93c91cb2SLey Foon Tan /* bytes per L1 cache line */
28*93c91cb2SLey Foon Tan #define L1_CACHE_SHIFT		NIOS2_ICACHE_LINE_SHIFT
29*93c91cb2SLey Foon Tan #define L1_CACHE_BYTES		NIOS2_ICACHE_LINE_SIZE
30*93c91cb2SLey Foon Tan 
31*93c91cb2SLey Foon Tan #define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
32*93c91cb2SLey Foon Tan 
33*93c91cb2SLey Foon Tan #define __cacheline_aligned
34*93c91cb2SLey Foon Tan #define ____cacheline_aligned
35*93c91cb2SLey Foon Tan 
36*93c91cb2SLey Foon Tan #endif
37