Commit | Line | Data |
---|---|---|
9a8fd558 | 1 | /* |
173d6681 | 2 | * include/asm-xtensa/io.h |
9a8fd558 CZ |
3 | * |
4 | * This file is subject to the terms and conditions of the GNU General Public | |
5 | * License. See the file "COPYING" in the main directory of this archive | |
6 | * for more details. | |
7 | * | |
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | |
9 | */ | |
10 | ||
11 | #ifndef _XTENSA_IO_H | |
12 | #define _XTENSA_IO_H | |
13 | ||
14 | #ifdef __KERNEL__ | |
9a8fd558 | 15 | #include <asm/byteorder.h> |
c51aea80 | 16 | #include <asm/page.h> |
4809bb46 | 17 | #include <asm/vectors.h> |
bfae8ee8 | 18 | #include <linux/bug.h> |
6656920b | 19 | #include <linux/kernel.h> |
9a8fd558 CZ |
20 | |
21 | #include <linux/types.h> | |
9a8fd558 | 22 | |
00c81d23 | 23 | #define IOADDR(x) (XCHAL_KIO_BYPASS_VADDR + (x)) |
d38efc1f | 24 | #define IO_SPACE_LIMIT ~0 |
9a8fd558 | 25 | |
d38efc1f | 26 | #ifdef CONFIG_MMU |
6cb97111 | 27 | |
9a8fd558 | 28 | /* |
d38efc1f | 29 | * Return the virtual address for the specified bus memory. |
173d6681 | 30 | * Note that we currently don't support any address outside the KIO segment. |
9a8fd558 | 31 | */ |
02f37748 MF |
32 | static inline void __iomem *ioremap_nocache(unsigned long offset, |
33 | unsigned long size) | |
9a8fd558 | 34 | { |
173d6681 | 35 | if (offset >= XCHAL_KIO_PADDR |
02f37748 | 36 | && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) |
173d6681 | 37 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); |
173d6681 CZ |
38 | else |
39 | BUG(); | |
9a8fd558 CZ |
40 | } |
41 | ||
02f37748 MF |
42 | static inline void __iomem *ioremap_cache(unsigned long offset, |
43 | unsigned long size) | |
9a8fd558 | 44 | { |
173d6681 | 45 | if (offset >= XCHAL_KIO_PADDR |
02f37748 | 46 | && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) |
173d6681 CZ |
47 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); |
48 | else | |
49 | BUG(); | |
9a8fd558 | 50 | } |
92281dee | 51 | #define ioremap_cache ioremap_cache |
9a8fd558 | 52 | |
02f37748 | 53 | #define ioremap_wc ioremap_nocache |
556269c1 | 54 | #define ioremap_wt ioremap_nocache |
02f37748 MF |
55 | |
56 | static inline void __iomem *ioremap(unsigned long offset, unsigned long size) | |
57 | { | |
58 | return ioremap_nocache(offset, size); | |
59 | } | |
60 | ||
61 | static inline void iounmap(volatile void __iomem *addr) | |
9a8fd558 CZ |
62 | { |
63 | } | |
cddfcbcd CZ |
64 | |
65 | #define virt_to_bus virt_to_phys | |
66 | #define bus_to_virt phys_to_virt | |
67 | ||
d38efc1f | 68 | #endif /* CONFIG_MMU */ |
9a8fd558 | 69 | |
9a8fd558 CZ |
70 | #endif /* __KERNEL__ */ |
71 | ||
d38efc1f MF |
72 | #include <asm-generic/io.h> |
73 | ||
9a8fd558 | 74 | #endif /* _XTENSA_IO_H */ |