diff options
Diffstat (limited to 'arch/frv')
-rw-r--r-- | arch/frv/include/asm/highmem.h | 34 | ||||
-rw-r--r-- | arch/frv/include/asm/kmap_types.h | 24 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-dma.c | 4 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-vdk.c | 4 | ||||
-rw-r--r-- | arch/frv/mm/cache-page.c | 8 | ||||
-rw-r--r-- | arch/frv/mm/highmem.c | 20 |
6 files changed, 28 insertions, 66 deletions
diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h index 716956a5317b..b3adc93611f3 100644 --- a/arch/frv/include/asm/highmem.h +++ b/arch/frv/include/asm/highmem.h | |||
@@ -76,15 +76,16 @@ extern struct page *kmap_atomic_to_page(void *ptr); | |||
76 | 76 | ||
77 | #ifndef __ASSEMBLY__ | 77 | #ifndef __ASSEMBLY__ |
78 | 78 | ||
79 | #define __kmap_atomic_primary(type, paddr, ampr) \ | 79 | #define __kmap_atomic_primary(cached, paddr, ampr) \ |
80 | ({ \ | 80 | ({ \ |
81 | unsigned long damlr, dampr; \ | 81 | unsigned long damlr, dampr; \ |
82 | \ | 82 | \ |
83 | dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ | 83 | dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ |
84 | \ | 84 | \ |
85 | if (type != __KM_CACHE) \ | 85 | if (!cached) \ |
86 | asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ | 86 | asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ |
87 | else \ | 87 | else \ |
88 | /* cache flush page attachment point */ \ | ||
88 | asm volatile("movgs %0,iampr"#ampr"\n" \ | 89 | asm volatile("movgs %0,iampr"#ampr"\n" \ |
89 | "movgs %0,dampr"#ampr"\n" \ | 90 | "movgs %0,dampr"#ampr"\n" \ |
90 | :: "r"(dampr) : "memory" \ | 91 | :: "r"(dampr) : "memory" \ |
@@ -112,29 +113,20 @@ extern struct page *kmap_atomic_to_page(void *ptr); | |||
112 | (void *) damlr; \ | 113 | (void *) damlr; \ |
113 | }) | 114 | }) |
114 | 115 | ||
115 | static inline void *kmap_atomic_primary(struct page *page, enum km_type type) | 116 | static inline void *kmap_atomic_primary(struct page *page) |
116 | { | 117 | { |
117 | unsigned long paddr; | 118 | unsigned long paddr; |
118 | 119 | ||
119 | pagefault_disable(); | 120 | pagefault_disable(); |
120 | paddr = page_to_phys(page); | 121 | paddr = page_to_phys(page); |
121 | 122 | ||
122 | switch (type) { | 123 | return __kmap_atomic_primary(1, paddr, 2); |
123 | case 0: return __kmap_atomic_primary(0, paddr, 2); | ||
124 | case 1: return __kmap_atomic_primary(1, paddr, 3); | ||
125 | case 2: return __kmap_atomic_primary(2, paddr, 4); | ||
126 | case 3: return __kmap_atomic_primary(3, paddr, 5); | ||
127 | |||
128 | default: | ||
129 | BUG(); | ||
130 | return NULL; | ||
131 | } | ||
132 | } | 124 | } |
133 | 125 | ||
134 | #define __kunmap_atomic_primary(type, ampr) \ | 126 | #define __kunmap_atomic_primary(cached, ampr) \ |
135 | do { \ | 127 | do { \ |
136 | asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ | 128 | asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ |
137 | if (type == __KM_CACHE) \ | 129 | if (cached) \ |
138 | asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ | 130 | asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ |
139 | } while(0) | 131 | } while(0) |
140 | 132 | ||
@@ -143,17 +135,9 @@ do { \ | |||
143 | asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ | 135 | asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ |
144 | } while(0) | 136 | } while(0) |
145 | 137 | ||
146 | static inline void kunmap_atomic_primary(void *kvaddr, enum km_type type) | 138 | static inline void kunmap_atomic_primary(void *kvaddr) |
147 | { | 139 | { |
148 | switch (type) { | 140 | __kunmap_atomic_primary(1, 2); |
149 | case 0: __kunmap_atomic_primary(0, 2); break; | ||
150 | case 1: __kunmap_atomic_primary(1, 3); break; | ||
151 | case 2: __kunmap_atomic_primary(2, 4); break; | ||
152 | case 3: __kunmap_atomic_primary(3, 5); break; | ||
153 | |||
154 | default: | ||
155 | BUG(); | ||
156 | } | ||
157 | pagefault_enable(); | 141 | pagefault_enable(); |
158 | } | 142 | } |
159 | 143 | ||
diff --git a/arch/frv/include/asm/kmap_types.h b/arch/frv/include/asm/kmap_types.h index f8e16b2a5804..43901f220963 100644 --- a/arch/frv/include/asm/kmap_types.h +++ b/arch/frv/include/asm/kmap_types.h | |||
@@ -2,28 +2,6 @@ | |||
2 | #ifndef _ASM_KMAP_TYPES_H | 2 | #ifndef _ASM_KMAP_TYPES_H |
3 | #define _ASM_KMAP_TYPES_H | 3 | #define _ASM_KMAP_TYPES_H |
4 | 4 | ||
5 | enum km_type { | 5 | #define KM_TYPE_NR 17 |
6 | /* arch specific kmaps - change the numbers attached to these at your peril */ | ||
7 | __KM_CACHE, /* cache flush page attachment point */ | ||
8 | __KM_PGD, /* current page directory */ | ||
9 | __KM_ITLB_PTD, /* current instruction TLB miss page table lookup */ | ||
10 | __KM_DTLB_PTD, /* current data TLB miss page table lookup */ | ||
11 | |||
12 | /* general kmaps */ | ||
13 | KM_BOUNCE_READ, | ||
14 | KM_SKB_SUNRPC_DATA, | ||
15 | KM_SKB_DATA_SOFTIRQ, | ||
16 | KM_USER0, | ||
17 | KM_USER1, | ||
18 | KM_BIO_SRC_IRQ, | ||
19 | KM_BIO_DST_IRQ, | ||
20 | KM_PTE0, | ||
21 | KM_PTE1, | ||
22 | KM_IRQ0, | ||
23 | KM_IRQ1, | ||
24 | KM_SOFTIRQ0, | ||
25 | KM_SOFTIRQ1, | ||
26 | KM_TYPE_NR | ||
27 | }; | ||
28 | 6 | ||
29 | #endif | 7 | #endif |
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c index 4f8d8bcdc7de..82478979ac9a 100644 --- a/arch/frv/mb93090-mb00/pci-dma.c +++ b/arch/frv/mb93090-mb00/pci-dma.c | |||
@@ -62,14 +62,14 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
62 | dampr2 = __get_DAMPR(2); | 62 | dampr2 = __get_DAMPR(2); |
63 | 63 | ||
64 | for (i = 0; i < nents; i++) { | 64 | for (i = 0; i < nents; i++) { |
65 | vaddr = kmap_atomic_primary(sg_page(&sg[i]), __KM_CACHE); | 65 | vaddr = kmap_atomic_primary(sg_page(&sg[i])); |
66 | 66 | ||
67 | frv_dcache_writeback((unsigned long) vaddr, | 67 | frv_dcache_writeback((unsigned long) vaddr, |
68 | (unsigned long) vaddr + PAGE_SIZE); | 68 | (unsigned long) vaddr + PAGE_SIZE); |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||
72 | kunmap_atomic_primary(vaddr, __KM_CACHE); | 72 | kunmap_atomic_primary(vaddr); |
73 | if (dampr2) { | 73 | if (dampr2) { |
74 | __set_DAMPR(2, dampr2); | 74 | __set_DAMPR(2, dampr2); |
75 | __set_IAMPR(2, dampr2); | 75 | __set_IAMPR(2, dampr2); |
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index 6b0b82ff4419..d04ed14bbf0c 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c | |||
@@ -268,7 +268,7 @@ static void __init pci_fixup_umc_ide(struct pci_dev *d) | |||
268 | d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO; | 268 | d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO; |
269 | } | 269 | } |
270 | 270 | ||
271 | static void __init pci_fixup_ide_bases(struct pci_dev *d) | 271 | static void __devinit pci_fixup_ide_bases(struct pci_dev *d) |
272 | { | 272 | { |
273 | int i; | 273 | int i; |
274 | 274 | ||
@@ -287,7 +287,7 @@ static void __init pci_fixup_ide_bases(struct pci_dev *d) | |||
287 | } | 287 | } |
288 | } | 288 | } |
289 | 289 | ||
290 | static void __init pci_fixup_ide_trash(struct pci_dev *d) | 290 | static void __devinit pci_fixup_ide_trash(struct pci_dev *d) |
291 | { | 291 | { |
292 | int i; | 292 | int i; |
293 | 293 | ||
diff --git a/arch/frv/mm/cache-page.c b/arch/frv/mm/cache-page.c index b24ade27a0f0..8e09dae0ec3f 100644 --- a/arch/frv/mm/cache-page.c +++ b/arch/frv/mm/cache-page.c | |||
@@ -26,11 +26,11 @@ void flush_dcache_page(struct page *page) | |||
26 | 26 | ||
27 | dampr2 = __get_DAMPR(2); | 27 | dampr2 = __get_DAMPR(2); |
28 | 28 | ||
29 | vaddr = kmap_atomic_primary(page, __KM_CACHE); | 29 | vaddr = kmap_atomic_primary(page); |
30 | 30 | ||
31 | frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); | 31 | frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); |
32 | 32 | ||
33 | kunmap_atomic_primary(vaddr, __KM_CACHE); | 33 | kunmap_atomic_primary(vaddr); |
34 | 34 | ||
35 | if (dampr2) { | 35 | if (dampr2) { |
36 | __set_DAMPR(2, dampr2); | 36 | __set_DAMPR(2, dampr2); |
@@ -54,12 +54,12 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | |||
54 | 54 | ||
55 | dampr2 = __get_DAMPR(2); | 55 | dampr2 = __get_DAMPR(2); |
56 | 56 | ||
57 | vaddr = kmap_atomic_primary(page, __KM_CACHE); | 57 | vaddr = kmap_atomic_primary(page); |
58 | 58 | ||
59 | start = (start & ~PAGE_MASK) | (unsigned long) vaddr; | 59 | start = (start & ~PAGE_MASK) | (unsigned long) vaddr; |
60 | frv_cache_wback_inv(start, start + len); | 60 | frv_cache_wback_inv(start, start + len); |
61 | 61 | ||
62 | kunmap_atomic_primary(vaddr, __KM_CACHE); | 62 | kunmap_atomic_primary(vaddr); |
63 | 63 | ||
64 | if (dampr2) { | 64 | if (dampr2) { |
65 | __set_DAMPR(2, dampr2); | 65 | __set_DAMPR(2, dampr2); |
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c index 31902c9d5be5..bed9a9bd3c10 100644 --- a/arch/frv/mm/highmem.c +++ b/arch/frv/mm/highmem.c | |||
@@ -50,11 +50,11 @@ void *kmap_atomic(struct page *page) | |||
50 | /* | 50 | /* |
51 | * The first 4 primary maps are reserved for architecture code | 51 | * The first 4 primary maps are reserved for architecture code |
52 | */ | 52 | */ |
53 | case 0: return __kmap_atomic_primary(4, paddr, 6); | 53 | case 0: return __kmap_atomic_primary(0, paddr, 6); |
54 | case 1: return __kmap_atomic_primary(5, paddr, 7); | 54 | case 1: return __kmap_atomic_primary(0, paddr, 7); |
55 | case 2: return __kmap_atomic_primary(6, paddr, 8); | 55 | case 2: return __kmap_atomic_primary(0, paddr, 8); |
56 | case 3: return __kmap_atomic_primary(7, paddr, 9); | 56 | case 3: return __kmap_atomic_primary(0, paddr, 9); |
57 | case 4: return __kmap_atomic_primary(8, paddr, 10); | 57 | case 4: return __kmap_atomic_primary(0, paddr, 10); |
58 | 58 | ||
59 | case 5 ... 5 + NR_TLB_LINES - 1: | 59 | case 5 ... 5 + NR_TLB_LINES - 1: |
60 | return __kmap_atomic_secondary(type - 5, paddr); | 60 | return __kmap_atomic_secondary(type - 5, paddr); |
@@ -70,11 +70,11 @@ void __kunmap_atomic(void *kvaddr) | |||
70 | { | 70 | { |
71 | int type = kmap_atomic_idx(); | 71 | int type = kmap_atomic_idx(); |
72 | switch (type) { | 72 | switch (type) { |
73 | case 0: __kunmap_atomic_primary(4, 6); break; | 73 | case 0: __kunmap_atomic_primary(0, 6); break; |
74 | case 1: __kunmap_atomic_primary(5, 7); break; | 74 | case 1: __kunmap_atomic_primary(0, 7); break; |
75 | case 2: __kunmap_atomic_primary(6, 8); break; | 75 | case 2: __kunmap_atomic_primary(0, 8); break; |
76 | case 3: __kunmap_atomic_primary(7, 9); break; | 76 | case 3: __kunmap_atomic_primary(0, 9); break; |
77 | case 4: __kunmap_atomic_primary(8, 10); break; | 77 | case 4: __kunmap_atomic_primary(0, 10); break; |
78 | 78 | ||
79 | case 5 ... 5 + NR_TLB_LINES - 1: | 79 | case 5 ... 5 + NR_TLB_LINES - 1: |
80 | __kunmap_atomic_secondary(type - 5, kvaddr); | 80 | __kunmap_atomic_secondary(type - 5, kvaddr); |