diff options
author | Michal Simek <monstr@monstr.eu> | 2009-05-26 10:30:16 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-05-26 10:45:16 -0400 |
commit | dc95be1f7188f0718ac922b6b6b72406c294d250 (patch) | |
tree | 3432808d4243d1509694a7a9ad574d8961e2aeed /arch/microblaze/include | |
parent | 15902bf63c8332946e5a1f48a72e3ae22874b11b (diff) |
microblaze_mmu_v2: io.h MMU update
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r-- | arch/microblaze/include/asm/io.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 8b5853ee6b5c..5c173424d074 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h | |||
@@ -1,4 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu> | ||
3 | * Copyright (C) 2007-2009 PetaLogix | ||
2 | * Copyright (C) 2006 Atmark Techno, Inc. | 4 | * Copyright (C) 2006 Atmark Techno, Inc. |
3 | * | 5 | * |
4 | * This file is subject to the terms and conditions of the GNU General Public | 6 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -12,6 +14,9 @@ | |||
12 | #include <asm/byteorder.h> | 14 | #include <asm/byteorder.h> |
13 | #include <asm/page.h> | 15 | #include <asm/page.h> |
14 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <asm/byteorder.h> | ||
18 | #include <linux/mm.h> /* Get struct page {...} */ | ||
19 | |||
15 | 20 | ||
16 | #define IO_SPACE_LIMIT (0xFFFFFFFF) | 21 | #define IO_SPACE_LIMIT (0xFFFFFFFF) |
17 | 22 | ||
@@ -112,6 +117,30 @@ static inline void writel(unsigned int v, volatile void __iomem *addr) | |||
112 | #define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c)) | 117 | #define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c)) |
113 | #define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c)) | 118 | #define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c)) |
114 | 119 | ||
120 | #ifdef CONFIG_MMU | ||
121 | |||
122 | #define mm_ptov(addr) ((void *)__phys_to_virt(addr)) | ||
123 | #define mm_vtop(addr) ((unsigned long)__virt_to_phys(addr)) | ||
124 | #define phys_to_virt(addr) ((void *)__phys_to_virt(addr)) | ||
125 | #define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr)) | ||
126 | #define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr)) | ||
127 | |||
128 | #define __page_address(page) \ | ||
129 | (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) | ||
130 | #define page_to_phys(page) virt_to_phys((void *)__page_address(page)) | ||
131 | #define page_to_bus(page) (page_to_phys(page)) | ||
132 | #define bus_to_virt(addr) (phys_to_virt(addr)) | ||
133 | |||
134 | extern void iounmap(void *addr); | ||
135 | /*extern void *__ioremap(phys_addr_t address, unsigned long size, | ||
136 | unsigned long flags);*/ | ||
137 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size); | ||
138 | #define ioremap_writethrough(addr, size) ioremap((addr), (size)) | ||
139 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) | ||
140 | #define ioremap_fullcache(addr, size) ioremap((addr), (size)) | ||
141 | |||
142 | #else /* CONFIG_MMU */ | ||
143 | |||
115 | /** | 144 | /** |
116 | * virt_to_phys - map virtual addresses to physical | 145 | * virt_to_phys - map virtual addresses to physical |
117 | * @address: address to remap | 146 | * @address: address to remap |
@@ -160,6 +189,8 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size, | |||
160 | #define iounmap(addr) ((void)0) | 189 | #define iounmap(addr) ((void)0) |
161 | #define ioremap_nocache(physaddr, size) ioremap(physaddr, size) | 190 | #define ioremap_nocache(physaddr, size) ioremap(physaddr, size) |
162 | 191 | ||
192 | #endif /* CONFIG_MMU */ | ||
193 | |||
163 | /* | 194 | /* |
164 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 195 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
165 | * access | 196 | * access |