ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-arm / arch-omap / io.h
1 /*
2  * linux/include/asm-arm/arch-omap/io.h
3  *
4  * Copied from linux/include/asm-arm/arch-sa1100/io.h
5  * Copyright (C) 1997-1999 Russell King
6  *
7  * Modifications:
8  *  06-12-1997  RMK     Created.
9  *  07-04-1999  RMK     Major cleanup
10  */
11 #ifndef __ASM_ARM_ARCH_IO_H
12 #define __ASM_ARM_ARCH_IO_H
13
14 #define IO_SPACE_LIMIT 0xffffffff
15
16 /*
17  * We don't actually have real ISA nor PCI buses, but there is so many
18  * drivers out there that might just work if we fake them...
19  */
20 #define __io(a)                 (PCIO_BASE + (a))
21 #define __mem_pci(a)            ((unsigned long)(a))
22 #define __mem_isa(a)            ((unsigned long)(a))
23
24 /*
25  * Functions to access the OMAP IO region
26  *
27  * NOTE: - Use omap_read/write[bwl] for physical register addresses
28  *       - Use __raw_read/write[bwl]() for virtual register addresses
29  *       - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses
30  *       - DO NOT use hardcoded virtual addresses to allow changing the
31  *         IO address space again if needed
32  */
33 #define omap_readb(a)           (*(volatile unsigned char  *)IO_ADDRESS(a))
34 #define omap_readw(a)           (*(volatile unsigned short *)IO_ADDRESS(a))
35 #define omap_readl(a)           (*(volatile unsigned int   *)IO_ADDRESS(a))
36
37 #define omap_writeb(v,a)        (*(volatile unsigned char  *)IO_ADDRESS(a) = (v))
38 #define omap_writew(v,a)        (*(volatile unsigned short *)IO_ADDRESS(a) = (v))
39 #define omap_writel(v,a)        (*(volatile unsigned int   *)IO_ADDRESS(a) = (v))
40
41 #endif