blob: 5e6ed0038b2b438667a35b1f4e60b3883e08c1e0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
14#define IO_SPACE_LIMIT 0xffffffff
15
16/*
17 * We use two different types of addressing - PC style addresses, and ARM
18 * addresses. PC style accesses the PC hardware with the normal PC IO
19 * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
20 * and are translated to the start of IO.
21 */
22#define __PORT_PCIO(x) (!((x) & 0x80000000))
23
Alexander Schulzb7523412005-07-16 17:17:18 +010024#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27static inline unsigned int __ioaddr (unsigned int port) \
28{ \
29 if (__PORT_PCIO(port)) \
30 return (unsigned int)(PCIO_BASE + (port)); \
31 else \
32 return (unsigned int)(IO_BASE + (port)); \
33}
34
Linus Torvalds1da177e2005-04-16 15:20:36 -070035#define __mem_pci(addr) (addr)
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037/*
38 * Translated address IO functions
39 *
40 * IO address has already been translated to a virtual address
41 */
42#define outb_t(v,p) \
43 (*(volatile unsigned char *)(p) = (v))
44
45#define inb_t(p) \
46 (*(volatile unsigned char *)(p))
47
48#define outl_t(v,p) \
49 (*(volatile unsigned long *)(p) = (v))
50
51#define inl_t(p) \
52 (*(volatile unsigned long *)(p))
53
54#endif