^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Copyright (C) 2014 Altera Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2004 Microtronix Datacom Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * License. See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef _ASM_NIOS2_IO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define _ASM_NIOS2_IO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <asm/pgtable-bits.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* PCI is not supported in nios2, set this to 0. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define IO_SPACE_LIMIT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define readb_relaxed(addr) readb(addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define readw_relaxed(addr) readw(addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define readl_relaxed(addr) readl(addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define writeb_relaxed(x, addr) writeb(x, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define writew_relaxed(x, addr) writew(x, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define writel_relaxed(x, addr) writel(x, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void __iomem *ioremap(unsigned long physaddr, unsigned long size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) void iounmap(void __iomem *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) /* Pages to physical address... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define page_to_phys(page) virt_to_phys(page_to_virt(page))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) /* Macros used for converting between virtual and physical mappings. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define phys_to_virt(vaddr) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) ((void *)((unsigned long)(vaddr) | CONFIG_NIOS2_KERNEL_REGION_BASE))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /* Clear top 3 bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define virt_to_phys(vaddr) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ((unsigned long)((unsigned long)(vaddr) & ~0xE0000000))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #include <asm-generic/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #endif /* _ASM_NIOS2_IO_H */