blob: 24941b3019a222d3b7c9f974ef5e5964cf6505a9 [file] [log] [blame]
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +09001#ifndef __ASM_SH_CACHE_H
2#define __ASM_SH_CACHE_H
3
4#if defined(CONFIG_SH4) || defined(CONFIG_SH4A)
5
Nobuhiro Iwamatsub5d10a12008-09-18 19:34:36 +09006int cache_control(unsigned int cmd);
7
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +09008#define L1_CACHE_BYTES 32
Anton Staaf2482e3c2011-10-17 16:46:07 -07009
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +090010struct __large_struct { unsigned long buf[100]; };
11#define __m(x) (*(struct __large_struct *)(x))
12
Mike Frysinger17210642011-10-27 04:59:59 -040013void dcache_wback_range(u32 start, u32 end);
14void dcache_invalid_range(u32 start, u32 end);
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +090015
Anton Staaf2482e3c2011-10-17 16:46:07 -070016#else
17
18/*
19 * 32-bytes is the largest L1 data cache line size for SH the architecture. So
20 * it is a safe default for DMA alignment.
21 */
22#define ARCH_DMA_MINALIGN 32
23
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +090024#endif /* CONFIG_SH4 || CONFIG_SH4A */
25
Anton Staaf2482e3c2011-10-17 16:46:07 -070026/*
27 * Use the L1 data cache line size value for the minimum DMA buffer alignment
28 * on SH.
29 */
30#ifndef ARCH_DMA_MINALIGN
31#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
32#endif
33
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +090034#endif /* __ASM_SH_CACHE_H */