void __init setup_arch(char **cmdline_p) { /* This also populates @boot_command_line from /bootargs */ machine_desc = setup_machine_fdt(__dtb_start); if (!machine_desc) panic("Embedded DT invalid\n"); /* Append any u-boot provided cmdline */ #ifdef CONFIG_CMDLINE_UBOOT /* Add a whitespace seperator between the 2 cmdlines */ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); strlcat(boot_command_line, command_line, COMMAND_LINE_SIZE); #endif /* Save unparsed command line copy for /proc/cmdline */ *cmdline_p = boot_command_line; /* To force early parsing of things like mem=xxx */ parse_early_param(); /* Platform/board specific: e.g. early console registration */ if (machine_desc->init_early) machine_desc->init_early(); setup_processor(); #ifdef CONFIG_SMP smp_init_cpus(); #endif setup_arch_memory(); /* copy flat DT out of .init and then unflatten it */ copy_devtree(); unflatten_device_tree(); /* Can be issue if someone passes cmd line arg "ro" * But that is unlikely so keeping it as it is */ root_mountflags &= ~MS_RDONLY; console_verbose(); #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; #endif arc_unwind_init(); arc_unwind_setup(); }
void __init setup_arch(char **cmdline_p) { strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; check_s32c1i(); /* Reserve some memory regions */ #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start < initrd_end) { initrd_is_mapped = mem_reserve(__pa(initrd_start), __pa(initrd_end), 0); initrd_below_start_ok = 1; } else { initrd_start = 0; } #endif mem_reserve(__pa(&_stext),__pa(&_end), 1); mem_reserve(__pa(&_WindowVectors_text_start), __pa(&_WindowVectors_text_end), 0); mem_reserve(__pa(&_DebugInterruptVector_literal_start), __pa(&_DebugInterruptVector_text_end), 0); mem_reserve(__pa(&_KernelExceptionVector_literal_start), __pa(&_KernelExceptionVector_text_end), 0); mem_reserve(__pa(&_UserExceptionVector_literal_start), __pa(&_UserExceptionVector_text_end), 0); mem_reserve(__pa(&_DoubleExceptionVector_literal_start), __pa(&_DoubleExceptionVector_text_end), 0); #if XCHAL_EXCM_LEVEL >= 2 mem_reserve(__pa(&_Level2InterruptVector_text_start), __pa(&_Level2InterruptVector_text_end), 0); #endif #if XCHAL_EXCM_LEVEL >= 3 mem_reserve(__pa(&_Level3InterruptVector_text_start), __pa(&_Level3InterruptVector_text_end), 0); #endif #if XCHAL_EXCM_LEVEL >= 4 mem_reserve(__pa(&_Level4InterruptVector_text_start), __pa(&_Level4InterruptVector_text_end), 0); #endif #if XCHAL_EXCM_LEVEL >= 5 mem_reserve(__pa(&_Level5InterruptVector_text_start), __pa(&_Level5InterruptVector_text_end), 0); #endif #if XCHAL_EXCM_LEVEL >= 6 mem_reserve(__pa(&_Level6InterruptVector_text_start), __pa(&_Level6InterruptVector_text_end), 0); #endif bootmem_init(); #ifdef CONFIG_OF copy_devtree(); unflatten_device_tree(); #endif platform_setup(cmdline_p); paging_init(); zones_init(); #ifdef CONFIG_VT # if defined(CONFIG_VGA_CONSOLE) conswitchp = &vga_con; # elif defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; # endif #endif #ifdef CONFIG_PCI platform_pcibios_init(); #endif }