setup.c (cea0bb1bc59b94625e60b69aaa9ad6749d5b57dd) | setup.c (be370302742ff9948f2a42b15cb2ba174d97b930) |
---|---|
1/* 2 * linux/arch/arm/kernel/setup.c 3 * 4 * Copyright (C) 1995-2001 Russell King 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. --- 5 unchanged lines hidden (view full) --- 14#include <linux/delay.h> 15#include <linux/utsname.h> 16#include <linux/initrd.h> 17#include <linux/console.h> 18#include <linux/bootmem.h> 19#include <linux/seq_file.h> 20#include <linux/screen_info.h> 21#include <linux/init.h> | 1/* 2 * linux/arch/arm/kernel/setup.c 3 * 4 * Copyright (C) 1995-2001 Russell King 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. --- 5 unchanged lines hidden (view full) --- 14#include <linux/delay.h> 15#include <linux/utsname.h> 16#include <linux/initrd.h> 17#include <linux/console.h> 18#include <linux/bootmem.h> 19#include <linux/seq_file.h> 20#include <linux/screen_info.h> 21#include <linux/init.h> |
22#include <linux/kexec.h> 23#include <linux/crash_dump.h> | |
24#include <linux/root_dev.h> 25#include <linux/cpu.h> 26#include <linux/interrupt.h> 27#include <linux/smp.h> 28#include <linux/fs.h> 29#include <linux/proc_fs.h> 30 31#include <asm/unified.h> --- 234 unchanged lines hidden (view full) --- 266 267/* 268 * These functions re-use the assembly code in head.S, which 269 * already provide the required functionality. 270 */ 271extern struct proc_info_list *lookup_processor_type(unsigned int); 272extern struct machine_desc *lookup_machine_type(unsigned int); 273 | 22#include <linux/root_dev.h> 23#include <linux/cpu.h> 24#include <linux/interrupt.h> 25#include <linux/smp.h> 26#include <linux/fs.h> 27#include <linux/proc_fs.h> 28 29#include <asm/unified.h> --- 234 unchanged lines hidden (view full) --- 264 265/* 266 * These functions re-use the assembly code in head.S, which 267 * already provide the required functionality. 268 */ 269extern struct proc_info_list *lookup_processor_type(unsigned int); 270extern struct machine_desc *lookup_machine_type(unsigned int); 271 |
274static void __init feat_v6_fixup(void) 275{ 276 int id = read_cpuid_id(); 277 278 if ((id & 0xff0f0000) != 0x41070000) 279 return; 280 281 /* 282 * HWCAP_TLS is available only on 1136 r1p0 and later, 283 * see also kuser_get_tls_init. 284 */ 285 if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0)) 286 elf_hwcap &= ~HWCAP_TLS; 287} 288 | |
289static void __init setup_processor(void) 290{ 291 struct proc_info_list *list; 292 293 /* 294 * locate processor in the list of supported processor 295 * types. The linker builds this table for us from the 296 * entries in arch/arm/mm/proc-*.S --- 26 unchanged lines hidden (view full) --- 323 324 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS); 325 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); 326 elf_hwcap = list->elf_hwcap; 327#ifndef CONFIG_ARM_THUMB 328 elf_hwcap &= ~HWCAP_THUMB; 329#endif 330 | 272static void __init setup_processor(void) 273{ 274 struct proc_info_list *list; 275 276 /* 277 * locate processor in the list of supported processor 278 * types. The linker builds this table for us from the 279 * entries in arch/arm/mm/proc-*.S --- 26 unchanged lines hidden (view full) --- 306 307 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS); 308 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); 309 elf_hwcap = list->elf_hwcap; 310#ifndef CONFIG_ARM_THUMB 311 elf_hwcap &= ~HWCAP_THUMB; 312#endif 313 |
331 feat_v6_fixup(); 332 | |
333 cacheid_init(); 334 cpu_proc_init(); 335} 336 337/* 338 * cpu_init - initialise one CPU. 339 * 340 * cpu_init sets up the per-CPU stacks. --- 75 unchanged lines hidden (view full) --- 416 417 /* 418 * Ensure that start/size are aligned to a page boundary. 419 * Size is appropriately rounded down, start is rounded up. 420 */ 421 size -= start & ~PAGE_MASK; 422 bank->start = PAGE_ALIGN(start); 423 bank->size = size & PAGE_MASK; | 314 cacheid_init(); 315 cpu_proc_init(); 316} 317 318/* 319 * cpu_init - initialise one CPU. 320 * 321 * cpu_init sets up the per-CPU stacks. --- 75 unchanged lines hidden (view full) --- 397 398 /* 399 * Ensure that start/size are aligned to a page boundary. 400 * Size is appropriately rounded down, start is rounded up. 401 */ 402 size -= start & ~PAGE_MASK; 403 bank->start = PAGE_ALIGN(start); 404 bank->size = size & PAGE_MASK; |
424 bank->node = PHYS_TO_NID(start); | |
425 426 /* 427 * Check whether this memory region has non-zero size or 428 * invalid node number. 429 */ | 405 406 /* 407 * Check whether this memory region has non-zero size or 408 * invalid node number. 409 */ |
430 if (bank->size == 0 || bank->node >= MAX_NUMNODES) | 410 if (bank->size == 0) |
431 return -EINVAL; 432 433 meminfo.nr_banks++; 434 return 0; 435} 436 437/* 438 * Pick out the memory size. We look for mem=size@start, --- 238 unchanged lines hidden (view full) --- 677{ 678 /* customizes platform devices, or adds new ones */ 679 if (init_machine) 680 init_machine(); 681 return 0; 682} 683arch_initcall(customize_machine); 684 | 411 return -EINVAL; 412 413 meminfo.nr_banks++; 414 return 0; 415} 416 417/* 418 * Pick out the memory size. We look for mem=size@start, --- 238 unchanged lines hidden (view full) --- 657{ 658 /* customizes platform devices, or adds new ones */ 659 if (init_machine) 660 init_machine(); 661 return 0; 662} 663arch_initcall(customize_machine); 664 |
685#ifdef CONFIG_KEXEC 686static inline unsigned long long get_total_mem(void) 687{ 688 unsigned long total; 689 690 total = max_low_pfn - min_low_pfn; 691 return total << PAGE_SHIFT; 692} 693 694/** 695 * reserve_crashkernel() - reserves memory are for crash kernel 696 * 697 * This function reserves memory area given in "crashkernel=" kernel command 698 * line parameter. The memory reserved is used by a dump capture kernel when 699 * primary kernel is crashing. 700 */ 701static void __init reserve_crashkernel(void) 702{ 703 unsigned long long crash_size, crash_base; 704 unsigned long long total_mem; 705 int ret; 706 707 total_mem = get_total_mem(); 708 ret = parse_crashkernel(boot_command_line, total_mem, 709 &crash_size, &crash_base); 710 if (ret) 711 return; 712 713 ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); 714 if (ret < 0) { 715 printk(KERN_WARNING "crashkernel reservation failed - " 716 "memory is in use (0x%lx)\n", (unsigned long)crash_base); 717 return; 718 } 719 720 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " 721 "for crashkernel (System RAM: %ldMB)\n", 722 (unsigned long)(crash_size >> 20), 723 (unsigned long)(crash_base >> 20), 724 (unsigned long)(total_mem >> 20)); 725 726 crashk_res.start = crash_base; 727 crashk_res.end = crash_base + crash_size - 1; 728 insert_resource(&iomem_resource, &crashk_res); 729} 730#else 731static inline void reserve_crashkernel(void) {} 732#endif /* CONFIG_KEXEC */ 733 734/* 735 * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by 736 * is_kdump_kernel() to determine if we are booting after a panic. Hence 737 * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. 738 */ 739 740#ifdef CONFIG_CRASH_DUMP 741/* 742 * elfcorehdr= specifies the location of elf core header stored by the crashed 743 * kernel. This option will be passed by kexec loader to the capture kernel. 744 */ 745static int __init setup_elfcorehdr(char *arg) 746{ 747 char *end; 748 749 if (!arg) 750 return -EINVAL; 751 752 elfcorehdr_addr = memparse(arg, &end); 753 return end > arg ? 0 : -EINVAL; 754} 755early_param("elfcorehdr", setup_elfcorehdr); 756#endif /* CONFIG_CRASH_DUMP */ 757 | |
758void __init setup_arch(char **cmdline_p) 759{ 760 struct tag *tags = (struct tag *)&init_tags; 761 struct machine_desc *mdesc; 762 char *from = default_command_line; 763 764 unwind_init(); 765 --- 43 unchanged lines hidden (view full) --- 809 parse_early_param(); 810 811 paging_init(mdesc); 812 request_standard_resources(&meminfo, mdesc); 813 814#ifdef CONFIG_SMP 815 smp_init_cpus(); 816#endif | 665void __init setup_arch(char **cmdline_p) 666{ 667 struct tag *tags = (struct tag *)&init_tags; 668 struct machine_desc *mdesc; 669 char *from = default_command_line; 670 671 unwind_init(); 672 --- 43 unchanged lines hidden (view full) --- 716 parse_early_param(); 717 718 paging_init(mdesc); 719 request_standard_resources(&meminfo, mdesc); 720 721#ifdef CONFIG_SMP 722 smp_init_cpus(); 723#endif |
817 reserve_crashkernel(); | |
818 819 cpu_init(); 820 tcm_init(); 821 822 /* 823 * Set up various architecture-specific pointers 824 */ | 724 725 cpu_init(); 726 tcm_init(); 727 728 /* 729 * Set up various architecture-specific pointers 730 */ |
825 arch_nr_irqs = mdesc->nr_irqs; | |
826 init_arch_irq = mdesc->init_irq; 827 system_timer = mdesc->timer; 828 init_machine = mdesc->init_machine; 829 830#ifdef CONFIG_VT 831#if defined(CONFIG_VGA_CONSOLE) 832 conswitchp = &vga_con; 833#elif defined(CONFIG_DUMMY_CONSOLE) --- 137 unchanged lines hidden --- | 731 init_arch_irq = mdesc->init_irq; 732 system_timer = mdesc->timer; 733 init_machine = mdesc->init_machine; 734 735#ifdef CONFIG_VT 736#if defined(CONFIG_VGA_CONSOLE) 737 conswitchp = &vga_con; 738#elif defined(CONFIG_DUMMY_CONSOLE) --- 137 unchanged lines hidden --- |