Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / nios2 / include / asm / io.h
blob36e3550673b34bc8f36df994af624bf2ac886a6b
1 /*
2 * Copyright (C) 2014 Altera Corporation
3 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
4 * Copyright (C) 2004 Microtronix Datacom Ltd.
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
11 #ifndef _ASM_NIOS2_IO_H
12 #define _ASM_NIOS2_IO_H
14 #include <linux/types.h>
15 #include <asm/pgtable-bits.h>
17 /* PCI is not supported in nios2, set this to 0. */
18 #define IO_SPACE_LIMIT 0
20 #define readb_relaxed(addr) readb(addr)
21 #define readw_relaxed(addr) readw(addr)
22 #define readl_relaxed(addr) readl(addr)
24 #define writeb_relaxed(x, addr) writeb(x, addr)
25 #define writew_relaxed(x, addr) writew(x, addr)
26 #define writel_relaxed(x, addr) writel(x, addr)
28 void __iomem *ioremap(unsigned long physaddr, unsigned long size);
29 void iounmap(void __iomem *addr);
31 /* Macros used for converting between virtual and physical mappings. */
32 #define phys_to_virt(vaddr) \
33 ((void *)((unsigned long)(vaddr) | CONFIG_NIOS2_KERNEL_REGION_BASE))
34 /* Clear top 3 bits */
35 #define virt_to_phys(vaddr) \
36 ((unsigned long)((unsigned long)(vaddr) & ~0xE0000000))
38 #include <asm-generic/io.h>
40 #endif /* _ASM_NIOS2_IO_H */