diff options
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/consistent.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/hugetlbpage.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/init.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/ioremap.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/ioremap_fixed.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/pgtable.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/pmb.c | 5 | ||||
-rw-r--r-- | arch/sh/mm/tlb-pteaex.c | 30 | ||||
-rw-r--r-- | arch/sh/mm/tlb-sh3.c | 19 | ||||
-rw-r--r-- | arch/sh/mm/tlb-sh4.c | 28 | ||||
-rw-r--r-- | arch/sh/mm/tlb-urb.c | 22 | ||||
-rw-r--r-- | arch/sh/mm/tlbflush_32.c | 19 |
12 files changed, 101 insertions, 28 deletions
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index 902967e3f841..c86a08540258 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/dma-debug.h> | 16 | #include <linux/dma-debug.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/gfp.h> | ||
19 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
20 | #include <asm/addrspace.h> | 21 | #include <asm/addrspace.h> |
21 | 22 | ||
diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c index 9304117039c4..9163db3e8d15 100644 --- a/arch/sh/mm/hugetlbpage.c +++ b/arch/sh/mm/hugetlbpage.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <linux/hugetlb.h> | 14 | #include <linux/hugetlb.h> |
15 | #include <linux/pagemap.h> | 15 | #include <linux/pagemap.h> |
16 | #include <linux/slab.h> | ||
17 | #include <linux/sysctl.h> | 16 | #include <linux/sysctl.h> |
18 | 17 | ||
19 | #include <asm/mman.h> | 18 | #include <asm/mman.h> |
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 68028e8f26ce..c505de61a5ca 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <linux/swap.h> | 11 | #include <linux/swap.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/gfp.h> | ||
13 | #include <linux/bootmem.h> | 14 | #include <linux/bootmem.h> |
14 | #include <linux/proc_fs.h> | 15 | #include <linux/proc_fs.h> |
15 | #include <linux/pagemap.h> | 16 | #include <linux/pagemap.h> |
diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index 1ab2385ecefe..0c99ec2e7ed8 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | #include <linux/vmalloc.h> | 15 | #include <linux/vmalloc.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/slab.h> | ||
17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
18 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
diff --git a/arch/sh/mm/ioremap_fixed.c b/arch/sh/mm/ioremap_fixed.c index 7f682e5dafcf..efbe84af9983 100644 --- a/arch/sh/mm/ioremap_fixed.c +++ b/arch/sh/mm/ioremap_fixed.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/bootmem.h> | 16 | #include <linux/bootmem.h> |
17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
18 | #include <linux/slab.h> | ||
19 | #include <asm/fixmap.h> | 18 | #include <asm/fixmap.h> |
20 | #include <asm/page.h> | 19 | #include <asm/page.h> |
21 | #include <asm/pgalloc.h> | 20 | #include <asm/pgalloc.h> |
diff --git a/arch/sh/mm/pgtable.c b/arch/sh/mm/pgtable.c index 6f21fb1d8726..26e03a1f7ca4 100644 --- a/arch/sh/mm/pgtable.c +++ b/arch/sh/mm/pgtable.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/mm.h> | 1 | #include <linux/mm.h> |
2 | #include <linux/slab.h> | ||
2 | 3 | ||
3 | #define PGALLOC_GFP GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO | 4 | #define PGALLOC_GFP GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO |
4 | 5 | ||
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index a4662e2782c3..e43ec600afcf 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/sysdev.h> | 15 | #include <linux/sysdev.h> |
16 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/slab.h> | ||
19 | #include <linux/bitops.h> | 18 | #include <linux/bitops.h> |
20 | #include <linux/debugfs.h> | 19 | #include <linux/debugfs.h> |
21 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
@@ -323,6 +322,7 @@ static void __clear_pmb_entry(struct pmb_entry *pmbe) | |||
323 | writel_uncached(data_val & ~PMB_V, data); | 322 | writel_uncached(data_val & ~PMB_V, data); |
324 | } | 323 | } |
325 | 324 | ||
325 | #ifdef CONFIG_PM | ||
326 | static void set_pmb_entry(struct pmb_entry *pmbe) | 326 | static void set_pmb_entry(struct pmb_entry *pmbe) |
327 | { | 327 | { |
328 | unsigned long flags; | 328 | unsigned long flags; |
@@ -331,6 +331,7 @@ static void set_pmb_entry(struct pmb_entry *pmbe) | |||
331 | __set_pmb_entry(pmbe); | 331 | __set_pmb_entry(pmbe); |
332 | spin_unlock_irqrestore(&pmbe->lock, flags); | 332 | spin_unlock_irqrestore(&pmbe->lock, flags); |
333 | } | 333 | } |
334 | #endif /* CONFIG_PM */ | ||
334 | 335 | ||
335 | int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys, | 336 | int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys, |
336 | unsigned long size, pgprot_t prot) | 337 | unsigned long size, pgprot_t prot) |
@@ -802,7 +803,7 @@ void __init pmb_init(void) | |||
802 | writel_uncached(0, PMB_IRMCR); | 803 | writel_uncached(0, PMB_IRMCR); |
803 | 804 | ||
804 | /* Flush out the TLB */ | 805 | /* Flush out the TLB */ |
805 | __raw_writel(__raw_readl(MMUCR) | MMUCR_TI, MMUCR); | 806 | local_flush_tlb_all(); |
806 | ctrl_barrier(); | 807 | ctrl_barrier(); |
807 | } | 808 | } |
808 | 809 | ||
diff --git a/arch/sh/mm/tlb-pteaex.c b/arch/sh/mm/tlb-pteaex.c index 32dc674c550c..b71db6af8060 100644 --- a/arch/sh/mm/tlb-pteaex.c +++ b/arch/sh/mm/tlb-pteaex.c | |||
@@ -73,5 +73,35 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
73 | jump_to_uncached(); | 73 | jump_to_uncached(); |
74 | __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); | 74 | __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); |
75 | __raw_writel(asid, MMU_UTLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); | 75 | __raw_writel(asid, MMU_UTLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); |
76 | __raw_writel(page, MMU_ITLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); | ||
77 | __raw_writel(asid, MMU_ITLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); | ||
76 | back_to_cached(); | 78 | back_to_cached(); |
77 | } | 79 | } |
80 | |||
81 | void local_flush_tlb_all(void) | ||
82 | { | ||
83 | unsigned long flags, status; | ||
84 | int i; | ||
85 | |||
86 | /* | ||
87 | * Flush all the TLB. | ||
88 | */ | ||
89 | local_irq_save(flags); | ||
90 | jump_to_uncached(); | ||
91 | |||
92 | status = __raw_readl(MMUCR); | ||
93 | status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT); | ||
94 | |||
95 | if (status == 0) | ||
96 | status = MMUCR_URB_NENTRIES; | ||
97 | |||
98 | for (i = 0; i < status; i++) | ||
99 | __raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8)); | ||
100 | |||
101 | for (i = 0; i < 4; i++) | ||
102 | __raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8)); | ||
103 | |||
104 | back_to_cached(); | ||
105 | ctrl_barrier(); | ||
106 | local_irq_restore(flags); | ||
107 | } | ||
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c index 4f5f7cbdd508..7a940dbfc2e9 100644 --- a/arch/sh/mm/tlb-sh3.c +++ b/arch/sh/mm/tlb-sh3.c | |||
@@ -77,3 +77,22 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
77 | for (i = 0; i < ways; i++) | 77 | for (i = 0; i < ways; i++) |
78 | __raw_writel(data, addr + (i << 8)); | 78 | __raw_writel(data, addr + (i << 8)); |
79 | } | 79 | } |
80 | |||
81 | void local_flush_tlb_all(void) | ||
82 | { | ||
83 | unsigned long flags, status; | ||
84 | |||
85 | /* | ||
86 | * Flush all the TLB. | ||
87 | * | ||
88 | * Write to the MMU control register's bit: | ||
89 | * TF-bit for SH-3, TI-bit for SH-4. | ||
90 | * It's same position, bit #2. | ||
91 | */ | ||
92 | local_irq_save(flags); | ||
93 | status = __raw_readl(MMUCR); | ||
94 | status |= 0x04; | ||
95 | __raw_writel(status, MMUCR); | ||
96 | ctrl_barrier(); | ||
97 | local_irq_restore(flags); | ||
98 | } | ||
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c index ccac77f504a8..cfdf7930d294 100644 --- a/arch/sh/mm/tlb-sh4.c +++ b/arch/sh/mm/tlb-sh4.c | |||
@@ -80,3 +80,31 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
80 | __raw_writel(data, addr); | 80 | __raw_writel(data, addr); |
81 | back_to_cached(); | 81 | back_to_cached(); |
82 | } | 82 | } |
83 | |||
84 | void local_flush_tlb_all(void) | ||
85 | { | ||
86 | unsigned long flags, status; | ||
87 | int i; | ||
88 | |||
89 | /* | ||
90 | * Flush all the TLB. | ||
91 | */ | ||
92 | local_irq_save(flags); | ||
93 | jump_to_uncached(); | ||
94 | |||
95 | status = __raw_readl(MMUCR); | ||
96 | status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT); | ||
97 | |||
98 | if (status == 0) | ||
99 | status = MMUCR_URB_NENTRIES; | ||
100 | |||
101 | for (i = 0; i < status; i++) | ||
102 | __raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8)); | ||
103 | |||
104 | for (i = 0; i < 4; i++) | ||
105 | __raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8)); | ||
106 | |||
107 | back_to_cached(); | ||
108 | ctrl_barrier(); | ||
109 | local_irq_restore(flags); | ||
110 | } | ||
diff --git a/arch/sh/mm/tlb-urb.c b/arch/sh/mm/tlb-urb.c index bb5b9098956d..c92ce20db39b 100644 --- a/arch/sh/mm/tlb-urb.c +++ b/arch/sh/mm/tlb-urb.c | |||
@@ -24,13 +24,9 @@ void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte) | |||
24 | 24 | ||
25 | local_irq_save(flags); | 25 | local_irq_save(flags); |
26 | 26 | ||
27 | /* Load the entry into the TLB */ | ||
28 | __update_tlb(vma, addr, pte); | ||
29 | |||
30 | /* ... and wire it up. */ | ||
31 | status = __raw_readl(MMUCR); | 27 | status = __raw_readl(MMUCR); |
32 | urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT; | 28 | urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT; |
33 | status &= ~MMUCR_URB; | 29 | status &= ~MMUCR_URC; |
34 | 30 | ||
35 | /* | 31 | /* |
36 | * Make sure we're not trying to wire the last TLB entry slot. | 32 | * Make sure we're not trying to wire the last TLB entry slot. |
@@ -39,7 +35,23 @@ void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte) | |||
39 | 35 | ||
40 | urb = urb % MMUCR_URB_NENTRIES; | 36 | urb = urb % MMUCR_URB_NENTRIES; |
41 | 37 | ||
38 | /* | ||
39 | * Insert this entry into the highest non-wired TLB slot (via | ||
40 | * the URC field). | ||
41 | */ | ||
42 | status |= (urb << MMUCR_URC_SHIFT); | ||
43 | __raw_writel(status, MMUCR); | ||
44 | ctrl_barrier(); | ||
45 | |||
46 | /* Load the entry into the TLB */ | ||
47 | __update_tlb(vma, addr, pte); | ||
48 | |||
49 | /* ... and wire it up. */ | ||
50 | status = __raw_readl(MMUCR); | ||
51 | |||
52 | status &= ~MMUCR_URB; | ||
42 | status |= (urb << MMUCR_URB_SHIFT); | 53 | status |= (urb << MMUCR_URB_SHIFT); |
54 | |||
43 | __raw_writel(status, MMUCR); | 55 | __raw_writel(status, MMUCR); |
44 | ctrl_barrier(); | 56 | ctrl_barrier(); |
45 | 57 | ||
diff --git a/arch/sh/mm/tlbflush_32.c b/arch/sh/mm/tlbflush_32.c index 004bb3f25b5f..3fbe03ce8fe3 100644 --- a/arch/sh/mm/tlbflush_32.c +++ b/arch/sh/mm/tlbflush_32.c | |||
@@ -119,22 +119,3 @@ void local_flush_tlb_mm(struct mm_struct *mm) | |||
119 | local_irq_restore(flags); | 119 | local_irq_restore(flags); |
120 | } | 120 | } |
121 | } | 121 | } |
122 | |||
123 | void local_flush_tlb_all(void) | ||
124 | { | ||
125 | unsigned long flags, status; | ||
126 | |||
127 | /* | ||
128 | * Flush all the TLB. | ||
129 | * | ||
130 | * Write to the MMU control register's bit: | ||
131 | * TF-bit for SH-3, TI-bit for SH-4. | ||
132 | * It's same position, bit #2. | ||
133 | */ | ||
134 | local_irq_save(flags); | ||
135 | status = __raw_readl(MMUCR); | ||
136 | status |= 0x04; | ||
137 | __raw_writel(status, MMUCR); | ||
138 | ctrl_barrier(); | ||
139 | local_irq_restore(flags); | ||
140 | } | ||