blob: 0698a377595df89d71e40ce62f0c1a402a98e49f [file] [log] [blame]
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +09001#ifndef __ASM_SH_CACHE_H
2#define __ASM_SH_CACHE_H
3
Nobuhiro Iwamatsu6b87abe2014-01-09 12:22:12 +09004#if defined(CONFIG_SH4)
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +09005
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
Anton Staaf2482e3c2011-10-17 16:46:07 -070013#else
14
15/*
16 * 32-bytes is the largest L1 data cache line size for SH the architecture. So
17 * it is a safe default for DMA alignment.
18 */
19#define ARCH_DMA_MINALIGN 32
20
Nobuhiro Iwamatsu6b87abe2014-01-09 12:22:12 +090021#endif /* CONFIG_SH4 */
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +090022
Anton Staaf2482e3c2011-10-17 16:46:07 -070023/*
24 * Use the L1 data cache line size value for the minimum DMA buffer alignment
25 * on SH.
26 */
27#ifndef ARCH_DMA_MINALIGN
28#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
29#endif
30
Nobuhiro Iwamatsue92c95182008-03-12 12:15:29 +090031#endif /* __ASM_SH_CACHE_H */