Merge tag 'dmaengine-fixes-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.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
6cb97111 27
9848e49a 28#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
6cb97111
BS
29extern unsigned long xtensa_kio_paddr;
30
31static inline unsigned long xtensa_get_kio_paddr(void)
32{
33 return xtensa_kio_paddr;
34}
35#endif
36
9a8fd558 37/*
d38efc1f 38 * Return the virtual address for the specified bus memory.
173d6681 39 * Note that we currently don't support any address outside the KIO segment.
9a8fd558 40 */
02f37748
MF
41static inline void __iomem *ioremap_nocache(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 46 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
173d6681
CZ
47 else
48 BUG();
9a8fd558
CZ
49}
50
02f37748
MF
51static inline void __iomem *ioremap_cache(unsigned long offset,
52 unsigned long size)
9a8fd558 53{
173d6681 54 if (offset >= XCHAL_KIO_PADDR
02f37748 55 && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
173d6681
CZ
56 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
57 else
58 BUG();
9a8fd558
CZ
59}
60
02f37748
MF
61#define ioremap_wc ioremap_nocache
62
63static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
64{
65 return ioremap_nocache(offset, size);
66}
67
68static inline void iounmap(volatile void __iomem *addr)
9a8fd558
CZ
69{
70}
cddfcbcd
CZ
71
72#define virt_to_bus virt_to_phys
73#define bus_to_virt phys_to_virt
74
d38efc1f 75#endif /* CONFIG_MMU */
9a8fd558
CZ
76
77/*
78 * Generic I/O
79 */
d38efc1f
MF
80#define readb_relaxed readb
81#define readw_relaxed readw
82#define readl_relaxed readl
9a8fd558
CZ
83
84#endif /* __KERNEL__ */
85
d38efc1f
MF
86#include <asm-generic/io.h>
87
9a8fd558 88#endif /* _XTENSA_IO_H */
This page took 0.628762 seconds and 5 git commands to generate.