Esempio n. 1
0
void __init setup_arch(char **cmdline_p)
{
	cpu_probe();
	prom_init();

#ifdef CONFIG_EARLY_PRINTK
	{
		extern void setup_early_printk(void);

		setup_early_printk();
	}
#endif
	cpu_report();

#if defined(CONFIG_VT)
#if defined(CONFIG_VGA_CONSOLE)
	conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
	conswitchp = &dummy_con;
#endif
#endif

	arch_mem_init(cmdline_p);

	resource_init();
#ifdef CONFIG_SMP
	plat_smp_setup();
#endif
}
Esempio n. 2
0
void __init x86_64_start_kernel(char * real_mode_data)
{
	char *s;

	clear_bss();
	pda_init(0);
	copy_bootdata(real_mode_data);
#ifdef CONFIG_SMP
	cpu_set(0, cpu_online_map);
#endif
	/* default console: */
	if (!strstr(saved_command_line, "console="))
		strcat(saved_command_line, " console=tty0"); 
	s = strstr(saved_command_line, "earlyprintk=");
	if (s != NULL)
		setup_early_printk(s);
#ifdef CONFIG_DISCONTIGMEM
	s = strstr(saved_command_line, "numa=");
	if (s != NULL)
		numa_setup(s+5);
#endif
#ifdef CONFIG_X86_IO_APIC
	if (strstr(saved_command_line, "disableapic"))
		disable_apic = 1;
#endif
	/* You need early console to see that */
	if (__pa_symbol(&_end) >= KERNEL_TEXT_SIZE)
		panic("Kernel too big for kernel mapping\n");

	setup_boot_cpu_data();
	start_kernel();
}
Esempio n. 3
0
void __init x86_64_start_kernel(char * real_mode_data)
{
	char *s;

	clear_bss();
	pda_init(0);
	copy_bootdata(real_mode_data);
	/* default console: */
	if (!strstr(saved_command_line, "console="))
		strcat(saved_command_line, " console=tty0"); 
	s = strstr(saved_command_line, "earlyprintk="); 
	if (s != NULL)
		setup_early_printk(s+12); 
#ifdef CONFIG_DISCONTIGMEM
	s = strstr(saved_command_line, "numa=");
	if (s != NULL)
		numa_setup(s+5);
#endif
#ifdef CONFIG_X86_IO_APIC
	if (strstr(saved_command_line, "disableapic"))
		disable_apic = 1;
#endif
	setup_boot_cpu_data();
	start_kernel();
}
Esempio n. 4
0
void __init setup_arch(char **cmdline_p)
{
	/*
	 * init "current thread structure" pointer
	 */
	lm32_current_thread = (struct thread_info*)&init_thread_union;

	strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
	*cmdline_p = cmd_line;

#ifdef CONFIG_DUMMY_CONSOLE
	conswitchp = &dummy_con;
#endif

#ifdef CONFIG_EARLY_PRINTK
	setup_early_printk();
#endif

	/*
	 * Init boot memory
	 */
	bootmem_init();
	device_tree_init();

	/*
	 * Get kmalloc into gear.
	 */
	paging_init();
}
Esempio n. 5
0
void __init setup_arch(char **cmdline_p)
{
	/* the variable later on will be used in macros as well */
	is_nlm_xlp2xx_compat = is_nlm_xlp2xx();

	cpu_probe();
	prom_init();
#ifdef CONFIG_EARLY_PRINTK
	setup_early_printk();
#endif
	cpu_report();
	check_bugs_early();

#if defined(CONFIG_VT)
#if defined(CONFIG_VGA_CONSOLE)
	conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
	conswitchp = &dummy_con;
#endif
#endif

	arch_mem_init(cmdline_p);

	resource_init();
	plat_smp_setup();
}
Esempio n. 6
0
void __init machine_early_init(const char *cmdline, unsigned int ram,
		unsigned int fdt)
{
	unsigned long *src, *dst = (unsigned long *)0x0;

/* clearing bss section */
	memset(__bss_start, 0, __bss_stop-__bss_start);
	memset(_ssbss, 0, _esbss-_ssbss);

	/*
	 * Copy command line passed from bootloader, or use default
	 * if none provided, or forced
	 */
#ifndef CONFIG_CMDLINE_BOOL
	if (cmdline && cmdline[0] != '\0')
		strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
#endif

/* initialize device tree for usage in early_printk */
	early_init_devtree((void *)_fdt_start);

#ifdef CONFIG_EARLY_PRINTK
	setup_early_printk(NULL);
#endif

	early_printk("Ramdisk addr 0x%08x, FDT 0x%08x\n", ram, fdt);
	printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt);

#ifdef CONFIG_MTD_UCLINUX
	{
		int size;
		unsigned int romfs_base;
		romfs_base = (ram ? ram : (unsigned int)&__init_end);
		/* if CONFIG_MTD_UCLINUX_EBSS is defined, assume ROMFS is at the
		 * end of kernel, which is ROMFS_LOCATION defined above. */
		size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
		early_printk("Found romfs @ 0x%08x (0x%08x)\n",
				romfs_base, size);
		early_printk("#### klimit %p ####\n", klimit);
		BUG_ON(size < 0); /* What else can we do? */

		/* Use memmove to handle likely case of memory overlap */
		early_printk("Moving 0x%08x bytes from 0x%08x to 0x%08x\n",
			size, romfs_base, (unsigned)&_ebss);
		memmove(&_ebss, (int *)romfs_base, size);

		/* update klimit */
		klimit += PAGE_ALIGN(size);
		early_printk("New klimit: 0x%08x\n", (unsigned)klimit);
	}
#endif

	for (src = __ivt_start; src < __ivt_end; src++, dst++)
		*dst = *src;

	/* Initialize global data */
	per_cpu(KM, 0) = 0x1;	/* We start in kernel mode */
	per_cpu(CURRENT_SAVE, 0) = (unsigned long)current;
}
Esempio n. 7
0
void __init setup_arch(char **cmdline_p)
{
	/*
	 * init "current thread structure" pointer
	 */
	lm32_current_thread = (struct thread_info*)&init_thread_union;

	cpu_frequency = (unsigned long)CONFIG_CPU_CLOCK;
	sdram_start = (unsigned long)CONFIG_MEMORY_START;
	sdram_size = (unsigned long)CONFIG_MEMORY_SIZE;

	/* Keep a copy of command line */
	*cmdline_p = (char*)_kernel_arg_cmdline;


#if defined(CONFIG_BOOTPARAM)
	/* CONFIG_CMDLINE should override all */
	strncpy(*cmdline_p, CONFIG_BOOTPARAM_STRING, COMMAND_LINE_SIZE);
#endif

	memcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE);
	boot_command_line[COMMAND_LINE_SIZE-1] = 0;

#ifdef CONFIG_DUMMY_CONSOLE
        conswitchp = &dummy_con;
#endif

#ifdef CONFIG_EARLY_PRINTK
	{
		extern void setup_early_printk(void);

		setup_early_printk();
	}
#endif

	/*
	 * Init boot memory
	 */
	bootmem_init();

	/*
	 * Get kmalloc into gear.
	 */
	paging_init();
}
Esempio n. 8
0
void __init x86_64_start_kernel(char * real_mode_data)
{
    char *s;

    clear_bss(); /* must be the first thing in C and must not depend on .bss to be zero */
    pda_init(0);
    copy_bootdata(real_mode_data);
    s = strstr(saved_command_line, "earlyprintk=");
    if (s != NULL)
        setup_early_printk(s+12);
#ifdef CONFIG_DISCONTIGMEM
    extern int numa_setup(char *);
    s = strstr(saved_command_line, "numa=");
    if (s != NULL)
        numa_setup(s+5);
#endif
    early_printk("booting x86_64 kernel... ");
    setup_boot_cpu_data();
    start_kernel();
}
Esempio n. 9
0
void __init machine_early_init(const char *cmdline, unsigned int ram,
                               unsigned int fdt, unsigned int msr)
{
    unsigned long *src, *dst;
    unsigned int offset = 0;

    /* If CONFIG_MTD_UCLINUX is defined, assume ROMFS is at the
     * end of kernel. There are two position which we want to check.
     * The first is __init_end and the second __bss_start.
     */
#ifdef CONFIG_MTD_UCLINUX
    int romfs_size;
    unsigned int romfs_base;
    char *old_klimit = klimit;

    romfs_base = (ram ? ram : (unsigned int)&__init_end);
    romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
    if (!romfs_size) {
        romfs_base = (unsigned int)&__bss_start;
        romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
    }

    /* Move ROMFS out of BSS before clearing it */
    if (romfs_size > 0) {
        memmove(&_ebss, (int *)romfs_base, romfs_size);
        klimit += romfs_size;
    }
#endif

    /* clearing bss section */
    memset(__bss_start, 0, __bss_stop-__bss_start);
    memset(_ssbss, 0, _esbss-_ssbss);

    /* Copy command line passed from bootloader */
#ifndef CONFIG_CMDLINE_BOOL
    if (cmdline && cmdline[0] != '\0')
        strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
#endif

    lockdep_init();

    /* initialize device tree for usage in early_printk */
    early_init_devtree((void *)_fdt_start);

#ifdef CONFIG_EARLY_PRINTK
    setup_early_printk(NULL);
#endif

    eprintk("Ramdisk addr 0x%08x, ", ram);
    if (fdt)
        eprintk("FDT at 0x%08x\n", fdt);
    else
        eprintk("Compiled-in FDT at 0x%08x\n",
                (unsigned int)_fdt_start);

#ifdef CONFIG_MTD_UCLINUX
    eprintk("Found romfs @ 0x%08x (0x%08x)\n",
            romfs_base, romfs_size);
    eprintk("#### klimit %p ####\n", old_klimit);
    BUG_ON(romfs_size < 0); /* What else can we do? */

    eprintk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n",
            romfs_size, romfs_base, (unsigned)&_ebss);

    eprintk("New klimit: 0x%08x\n", (unsigned)klimit);
#endif

#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
    if (msr)
        eprintk("!!!Your kernel has setup MSR instruction but "
                "CPU don't have it %x\n", msr);
#else
    if (!msr)
        eprintk("!!!Your kernel not setup MSR instruction but "
                "CPU have it %x\n", msr);
#endif

    /* Do not copy reset vectors. offset = 0x2 means skip the first
     * two instructions. dst is pointer to MB vectors which are placed
     * in block ram. If you want to copy reset vector setup offset to 0x0 */
#if !CONFIG_MANUAL_RESET_VECTOR
    offset = 0x2;
#endif
    dst = (unsigned long *) (offset * sizeof(u32));
    for (src = __ivt_start + offset; src < __ivt_end; src++, dst++)
        *dst = *src;

    /* Initialize global data */
    per_cpu(KM, 0) = 0x1;	/* We start in kernel mode */
    per_cpu(CURRENT_SAVE, 0) = (unsigned long)current;
}
Esempio n. 10
0
void __init machine_early_init(const char *cmdline, unsigned int ram,
		unsigned int fdt, unsigned int msr, unsigned int tlb0,
		unsigned int tlb1)
{
	unsigned long *src, *dst;
	unsigned int offset = 0;

	/*                                                         
                                                                 
                                                       
  */
#ifdef CONFIG_MTD_UCLINUX
	int romfs_size;
	unsigned int romfs_base;
	char *old_klimit = klimit;

	romfs_base = (ram ? ram : (unsigned int)&__init_end);
	romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
	if (!romfs_size) {
		romfs_base = (unsigned int)&__bss_start;
		romfs_size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
	}

	/*                                          */
	if (romfs_size > 0) {
		memmove(&_ebss, (int *)romfs_base, romfs_size);
		klimit += romfs_size;
	}
#endif

/*                      */
	memset(__bss_start, 0, __bss_stop-__bss_start);
	memset(_ssbss, 0, _esbss-_ssbss);

	/*                                          */
#ifndef CONFIG_CMDLINE_BOOL
	if (cmdline && cmdline[0] != '\0')
		strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
#endif

	lockdep_init();

/*                                                  */
	early_init_devtree((void *)_fdt_start);

#ifdef CONFIG_EARLY_PRINTK
	setup_early_printk(NULL);
#endif

	/*                                    
                                    */
	kernel_tlb = tlb0 + tlb1;
	/*                                                     
                          */

	printk("Ramdisk addr 0x%08x, ", ram);
	if (fdt)
		printk("FDT at 0x%08x\n", fdt);
	else
		printk("Compiled-in FDT at 0x%08x\n",
					(unsigned int)_fdt_start);

#ifdef CONFIG_MTD_UCLINUX
	printk("Found romfs @ 0x%08x (0x%08x)\n",
			romfs_base, romfs_size);
	printk("#### klimit %p ####\n", old_klimit);
	BUG_ON(romfs_size < 0); /*                      */

	printk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n",
			romfs_size, romfs_base, (unsigned)&_ebss);

	printk("New klimit: 0x%08x\n", (unsigned)klimit);
#endif

#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
	if (msr)
		printk("!!!Your kernel has setup MSR instruction but "
				"CPU don't have it %x\n", msr);
#else
	if (!msr)
		printk("!!!Your kernel not setup MSR instruction but "
				"CPU have it %x\n", msr);
#endif

	/*                                                             
                                                                   
                                                                       */
#if !CONFIG_MANUAL_RESET_VECTOR
	offset = 0x2;
#endif
	dst = (unsigned long *) (offset * sizeof(u32));
	for (src = __ivt_start + offset; src < __ivt_end; src++, dst++)
		*dst = *src;

	/*                        */
	per_cpu(KM, 0) = 0x1;	/*                         */
	per_cpu(CURRENT_SAVE, 0) = (unsigned long)current;
}