2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #ifndef __ARC_ASM_CACHE_H
10 #define __ARC_ASM_CACHE_H
12 /* In case $$ not config, setup a dummy number for rest of kernel */
13 #ifndef CONFIG_ARC_CACHE_LINE_SHIFT
14 #define L1_CACHE_SHIFT 6
16 #define L1_CACHE_SHIFT CONFIG_ARC_CACHE_LINE_SHIFT
19 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
20 #define CACHE_LINE_MASK (~(L1_CACHE_BYTES - 1))
23 * ARC700 doesn't cache any access in top 256M.
24 * Ideal for wiring memory mapped peripherals as we don't need to do
25 * explicit uncached accesses (LD.di/ST.di) hence more portable drivers
27 #define ARC_UNCACHED_ADDR_SPACE 0xc0000000
31 /* Uncached access macros */
32 #define arc_read_uncached_32(ptr) \
35 __asm__ __volatile__( \
36 " ld.di %0, [%1] \n" \
42 #define arc_write_uncached_32(ptr, data)\
44 __asm__ __volatile__( \
45 " st.di %0, [%1] \n" \
47 : "r"(data), "r"(ptr)); \
50 #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
52 extern void arc_cache_init(void);
53 extern char *arc_cache_mumbojumbo(int cpu_id
, char *buf
, int len
);
54 extern void read_decode_cache_bcr(void);
56 #endif /* !__ASSEMBLY__ */
58 #endif /* _ASM_CACHE_H */