aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/microblaze/include/asm/pgalloc.h2
-rw-r--r--arch/microblaze/include/asm/pgtable.h6
-rw-r--r--arch/microblaze/mm/init.c14
-rw-r--r--arch/microblaze/pci/pci-common.c2
4 files changed, 18 insertions, 6 deletions
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index 7547f5064560..f44b0d696fe2 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -19,6 +19,7 @@
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/cache.h> 21#include <asm/cache.h>
22#include <asm/pgtable.h>
22 23
23#define PGDIR_ORDER 0 24#define PGDIR_ORDER 0
24 25
@@ -111,7 +112,6 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
111 unsigned long address) 112 unsigned long address)
112{ 113{
113 pte_t *pte; 114 pte_t *pte;
114 extern int mem_init_done;
115 extern void *early_get_page(void); 115 extern void *early_get_page(void);
116 if (mem_init_done) { 116 if (mem_init_done) {
117 pte = (pte_t *)__get_free_page(GFP_KERNEL | 117 pte = (pte_t *)__get_free_page(GFP_KERNEL |
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index adcc3320e52a..dd2bb60651c7 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -16,6 +16,10 @@
16#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 16#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
17 remap_pfn_range(vma, vaddr, pfn, size, prot) 17 remap_pfn_range(vma, vaddr, pfn, size, prot)
18 18
19#ifndef __ASSEMBLY__
20extern int mem_init_done;
21#endif
22
19#ifndef CONFIG_MMU 23#ifndef CONFIG_MMU
20 24
21#define pgd_present(pgd) (1) /* pages are always present on non MMU */ 25#define pgd_present(pgd) (1) /* pages are always present on non MMU */
@@ -51,6 +55,8 @@ static inline int pte_file(pte_t pte) { return 0; }
51 55
52#define arch_enter_lazy_cpu_mode() do {} while (0) 56#define arch_enter_lazy_cpu_mode() do {} while (0)
53 57
58#define pgprot_noncached_wc(prot) prot
59
54#else /* CONFIG_MMU */ 60#else /* CONFIG_MMU */
55 61
56#include <asm-generic/4level-fixup.h> 62#include <asm-generic/4level-fixup.h>
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index aa6e163411b5..1608e2e1a44a 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -23,6 +23,9 @@
23#include <asm/sections.h> 23#include <asm/sections.h>
24#include <asm/tlb.h> 24#include <asm/tlb.h>
25 25
26/* Use for MMU and noMMU because of PCI generic code */
27int mem_init_done;
28
26#ifndef CONFIG_MMU 29#ifndef CONFIG_MMU
27unsigned int __page_offset; 30unsigned int __page_offset;
28EXPORT_SYMBOL(__page_offset); 31EXPORT_SYMBOL(__page_offset);
@@ -30,7 +33,6 @@ EXPORT_SYMBOL(__page_offset);
30#else 33#else
31DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 34DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
32 35
33int mem_init_done;
34static int init_bootmem_done; 36static int init_bootmem_done;
35#endif /* CONFIG_MMU */ 37#endif /* CONFIG_MMU */
36 38
@@ -202,9 +204,7 @@ void __init mem_init(void)
202 printk(KERN_INFO "Memory: %luk/%luk available\n", 204 printk(KERN_INFO "Memory: %luk/%luk available\n",
203 nr_free_pages() << (PAGE_SHIFT-10), 205 nr_free_pages() << (PAGE_SHIFT-10),
204 num_physpages << (PAGE_SHIFT-10)); 206 num_physpages << (PAGE_SHIFT-10));
205#ifdef CONFIG_MMU
206 mem_init_done = 1; 207 mem_init_done = 1;
207#endif
208} 208}
209 209
210#ifndef CONFIG_MMU 210#ifndef CONFIG_MMU
@@ -216,6 +216,10 @@ int ___range_ok(unsigned long addr, unsigned long size)
216} 216}
217EXPORT_SYMBOL(___range_ok); 217EXPORT_SYMBOL(___range_ok);
218 218
219int page_is_ram(unsigned long pfn)
220{
221 return __range_ok(pfn, 0);
222}
219#else 223#else
220int page_is_ram(unsigned long pfn) 224int page_is_ram(unsigned long pfn)
221{ 225{
@@ -344,6 +348,8 @@ void __init *early_get_page(void)
344 return p; 348 return p;
345} 349}
346 350
351#endif /* CONFIG_MMU */
352
347void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask) 353void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
348{ 354{
349 if (mem_init_done) 355 if (mem_init_done)
@@ -365,5 +371,3 @@ void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
365 } 371 }
366 return p; 372 return p;
367} 373}
368
369#endif /* CONFIG_MMU */
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index f03f8be2740a..0be34350d733 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -561,11 +561,13 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus,
561 * memory, effectively behaving just like /dev/zero 561 * memory, effectively behaving just like /dev/zero
562 */ 562 */
563 if ((offset + size) > hose->isa_mem_size) { 563 if ((offset + size) > hose->isa_mem_size) {
564#ifdef CONFIG_MMU
564 printk(KERN_DEBUG 565 printk(KERN_DEBUG
565 "Process %s (pid:%d) mapped non-existing PCI" 566 "Process %s (pid:%d) mapped non-existing PCI"
566 "legacy memory for 0%04x:%02x\n", 567 "legacy memory for 0%04x:%02x\n",
567 current->comm, current->pid, pci_domain_nr(bus), 568 current->comm, current->pid, pci_domain_nr(bus),
568 bus->number); 569 bus->number);
570#endif
569 if (vma->vm_flags & VM_SHARED) 571 if (vma->vm_flags & VM_SHARED)
570 return shmem_zero_setup(vma); 572 return shmem_zero_setup(vma);
571 return 0; 573 return 0;