Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'sh/lmb'

Conflicts:
arch/sh/kernel/setup.c

+273 -211
+1
arch/sh/include/asm/io_generic.h
··· 38 38 39 39 void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size); 40 40 void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr); 41 + void IO_CONCAT(__IO_PREFIX,mem_init)(void); 41 42 42 43 #undef __IO_PREFIX
+8
arch/sh/include/asm/kexec.h
··· 26 26 /* The native architecture */ 27 27 #define KEXEC_ARCH KEXEC_ARCH_SH 28 28 29 + #ifdef CONFIG_KEXEC 30 + /* arch/sh/kernel/machine_kexec.c */ 31 + void reserve_crashkernel(void); 32 + 29 33 static inline void crash_setup_regs(struct pt_regs *newregs, 30 34 struct pt_regs *oldregs) 31 35 { ··· 63 59 newregs->pc = (unsigned long)current_text_addr(); 64 60 } 65 61 } 62 + #else 63 + static inline void reserve_crashkernel(void) { } 64 + #endif /* CONFIG_KEXEC */ 65 + 66 66 #endif /* __ASM_SH_KEXEC_H */
+2
arch/sh/include/asm/machvec.h
··· 49 49 50 50 int (*mv_clk_init)(void); 51 51 int (*mv_mode_pins)(void); 52 + 53 + void (*mv_mem_init)(void); 52 54 }; 53 55 54 56 extern struct sh_machine_vector sh_mv;
+2 -1
arch/sh/include/asm/mmzone.h
··· 42 42 void __init plat_mem_setup(void); 43 43 44 44 /* arch/sh/kernel/setup.c */ 45 - void __init setup_bootmem_allocator(unsigned long start_pfn); 46 45 void __init __add_active_range(unsigned int nid, unsigned long start_pfn, 47 46 unsigned long end_pfn); 47 + /* arch/sh/mm/init.c */ 48 + void __init allocate_pgdat(unsigned int nid); 48 49 49 50 #endif /* __KERNEL__ */ 50 51 #endif /* __ASM_SH_MMZONE_H */
+1 -1
arch/sh/include/asm/page.h
··· 49 49 50 50 extern unsigned long shm_align_mask; 51 51 extern unsigned long max_low_pfn, min_low_pfn; 52 - extern unsigned long memory_start, memory_end; 52 + extern unsigned long memory_start, memory_end, memory_limit; 53 53 54 54 static inline unsigned long 55 55 pages_do_alias(unsigned long addr1, unsigned long addr2)
+1
arch/sh/include/asm/setup.h
··· 19 19 #define COMMAND_LINE ((char *) (PARAM+0x100)) 20 20 21 21 void sh_mv_setup(void); 22 + void check_for_initrd(void); 22 23 23 24 #endif /* __KERNEL__ */ 24 25
+58 -1
arch/sh/kernel/machine_kexec.c
··· 8 8 * This source code is licensed under the GNU General Public License, 9 9 * Version 2. See the file COPYING for more details. 10 10 */ 11 - 12 11 #include <linux/mm.h> 13 12 #include <linux/kexec.h> 14 13 #include <linux/delay.h> ··· 15 16 #include <linux/numa.h> 16 17 #include <linux/ftrace.h> 17 18 #include <linux/suspend.h> 19 + #include <linux/lmb.h> 18 20 #include <asm/pgtable.h> 19 21 #include <asm/pgalloc.h> 20 22 #include <asm/mmu_context.h> ··· 150 150 #ifdef CONFIG_X2TLB 151 151 VMCOREINFO_CONFIG(X2TLB); 152 152 #endif 153 + } 154 + 155 + void __init reserve_crashkernel(void) 156 + { 157 + unsigned long long crash_size, crash_base; 158 + int ret; 159 + 160 + /* this is necessary because of lmb_phys_mem_size() */ 161 + lmb_analyze(); 162 + 163 + ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(), 164 + &crash_size, &crash_base); 165 + if (ret == 0 && crash_size > 0) { 166 + crashk_res.start = crash_base; 167 + crashk_res.end = crash_base + crash_size - 1; 168 + } 169 + 170 + if (crashk_res.end == crashk_res.start) 171 + goto disable; 172 + 173 + crash_size = PAGE_ALIGN(crashk_res.end - crashk_res.start + 1); 174 + if (!crashk_res.start) { 175 + unsigned long max = lmb_end_of_DRAM() - memory_limit; 176 + crashk_res.start = __lmb_alloc_base(crash_size, PAGE_SIZE, max); 177 + if (!crashk_res.start) { 178 + pr_err("crashkernel allocation failed\n"); 179 + goto disable; 180 + } 181 + } else { 182 + ret = lmb_reserve(crashk_res.start, crash_size); 183 + if (unlikely(ret < 0)) { 184 + pr_err("crashkernel reservation failed - " 185 + "memory is in use\n"); 186 + goto disable; 187 + } 188 + } 189 + 190 + crashk_res.end = crashk_res.start + crash_size - 1; 191 + 192 + /* 193 + * Crash kernel trumps memory limit 194 + */ 195 + if ((lmb_end_of_DRAM() - memory_limit) <= crashk_res.end) { 196 + memory_limit = 0; 197 + pr_info("Disabled memory limit for crashkernel\n"); 198 + } 199 + 200 + pr_info("Reserving %ldMB of memory at 0x%08lx " 201 + "for crashkernel (System RAM: %ldMB)\n", 202 + (unsigned long)(crash_size >> 20), 203 + (unsigned long)(crashk_res.start), 204 + (unsigned long)(lmb_phys_mem_size() >> 20)); 205 + 206 + return; 207 + 208 + disable: 209 + crashk_res.start = crashk_res.end = 0; 153 210 }
+1
arch/sh/kernel/machvec.c
··· 131 131 mv_set(ioport_unmap); 132 132 mv_set(irq_demux); 133 133 mv_set(mode_pins); 134 + mv_set(mem_init); 134 135 135 136 if (!sh_mv.mv_nr_irqs) 136 137 sh_mv.mv_nr_irqs = NR_IRQS;
+28 -204
arch/sh/kernel/setup.c
··· 4 4 * This file handles the architecture-dependent parts of initialization 5 5 * 6 6 * Copyright (C) 1999 Niibe Yutaka 7 - * Copyright (C) 2002 - 2007 Paul Mundt 7 + * Copyright (C) 2002 - 2010 Paul Mundt 8 8 */ 9 9 #include <linux/screen_info.h> 10 10 #include <linux/ioport.h> ··· 41 41 #include <asm/clock.h> 42 42 #include <asm/smp.h> 43 43 #include <asm/mmu_context.h> 44 + #include <asm/mmzone.h> 44 45 45 46 /* 46 47 * Initialize loops_per_jiffy as 10000000 (1000MIPS). ··· 95 94 EXPORT_SYMBOL(memory_start); 96 95 unsigned long memory_end = 0; 97 96 EXPORT_SYMBOL(memory_end); 97 + unsigned long memory_limit = 0; 98 98 99 99 static struct resource mem_resources[MAX_NUMNODES]; 100 100 ··· 103 101 104 102 static int __init early_parse_mem(char *p) 105 103 { 106 - unsigned long size; 104 + if (!p) 105 + return 1; 107 106 108 - memory_start = (unsigned long)__va(__MEMORY_START); 109 - size = memparse(p, &p); 107 + memory_limit = PAGE_ALIGN(memparse(p, &p)); 110 108 111 - if (size > __MEMORY_SIZE) { 112 - printk(KERN_ERR 113 - "Using mem= to increase the size of kernel memory " 114 - "is not allowed.\n" 115 - " Recompile the kernel with the correct value for " 116 - "CONFIG_MEMORY_SIZE.\n"); 117 - return 0; 118 - } 119 - 120 - memory_end = memory_start + size; 109 + pr_notice("Memory limited to %ldMB\n", memory_limit >> 20); 121 110 122 111 return 0; 123 112 } 124 113 early_param("mem", early_parse_mem); 125 114 126 - /* 127 - * Register fully available low RAM pages with the bootmem allocator. 128 - */ 129 - static void __init register_bootmem_low_pages(void) 130 - { 131 - unsigned long curr_pfn, last_pfn, pages; 132 - 133 - /* 134 - * We are rounding up the start address of usable memory: 135 - */ 136 - curr_pfn = PFN_UP(__MEMORY_START); 137 - 138 - /* 139 - * ... and at the end of the usable range downwards: 140 - */ 141 - last_pfn = PFN_DOWN(__pa(memory_end)); 142 - 143 - if (last_pfn > max_low_pfn) 144 - last_pfn = max_low_pfn; 145 - 146 - pages = last_pfn - curr_pfn; 147 - free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); 148 - } 149 - 150 - #ifdef CONFIG_KEXEC 151 - static void __init reserve_crashkernel(void) 152 - { 153 - unsigned long long free_mem; 154 - unsigned long long crash_size, crash_base; 155 - void *vp; 156 - int ret; 157 - 158 - free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; 159 - 160 - ret = parse_crashkernel(boot_command_line, free_mem, 161 - &crash_size, &crash_base); 162 - if (ret == 0 && crash_size) { 163 - if (crash_base <= 0) { 164 - vp = alloc_bootmem_nopanic(crash_size); 165 - if (!vp) { 166 - printk(KERN_INFO "crashkernel allocation " 167 - "failed\n"); 168 - return; 169 - } 170 - crash_base = __pa(vp); 171 - } else if (reserve_bootmem(crash_base, crash_size, 172 - BOOTMEM_EXCLUSIVE) < 0) { 173 - printk(KERN_INFO "crashkernel reservation failed - " 174 - "memory is in use\n"); 175 - return; 176 - } 177 - 178 - printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " 179 - "for crashkernel (System RAM: %ldMB)\n", 180 - (unsigned long)(crash_size >> 20), 181 - (unsigned long)(crash_base >> 20), 182 - (unsigned long)(free_mem >> 20)); 183 - crashk_res.start = crash_base; 184 - crashk_res.end = crash_base + crash_size - 1; 185 - insert_resource(&iomem_resource, &crashk_res); 186 - } 187 - } 188 - #else 189 - static inline void __init reserve_crashkernel(void) 190 - {} 191 - #endif 192 - 193 - static void __init check_for_initrd(void) 115 + void __init check_for_initrd(void) 194 116 { 195 117 #ifdef CONFIG_BLK_DEV_INITRD 196 118 unsigned long start, end; ··· 161 235 initrd_start = (unsigned long)__va(__pa(start)); 162 236 initrd_end = initrd_start + INITRD_SIZE; 163 237 164 - reserve_bootmem(__pa(initrd_start), INITRD_SIZE, BOOTMEM_DEFAULT); 238 + lmb_reserve(__pa(initrd_start), INITRD_SIZE); 165 239 166 240 return; 167 241 ··· 191 265 unsigned long end_pfn) 192 266 { 193 267 struct resource *res = &mem_resources[nid]; 268 + unsigned long start, end; 194 269 195 270 WARN_ON(res->name); /* max one active range per node for now */ 196 271 272 + start = start_pfn << PAGE_SHIFT; 273 + end = end_pfn << PAGE_SHIFT; 274 + 197 275 res->name = "System RAM"; 198 - res->start = start_pfn << PAGE_SHIFT; 199 - res->end = (end_pfn << PAGE_SHIFT) - 1; 276 + res->start = start; 277 + res->end = end - 1; 200 278 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; 279 + 201 280 if (request_resource(&iomem_resource, res)) { 202 281 pr_err("unable to request memory_resource 0x%lx 0x%lx\n", 203 282 start_pfn, end_pfn); ··· 218 287 request_resource(res, &data_resource); 219 288 request_resource(res, &bss_resource); 220 289 290 + /* 291 + * Also make sure that there is a PMB mapping that covers this 292 + * range before we attempt to activate it, to avoid reset by MMU. 293 + * We can hit this path with NUMA or memory hot-add. 294 + */ 295 + pmb_bolt_mapping((unsigned long)__va(start), start, end - start, 296 + PAGE_KERNEL); 297 + 221 298 add_active_range(nid, start_pfn, end_pfn); 222 299 } 223 300 224 - void __init setup_bootmem_allocator(unsigned long free_pfn) 225 - { 226 - unsigned long bootmap_size; 227 - unsigned long bootmap_pages, bootmem_paddr; 228 - u64 total_pages = (lmb_end_of_DRAM() - __MEMORY_START) >> PAGE_SHIFT; 229 - int i; 230 - 231 - bootmap_pages = bootmem_bootmap_pages(total_pages); 232 - 233 - bootmem_paddr = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); 234 - 235 - /* 236 - * Find a proper area for the bootmem bitmap. After this 237 - * bootstrap step all allocations (until the page allocator 238 - * is intact) must be done via bootmem_alloc(). 239 - */ 240 - bootmap_size = init_bootmem_node(NODE_DATA(0), 241 - bootmem_paddr >> PAGE_SHIFT, 242 - min_low_pfn, max_low_pfn); 243 - 244 - /* Add active regions with valid PFNs. */ 245 - for (i = 0; i < lmb.memory.cnt; i++) { 246 - unsigned long start_pfn, end_pfn; 247 - start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT; 248 - end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i); 249 - __add_active_range(0, start_pfn, end_pfn); 250 - } 251 - 252 - /* 253 - * Add all physical memory to the bootmem map and mark each 254 - * area as present. 255 - */ 256 - register_bootmem_low_pages(); 257 - 258 - /* Reserve the sections we're already using. */ 259 - for (i = 0; i < lmb.reserved.cnt; i++) 260 - reserve_bootmem(lmb.reserved.region[i].base, 261 - lmb_size_bytes(&lmb.reserved, i), 262 - BOOTMEM_DEFAULT); 263 - 264 - node_set_online(0); 265 - 266 - sparse_memory_present_with_active_regions(0); 267 - 268 - check_for_initrd(); 269 - 270 - reserve_crashkernel(); 271 - } 272 - 273 - #ifndef CONFIG_NEED_MULTIPLE_NODES 274 - static void __init setup_memory(void) 275 - { 276 - unsigned long start_pfn; 277 - u64 base = min_low_pfn << PAGE_SHIFT; 278 - u64 size = (max_low_pfn << PAGE_SHIFT) - base; 279 - 280 - /* 281 - * Partially used pages are not usable - thus 282 - * we are rounding upwards: 283 - */ 284 - start_pfn = PFN_UP(__pa(_end)); 285 - 286 - lmb_add(base, size); 287 - 288 - /* 289 - * Reserve the kernel text and 290 - * Reserve the bootmem bitmap. We do this in two steps (first step 291 - * was init_bootmem()), because this catches the (definitely buggy) 292 - * case of us accidentally initializing the bootmem allocator with 293 - * an invalid RAM area. 294 - */ 295 - lmb_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, 296 - (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - 297 - (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); 298 - 299 - /* 300 - * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. 301 - */ 302 - if (CONFIG_ZERO_PAGE_OFFSET != 0) 303 - lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); 304 - 305 - lmb_analyze(); 306 - lmb_dump_all(); 307 - 308 - setup_bootmem_allocator(start_pfn); 309 - } 310 - #else 311 - extern void __init setup_memory(void); 312 - #endif 313 - 314 - void __init __attribute__ ((weak)) plat_early_device_setup(void) 301 + void __init __weak plat_early_device_setup(void) 315 302 { 316 303 } 317 304 ··· 270 421 bss_resource.start = virt_to_phys(__bss_start); 271 422 bss_resource.end = virt_to_phys(_ebss)-1; 272 423 273 - memory_start = (unsigned long)__va(__MEMORY_START); 274 - if (!memory_end) 275 - memory_end = memory_start + __MEMORY_SIZE; 276 - 277 424 #ifdef CONFIG_CMDLINE_OVERWRITE 278 425 strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line)); 279 426 #else ··· 286 441 287 442 parse_early_param(); 288 443 289 - uncached_init(); 290 - 291 444 plat_early_device_setup(); 445 + 446 + sh_mv_setup(); 292 447 293 448 /* Let earlyprintk output early console messages */ 294 449 early_platform_driver_probe("earlyprintk", 1, 1); 295 450 296 - sh_mv_setup(); 297 - 298 - /* 299 - * Find the highest page frame number we have available 300 - */ 301 - max_pfn = PFN_DOWN(__pa(memory_end)); 302 - 303 - /* 304 - * Determine low and high memory ranges: 305 - */ 306 - max_low_pfn = max_pfn; 307 - min_low_pfn = __MEMORY_START >> PAGE_SHIFT; 308 - 309 - nodes_clear(node_online_map); 310 - 311 - pmb_init(); 312 - lmb_init(); 313 - setup_memory(); 314 - sparse_init(); 451 + paging_init(); 315 452 316 453 #ifdef CONFIG_DUMMY_CONSOLE 317 454 conswitchp = &dummy_con; 318 455 #endif 319 - paging_init(); 320 - 321 - ioremap_fixed_init(); 322 456 323 457 /* Perform the machine specific initialisation */ 324 458 if (likely(sh_mv.mv_setup))
+169 -4
arch/sh/mm/init.c
··· 2 2 * linux/arch/sh/mm/init.c 3 3 * 4 4 * Copyright (C) 1999 Niibe Yutaka 5 - * Copyright (C) 2002 - 2007 Paul Mundt 5 + * Copyright (C) 2002 - 2010 Paul Mundt 6 6 * 7 7 * Based on linux/arch/i386/mm/init.c: 8 8 * Copyright (C) 1995 Linus Torvalds ··· 16 16 #include <linux/pagemap.h> 17 17 #include <linux/percpu.h> 18 18 #include <linux/io.h> 19 + #include <linux/lmb.h> 20 + #include <linux/kexec.h> 19 21 #include <linux/dma-mapping.h> 20 22 #include <asm/mmu_context.h> 23 + #include <asm/mmzone.h> 21 24 #include <asm/tlb.h> 22 25 #include <asm/cacheflush.h> 23 26 #include <asm/sections.h> 27 + #include <asm/setup.h> 24 28 #include <asm/cache.h> 25 29 #include <asm/sizes.h> 26 30 27 31 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 28 32 pgd_t swapper_pg_dir[PTRS_PER_PGD]; 33 + 34 + void __init generic_mem_init(void) 35 + { 36 + lmb_add(__MEMORY_START, __MEMORY_SIZE); 37 + } 38 + 39 + void __init __weak plat_mem_setup(void) 40 + { 41 + /* Nothing to see here, move along. */ 42 + } 29 43 30 44 #ifdef CONFIG_MMU 31 45 static pte_t *__get_pte_phys(unsigned long addr) ··· 166 152 } 167 153 #endif /* CONFIG_MMU */ 168 154 169 - /* 170 - * paging_init() sets up the page tables 171 - */ 155 + void __init allocate_pgdat(unsigned int nid) 156 + { 157 + unsigned long start_pfn, end_pfn; 158 + #ifdef CONFIG_NEED_MULTIPLE_NODES 159 + unsigned long phys; 160 + #endif 161 + 162 + get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); 163 + 164 + #ifdef CONFIG_NEED_MULTIPLE_NODES 165 + phys = __lmb_alloc_base(sizeof(struct pglist_data), 166 + SMP_CACHE_BYTES, end_pfn << PAGE_SHIFT); 167 + /* Retry with all of system memory */ 168 + if (!phys) 169 + phys = __lmb_alloc_base(sizeof(struct pglist_data), 170 + SMP_CACHE_BYTES, lmb_end_of_DRAM()); 171 + if (!phys) 172 + panic("Can't allocate pgdat for node %d\n", nid); 173 + 174 + NODE_DATA(nid) = __va(phys); 175 + memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); 176 + 177 + NODE_DATA(nid)->bdata = &bootmem_node_data[nid]; 178 + #endif 179 + 180 + NODE_DATA(nid)->node_start_pfn = start_pfn; 181 + NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn; 182 + } 183 + 184 + static void __init bootmem_init_one_node(unsigned int nid) 185 + { 186 + unsigned long total_pages, paddr; 187 + unsigned long end_pfn; 188 + struct pglist_data *p; 189 + int i; 190 + 191 + p = NODE_DATA(nid); 192 + 193 + /* Nothing to do.. */ 194 + if (!p->node_spanned_pages) 195 + return; 196 + 197 + end_pfn = p->node_start_pfn + p->node_spanned_pages; 198 + 199 + total_pages = bootmem_bootmap_pages(p->node_spanned_pages); 200 + 201 + paddr = lmb_alloc(total_pages << PAGE_SHIFT, PAGE_SIZE); 202 + if (!paddr) 203 + panic("Can't allocate bootmap for nid[%d]\n", nid); 204 + 205 + init_bootmem_node(p, paddr >> PAGE_SHIFT, p->node_start_pfn, end_pfn); 206 + 207 + free_bootmem_with_active_regions(nid, end_pfn); 208 + 209 + /* 210 + * XXX Handle initial reservations for the system memory node 211 + * only for the moment, we'll refactor this later for handling 212 + * reservations in other nodes. 213 + */ 214 + if (nid == 0) { 215 + /* Reserve the sections we're already using. */ 216 + for (i = 0; i < lmb.reserved.cnt; i++) 217 + reserve_bootmem(lmb.reserved.region[i].base, 218 + lmb_size_bytes(&lmb.reserved, i), 219 + BOOTMEM_DEFAULT); 220 + } 221 + 222 + sparse_memory_present_with_active_regions(nid); 223 + } 224 + 225 + static void __init do_init_bootmem(void) 226 + { 227 + int i; 228 + 229 + /* Add active regions with valid PFNs. */ 230 + for (i = 0; i < lmb.memory.cnt; i++) { 231 + unsigned long start_pfn, end_pfn; 232 + start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT; 233 + end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i); 234 + __add_active_range(0, start_pfn, end_pfn); 235 + } 236 + 237 + /* All of system RAM sits in node 0 for the non-NUMA case */ 238 + allocate_pgdat(0); 239 + node_set_online(0); 240 + 241 + plat_mem_setup(); 242 + 243 + for_each_online_node(i) 244 + bootmem_init_one_node(i); 245 + 246 + sparse_init(); 247 + } 248 + 249 + static void __init early_reserve_mem(void) 250 + { 251 + unsigned long start_pfn; 252 + 253 + /* 254 + * Partially used pages are not usable - thus 255 + * we are rounding upwards: 256 + */ 257 + start_pfn = PFN_UP(__pa(_end)); 258 + 259 + /* 260 + * Reserve the kernel text and Reserve the bootmem bitmap. We do 261 + * this in two steps (first step was init_bootmem()), because 262 + * this catches the (definitely buggy) case of us accidentally 263 + * initializing the bootmem allocator with an invalid RAM area. 264 + */ 265 + lmb_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, 266 + (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - 267 + (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); 268 + 269 + /* 270 + * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. 271 + */ 272 + if (CONFIG_ZERO_PAGE_OFFSET != 0) 273 + lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); 274 + 275 + /* 276 + * Handle additional early reservations 277 + */ 278 + check_for_initrd(); 279 + reserve_crashkernel(); 280 + } 281 + 172 282 void __init paging_init(void) 173 283 { 174 284 unsigned long max_zone_pfns[MAX_NR_ZONES]; 175 285 unsigned long vaddr, end; 176 286 int nid; 287 + 288 + lmb_init(); 289 + 290 + sh_mv.mv_mem_init(); 291 + 292 + early_reserve_mem(); 293 + 294 + lmb_enforce_memory_limit(memory_limit); 295 + lmb_analyze(); 296 + 297 + lmb_dump_all(); 298 + 299 + /* 300 + * Determine low and high memory ranges: 301 + */ 302 + max_low_pfn = max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; 303 + min_low_pfn = __MEMORY_START >> PAGE_SHIFT; 304 + 305 + nodes_clear(node_online_map); 306 + 307 + memory_start = (unsigned long)__va(__MEMORY_START); 308 + memory_end = memory_start + (memory_limit ?: lmb_phys_mem_size()); 309 + 310 + uncached_init(); 311 + pmb_init(); 312 + do_init_bootmem(); 313 + ioremap_fixed_init(); 177 314 178 315 /* We don't need to map the kernel through the TLB, as 179 316 * it is permanatly mapped using P1. So clear the
+2
arch/sh/mm/pmb.c
··· 341 341 unsigned long flags, pmb_flags; 342 342 int i, mapped; 343 343 344 + if (size < SZ_16M) 345 + return -EINVAL; 344 346 if (!pmb_addr_valid(vaddr, size)) 345 347 return -EFAULT; 346 348 if (pmb_mapping_exists(vaddr, phys, size))