| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * linux/include/asm-arm/arch-shark/io.h | 
|  | 3 | * | 
|  | 4 | * by Alexander Schulz | 
|  | 5 | * | 
|  | 6 | * derived from: | 
|  | 7 | * linux/include/asm-arm/arch-ebsa110/io.h | 
|  | 8 | * Copyright (C) 1997,1998 Russell King | 
|  | 9 | */ | 
|  | 10 |  | 
|  | 11 | #ifndef __ASM_ARM_ARCH_IO_H | 
|  | 12 | #define __ASM_ARM_ARCH_IO_H | 
|  | 13 |  | 
| Russell King | 7fca0aa | 2005-10-28 10:20:25 +0100 | [diff] [blame] | 14 | #include <asm/hardware.h> | 
|  | 15 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #define IO_SPACE_LIMIT 0xffffffff | 
|  | 17 |  | 
|  | 18 | /* | 
|  | 19 | * We use two different types of addressing - PC style addresses, and ARM | 
|  | 20 | * addresses.  PC style accesses the PC hardware with the normal PC IO | 
|  | 21 | * addresses, eg 0x3f8 for serial#1.  ARM addresses are 0x80000000+ | 
|  | 22 | * and are translated to the start of IO. | 
|  | 23 | */ | 
|  | 24 | #define __PORT_PCIO(x)	(!((x) & 0x80000000)) | 
|  | 25 |  | 
| Alexander Schulz | b752341 | 2005-07-16 17:17:18 +0100 | [diff] [blame] | 26 | #define __io(a)                 ((void __iomem *)(PCIO_BASE + (a))) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 |  | 
|  | 29 | static inline unsigned int __ioaddr (unsigned int port)			\ | 
|  | 30 | {										\ | 
|  | 31 | if (__PORT_PCIO(port))							\ | 
|  | 32 | return (unsigned int)(PCIO_BASE + (port));			\ | 
|  | 33 | else									\ | 
|  | 34 | return (unsigned int)(IO_BASE + (port));			\ | 
|  | 35 | } | 
|  | 36 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | #define __mem_pci(addr) (addr) | 
|  | 38 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | /* | 
|  | 40 | * Translated address IO functions | 
|  | 41 | * | 
|  | 42 | * IO address has already been translated to a virtual address | 
|  | 43 | */ | 
|  | 44 | #define outb_t(v,p)								\ | 
|  | 45 | (*(volatile unsigned char *)(p) = (v)) | 
|  | 46 |  | 
|  | 47 | #define inb_t(p)								\ | 
|  | 48 | (*(volatile unsigned char *)(p)) | 
|  | 49 |  | 
|  | 50 | #define outl_t(v,p)								\ | 
|  | 51 | (*(volatile unsigned long *)(p) = (v)) | 
|  | 52 |  | 
|  | 53 | #define inl_t(p)								\ | 
|  | 54 | (*(volatile unsigned long *)(p)) | 
|  | 55 |  | 
|  | 56 | #endif |