diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-03-27 14:51:41 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@marvell.com> | 2008-03-27 14:51:41 -0400 |
commit | 9dd0b194bf6804b1998f0fe261b2606ec7b58d72 (patch) | |
tree | c9fd5ab51dc256818c24a8a771dc068d021039e2 /include/asm-arm/arch-orion5x/io.h | |
parent | 159ffb3a04f6bc619643af680df406faafd0199d (diff) |
Orion: orion -> orion5x rename
Do a global s/orion/orion5x/ of the Orion 5x-specific bits (i.e.
not the plat-orion bits.)
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Acked-by: Saeed Bishara <saeed@marvell.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'include/asm-arm/arch-orion5x/io.h')
-rw-r--r-- | include/asm-arm/arch-orion5x/io.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/include/asm-arm/arch-orion5x/io.h b/include/asm-arm/arch-orion5x/io.h new file mode 100644 index 000000000000..5148ab7ad1f8 --- /dev/null +++ b/include/asm-arm/arch-orion5x/io.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-orion5x/io.h | ||
3 | * | ||
4 | * Tzachi Perelstein <tzachi@marvell.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_IO_H | ||
12 | #define __ASM_ARCH_IO_H | ||
13 | |||
14 | #include "orion5x.h" | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | #define IO_SPACE_REMAP ORION5X_PCI_SYS_IO_BASE | ||
18 | |||
19 | static inline void __iomem * | ||
20 | __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype) | ||
21 | { | ||
22 | void __iomem *retval; | ||
23 | |||
24 | if (mtype == MT_DEVICE && size && paddr >= ORION5X_REGS_PHYS_BASE && | ||
25 | paddr + size <= ORION5X_REGS_PHYS_BASE + ORION5X_REGS_SIZE) { | ||
26 | retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + | ||
27 | (paddr - ORION5X_REGS_PHYS_BASE); | ||
28 | } else { | ||
29 | retval = __arm_ioremap(paddr, size, mtype); | ||
30 | } | ||
31 | |||
32 | return retval; | ||
33 | } | ||
34 | |||
35 | static inline void | ||
36 | __arch_iounmap(void __iomem *addr) | ||
37 | { | ||
38 | if (addr < (void __iomem *)ORION5X_REGS_VIRT_BASE || | ||
39 | addr >= (void __iomem *)(ORION5X_REGS_VIRT_BASE + ORION5X_REGS_SIZE)) | ||
40 | __iounmap(addr); | ||
41 | } | ||
42 | |||
43 | static inline void __iomem *__io(unsigned long addr) | ||
44 | { | ||
45 | return (void __iomem *)addr; | ||
46 | } | ||
47 | |||
48 | #define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m) | ||
49 | #define __arch_iounmap(a) __arch_iounmap(a) | ||
50 | #define __io(a) __io(a) | ||
51 | #define __mem_pci(a) (a) | ||
52 | |||
53 | |||
54 | /***************************************************************************** | ||
55 | * Helpers to access Orion registers | ||
56 | ****************************************************************************/ | ||
57 | #define orion5x_read(r) __raw_readl(r) | ||
58 | #define orion5x_write(r, val) __raw_writel(val, r) | ||
59 | |||
60 | /* | ||
61 | * These are not preempt-safe. Locks, if needed, must be taken | ||
62 | * care of by the caller. | ||
63 | */ | ||
64 | #define orion5x_setbits(r, mask) orion5x_write((r), orion5x_read(r) | (mask)) | ||
65 | #define orion5x_clrbits(r, mask) orion5x_write((r), orion5x_read(r) & ~(mask)) | ||
66 | |||
67 | |||
68 | #endif | ||