diff options
-rw-r--r-- | arch/m68k/include/asm/page.h | 4 | ||||
-rw-r--r-- | arch/m68k/include/asm/page_no.h | 3 | ||||
-rw-r--r-- | arch/m68k/platform/54xx/config.c | 47 |
3 files changed, 51 insertions, 3 deletions
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h index dfebb7c1e379..ba6c91d5f3a9 100644 --- a/arch/m68k/include/asm/page.h +++ b/arch/m68k/include/asm/page.h | |||
@@ -36,6 +36,10 @@ typedef struct page *pgtable_t; | |||
36 | #define __pgd(x) ((pgd_t) { (x) } ) | 36 | #define __pgd(x) ((pgd_t) { (x) } ) |
37 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 37 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
38 | 38 | ||
39 | extern unsigned long _rambase; | ||
40 | extern unsigned long _ramstart; | ||
41 | extern unsigned long _ramend; | ||
42 | |||
39 | #endif /* !__ASSEMBLY__ */ | 43 | #endif /* !__ASSEMBLY__ */ |
40 | 44 | ||
41 | #ifdef CONFIG_MMU | 45 | #ifdef CONFIG_MMU |
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index a8d1c60eb9ce..90595721185f 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h | |||
@@ -5,9 +5,6 @@ | |||
5 | 5 | ||
6 | extern unsigned long memory_start; | 6 | extern unsigned long memory_start; |
7 | extern unsigned long memory_end; | 7 | extern unsigned long memory_end; |
8 | extern unsigned long _rambase; | ||
9 | extern unsigned long _ramstart; | ||
10 | extern unsigned long _ramend; | ||
11 | 8 | ||
12 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) | 9 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) |
13 | #define free_user_page(page, addr) free_page(addr) | 10 | #define free_user_page(page, addr) free_page(addr) |
diff --git a/arch/m68k/platform/54xx/config.c b/arch/m68k/platform/54xx/config.c index 78130984db95..ee043540bfa2 100644 --- a/arch/m68k/platform/54xx/config.c +++ b/arch/m68k/platform/54xx/config.c | |||
@@ -13,11 +13,17 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/mm.h> | ||
17 | #include <linux/bootmem.h> | ||
18 | #include <asm/pgalloc.h> | ||
16 | #include <asm/machdep.h> | 19 | #include <asm/machdep.h> |
17 | #include <asm/coldfire.h> | 20 | #include <asm/coldfire.h> |
18 | #include <asm/m54xxsim.h> | 21 | #include <asm/m54xxsim.h> |
19 | #include <asm/mcfuart.h> | 22 | #include <asm/mcfuart.h> |
20 | #include <asm/m54xxgpt.h> | 23 | #include <asm/m54xxgpt.h> |
24 | #ifdef CONFIG_MMU | ||
25 | #include <asm/mmu_context.h> | ||
26 | #endif | ||
21 | 27 | ||
22 | /***************************************************************************/ | 28 | /***************************************************************************/ |
23 | 29 | ||
@@ -95,8 +101,49 @@ static void mcf54xx_reset(void) | |||
95 | 101 | ||
96 | /***************************************************************************/ | 102 | /***************************************************************************/ |
97 | 103 | ||
104 | #ifdef CONFIG_MMU | ||
105 | |||
106 | unsigned long num_pages; | ||
107 | |||
108 | static void __init mcf54xx_bootmem_alloc(void) | ||
109 | { | ||
110 | unsigned long start_pfn; | ||
111 | unsigned long memstart; | ||
112 | |||
113 | /* _rambase and _ramend will be naturally page aligned */ | ||
114 | m68k_memory[0].addr = _rambase; | ||
115 | m68k_memory[0].size = _ramend - _rambase; | ||
116 | |||
117 | /* compute total pages in system */ | ||
118 | num_pages = (_ramend - _rambase) >> PAGE_SHIFT; | ||
119 | |||
120 | /* page numbers */ | ||
121 | memstart = PAGE_ALIGN(_ramstart); | ||
122 | min_low_pfn = _rambase >> PAGE_SHIFT; | ||
123 | start_pfn = memstart >> PAGE_SHIFT; | ||
124 | max_low_pfn = _ramend >> PAGE_SHIFT; | ||
125 | high_memory = (void *)_ramend; | ||
126 | |||
127 | m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6; | ||
128 | module_fixup(NULL, __start_fixup, __stop_fixup); | ||
129 | |||
130 | /* setup bootmem data */ | ||
131 | m68k_setup_node(0); | ||
132 | memstart += init_bootmem_node(NODE_DATA(0), start_pfn, | ||
133 | min_low_pfn, max_low_pfn); | ||
134 | free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart); | ||
135 | } | ||
136 | |||
137 | #endif /* CONFIG_MMU */ | ||
138 | |||
139 | /***************************************************************************/ | ||
140 | |||
98 | void __init config_BSP(char *commandp, int size) | 141 | void __init config_BSP(char *commandp, int size) |
99 | { | 142 | { |
143 | #ifdef CONFIG_MMU | ||
144 | mcf54xx_bootmem_alloc(); | ||
145 | mmu_context_init(); | ||
146 | #endif | ||
100 | mach_reset = mcf54xx_reset; | 147 | mach_reset = mcf54xx_reset; |
101 | m54xx_uarts_init(); | 148 | m54xx_uarts_init(); |
102 | } | 149 | } |