diff options
Diffstat (limited to 'arch/sh/include/asm')
-rw-r--r-- | arch/sh/include/asm/addrspace.h | 4 | ||||
-rw-r--r-- | arch/sh/include/asm/io.h | 27 | ||||
-rw-r--r-- | arch/sh/include/asm/mmu.h | 18 | ||||
-rw-r--r-- | arch/sh/include/asm/page.h | 2 |
4 files changed, 39 insertions, 12 deletions
diff --git a/arch/sh/include/asm/addrspace.h b/arch/sh/include/asm/addrspace.h index 99d6b3ecbe22..bcd7d4d78f6b 100644 --- a/arch/sh/include/asm/addrspace.h +++ b/arch/sh/include/asm/addrspace.h | |||
@@ -28,7 +28,7 @@ | |||
28 | /* Returns the privileged segment base of a given address */ | 28 | /* Returns the privileged segment base of a given address */ |
29 | #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) | 29 | #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) |
30 | 30 | ||
31 | #if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED) | 31 | #ifdef CONFIG_29BIT |
32 | /* | 32 | /* |
33 | * Map an address to a certain privileged segment | 33 | * Map an address to a certain privileged segment |
34 | */ | 34 | */ |
@@ -40,7 +40,7 @@ | |||
40 | ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG)) | 40 | ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG)) |
41 | #define P4SEGADDR(a) \ | 41 | #define P4SEGADDR(a) \ |
42 | ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG)) | 42 | ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG)) |
43 | #endif /* 29BIT || PMB_FIXED */ | 43 | #endif /* 29BIT */ |
44 | #endif /* P1SEG */ | 44 | #endif /* P1SEG */ |
45 | 45 | ||
46 | /* Check if an address can be reached in 29 bits */ | 46 | /* Check if an address can be reached in 29 bits */ |
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 026dd659a640..f4314d8b05b8 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h | |||
@@ -244,18 +244,11 @@ __ioremap(unsigned long offset, unsigned long size, unsigned long flags) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | static inline void __iomem * | 246 | static inline void __iomem * |
247 | __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) | 247 | __ioremap_29bit(unsigned long offset, unsigned long size, unsigned long flags) |
248 | { | 248 | { |
249 | #if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB) | 249 | #ifdef CONFIG_29BIT |
250 | unsigned long last_addr = offset + size - 1; | 250 | unsigned long last_addr = offset + size - 1; |
251 | #endif | ||
252 | void __iomem *ret; | ||
253 | 251 | ||
254 | ret = __ioremap_trapped(offset, size); | ||
255 | if (ret) | ||
256 | return ret; | ||
257 | |||
258 | #if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB) | ||
259 | /* | 252 | /* |
260 | * For P1 and P2 space this is trivial, as everything is already | 253 | * For P1 and P2 space this is trivial, as everything is already |
261 | * mapped. Uncached access for P1 addresses are done through P2. | 254 | * mapped. Uncached access for P1 addresses are done through P2. |
@@ -274,6 +267,22 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) | |||
274 | return (void __iomem *)P4SEGADDR(offset); | 267 | return (void __iomem *)P4SEGADDR(offset); |
275 | #endif | 268 | #endif |
276 | 269 | ||
270 | return NULL; | ||
271 | } | ||
272 | |||
273 | static inline void __iomem * | ||
274 | __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) | ||
275 | { | ||
276 | void __iomem *ret; | ||
277 | |||
278 | ret = __ioremap_trapped(offset, size); | ||
279 | if (ret) | ||
280 | return ret; | ||
281 | |||
282 | ret = __ioremap_29bit(offset, size, flags); | ||
283 | if (ret) | ||
284 | return ret; | ||
285 | |||
277 | return __ioremap(offset, size, flags); | 286 | return __ioremap(offset, size, flags); |
278 | } | 287 | } |
279 | #else | 288 | #else |
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h index c7426ad9926e..4b0882bf5183 100644 --- a/arch/sh/include/asm/mmu.h +++ b/arch/sh/include/asm/mmu.h | |||
@@ -65,11 +65,29 @@ struct pmb_entry { | |||
65 | struct pmb_entry *link; | 65 | struct pmb_entry *link; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | #ifdef CONFIG_PMB | ||
68 | /* arch/sh/mm/pmb.c */ | 69 | /* arch/sh/mm/pmb.c */ |
69 | long pmb_remap(unsigned long virt, unsigned long phys, | 70 | long pmb_remap(unsigned long virt, unsigned long phys, |
70 | unsigned long size, unsigned long flags); | 71 | unsigned long size, unsigned long flags); |
71 | void pmb_unmap(unsigned long addr); | 72 | void pmb_unmap(unsigned long addr); |
72 | int pmb_init(void); | 73 | int pmb_init(void); |
74 | #else | ||
75 | static inline long pmb_remap(unsigned long virt, unsigned long phys, | ||
76 | unsigned long size, unsigned long flags) | ||
77 | { | ||
78 | return -EINVAL | ||
79 | } | ||
80 | |||
81 | static inline void pmb_unmap(unsigned long addr) | ||
82 | { | ||
83 | } | ||
84 | |||
85 | static inline int pmb_init(void) | ||
86 | { | ||
87 | return -ENODEV; | ||
88 | } | ||
89 | #endif /* CONFIG_PMB */ | ||
90 | |||
73 | #endif /* __ASSEMBLY__ */ | 91 | #endif /* __ASSEMBLY__ */ |
74 | 92 | ||
75 | #endif /* __MMU_H */ | 93 | #endif /* __MMU_H */ |
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h index 81bffc0d6860..a86c0f1d05d4 100644 --- a/arch/sh/include/asm/page.h +++ b/arch/sh/include/asm/page.h | |||
@@ -127,7 +127,7 @@ typedef struct page *pgtable_t; | |||
127 | * is not visible (it is part of the PMB mapping) and so needs to be | 127 | * is not visible (it is part of the PMB mapping) and so needs to be |
128 | * added or subtracted as required. | 128 | * added or subtracted as required. |
129 | */ | 129 | */ |
130 | #if defined(CONFIG_PMB_FIXED) | 130 | #if defined(CONFIG_PMB_LEGACY) |
131 | /* phys = virt - PAGE_OFFSET - (__MEMORY_START & 0xe0000000) */ | 131 | /* phys = virt - PAGE_OFFSET - (__MEMORY_START & 0xe0000000) */ |
132 | #define PMB_OFFSET (PAGE_OFFSET - PXSEG(__MEMORY_START)) | 132 | #define PMB_OFFSET (PAGE_OFFSET - PXSEG(__MEMORY_START)) |
133 | #define __pa(x) ((unsigned long)(x) - PMB_OFFSET) | 133 | #define __pa(x) ((unsigned long)(x) - PMB_OFFSET) |