1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 3 #ifndef __ASM_CSKY_IO_H 4 #define __ASM_CSKY_IO_H 5 6 #include <linux/pgtable.h> 7 #include <linux/types.h> 8 9 /* 10 * I/O memory access primitives. Reads are ord 11 * following Normal memory access. Writes are 12 * Normal memory access. 13 * 14 * For CACHEV1 (807, 810), store instruction c 15 * another mb() to prevent st fast retire. 16 * 17 * For CACHEV2 (860), store instruction with P 18 * fast retire. 19 */ 20 #define readb(c) ({ u8 __v = r 21 #define readw(c) ({ u16 __v = r 22 #define readl(c) ({ u32 __v = r 23 24 #ifdef CONFIG_CPU_HAS_CACHEV2 25 #define writeb(v,c) ({ wmb(); writ 26 #define writew(v,c) ({ wmb(); writ 27 #define writel(v,c) ({ wmb(); writ 28 #else 29 #define writeb(v,c) ({ wmb(); writ 30 #define writew(v,c) ({ wmb(); writ 31 #define writel(v,c) ({ wmb(); writ 32 #endif 33 34 /* 35 * String version of I/O memory access operati 36 */ 37 extern void __memcpy_fromio(void *, const vola 38 extern void __memcpy_toio(volatile void __iome 39 extern void __memset_io(volatile void __iomem 40 41 #define memset_io(c,v,l) __memset_io((c 42 #define memcpy_fromio(a,c,l) __memcpy_fromi 43 #define memcpy_toio(c,a,l) __memcpy_toio( 44 45 /* 46 * I/O memory mapping functions. 47 */ 48 #define ioremap_wc(addr, size) \ 49 ioremap_prot((addr), (size), \ 50 (_PAGE_IOREMAP & ~_CACHE_MASK) 51 52 #include <asm-generic/io.h> 53 54 #endif /* __ASM_CSKY_IO_H */ 55
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.