| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | *  linux/include/asm-arm/arch-ebsa110/io.h | 
|  | 3 | * | 
|  | 4 | *  Copyright (C) 1997,1998 Russell King | 
|  | 5 | * | 
|  | 6 | * This program is free software; you can redistribute it and/or modify | 
|  | 7 | * it under the terms of the GNU General Public License version 2 as | 
|  | 8 | * published by the Free Software Foundation. | 
|  | 9 | * | 
|  | 10 | * Modifications: | 
|  | 11 | *  06-Dec-1997	RMK	Created. | 
|  | 12 | */ | 
|  | 13 | #ifndef __ASM_ARM_ARCH_IO_H | 
|  | 14 | #define __ASM_ARM_ARCH_IO_H | 
|  | 15 |  | 
|  | 16 | #define IO_SPACE_LIMIT 0xffff | 
|  | 17 |  | 
|  | 18 | u8 __inb8(unsigned int port); | 
|  | 19 | void __outb8(u8  val, unsigned int port); | 
|  | 20 |  | 
|  | 21 | u8 __inb16(unsigned int port); | 
|  | 22 | void __outb16(u8  val, unsigned int port); | 
|  | 23 |  | 
|  | 24 | u16 __inw(unsigned int port); | 
|  | 25 | void __outw(u16 val, unsigned int port); | 
|  | 26 |  | 
|  | 27 | u32 __inl(unsigned int port); | 
|  | 28 | void __outl(u32 val, unsigned int port); | 
|  | 29 |  | 
| Russell King | 8de35ef | 2006-11-20 15:59:10 +0000 | [diff] [blame] | 30 | u8  __readb(const volatile void __iomem *addr); | 
|  | 31 | u16 __readw(const volatile void __iomem *addr); | 
|  | 32 | u32 __readl(const volatile void __iomem *addr); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 |  | 
|  | 34 | void __writeb(u8  val, void __iomem *addr); | 
|  | 35 | void __writew(u16 val, void __iomem *addr); | 
|  | 36 | void __writel(u32 val, void __iomem *addr); | 
|  | 37 |  | 
|  | 38 | /* | 
|  | 39 | * Argh, someone forgot the IOCS16 line.  We therefore have to handle | 
|  | 40 | * the byte stearing by selecting the correct byte IO functions here. | 
|  | 41 | */ | 
|  | 42 | #ifdef ISA_SIXTEEN_BIT_PERIPHERAL | 
|  | 43 | #define inb(p) 			__inb16(p) | 
|  | 44 | #define outb(v,p)		__outb16(v,p) | 
|  | 45 | #else | 
|  | 46 | #define inb(p)			__inb8(p) | 
|  | 47 | #define outb(v,p)		__outb8(v,p) | 
|  | 48 | #endif | 
|  | 49 |  | 
|  | 50 | #define inw(p)			__inw(p) | 
|  | 51 | #define outw(v,p)		__outw(v,p) | 
|  | 52 |  | 
|  | 53 | #define inl(p)			__inl(p) | 
|  | 54 | #define outl(v,p)		__outl(v,p) | 
|  | 55 |  | 
|  | 56 | #define readb(b)		__readb(b) | 
|  | 57 | #define readw(b)		__readw(b) | 
|  | 58 | #define readl(b)		__readl(b) | 
|  | 59 | #define readb_relaxed(addr)	readb(addr) | 
|  | 60 | #define readw_relaxed(addr)	readw(addr) | 
|  | 61 | #define readl_relaxed(addr)	readl(addr) | 
|  | 62 |  | 
|  | 63 | #define writeb(v,b)		__writeb(v,b) | 
|  | 64 | #define writew(v,b)		__writew(v,b) | 
|  | 65 | #define writel(v,b)		__writel(v,b) | 
|  | 66 |  | 
| Russell King | 8de35ef | 2006-11-20 15:59:10 +0000 | [diff] [blame] | 67 | static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size, | 
|  | 68 | unsigned int flags) | 
|  | 69 | { | 
|  | 70 | return (void __iomem *)cookie; | 
|  | 71 | } | 
|  | 72 |  | 
|  | 73 | #define __arch_ioremap		__arch_ioremap | 
|  | 74 | #define __arch_iounmap(cookie)	do { } while (0) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 |  | 
|  | 76 | extern void insb(unsigned int port, void *buf, int sz); | 
|  | 77 | extern void insw(unsigned int port, void *buf, int sz); | 
|  | 78 | extern void insl(unsigned int port, void *buf, int sz); | 
|  | 79 |  | 
|  | 80 | extern void outsb(unsigned int port, const void *buf, int sz); | 
|  | 81 | extern void outsw(unsigned int port, const void *buf, int sz); | 
|  | 82 | extern void outsl(unsigned int port, const void *buf, int sz); | 
|  | 83 |  | 
| Russell King | 27350af | 2007-03-03 11:51:31 +0000 | [diff] [blame] | 84 | /* can't support writesb atm */ | 
|  | 85 | extern void writesw(void __iomem *addr, const void *data, int wordlen); | 
|  | 86 | extern void writesl(void __iomem *addr, const void *data, int longlen); | 
|  | 87 |  | 
|  | 88 | /* can't support readsb atm */ | 
|  | 89 | extern void readsw(const void __iomem *addr, void *data, int wordlen); | 
|  | 90 | extern void readsl(const void __iomem *addr, void *data, int longlen); | 
|  | 91 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | #endif |