xtensa: avoid duplicate of IO range definitions
[linux-2.6-block.git] / arch / xtensa / include / asm / io.h
CommitLineData
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
9a8fd558 27/*
d38efc1f 28 * Return the virtual address for the specified bus memory.
173d6681 29 * Note that we currently don't support any address outside the KIO segment.
9a8fd558 30 */
02f37748
MF
31static inline void __iomem *ioremap_nocache(unsigned long offset,
32 unsigned long size)
9a8fd558 33{
173d6681 34 if (offset >= XCHAL_KIO_PADDR
02f37748 35 && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
173d6681 36 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
173d6681
CZ
37 else
38 BUG();
9a8fd558
CZ
39}
40
02f37748
MF
41static inline void __iomem *ioremap_cache(unsigned long offset,
42 unsigned long size)
9a8fd558 43{
173d6681 44 if (offset >= XCHAL_KIO_PADDR
02f37748 45 && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
173d6681
CZ
46 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
47 else
48 BUG();
9a8fd558
CZ
49}
50
02f37748
MF
51#define ioremap_wc ioremap_nocache
52
53static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
54{
55 return ioremap_nocache(offset, size);
56}
57
58static inline void iounmap(volatile void __iomem *addr)
9a8fd558
CZ
59{
60}
cddfcbcd
CZ
61
62#define virt_to_bus virt_to_phys
63#define bus_to_virt phys_to_virt
64
d38efc1f 65#endif /* CONFIG_MMU */
9a8fd558
CZ
66
67/*
68 * Generic I/O
69 */
d38efc1f
MF
70#define readb_relaxed readb
71#define readw_relaxed readw
72#define readl_relaxed readl
9a8fd558
CZ
73
74#endif /* __KERNEL__ */
75
d38efc1f
MF
76#include <asm-generic/io.h>
77
9a8fd558 78#endif /* _XTENSA_IO_H */