Exemplo n.º 1
0
__init void process_uboot_commandline(char *commandp, int size)
{
	int len, n;

	n = strnlen(commandp, size);
	commandp += n;
	len = size - n;
	if (len) {
		/* Add the whitespace separator */
		*commandp++ = ' ';
		len--;
	}

	parse_uboot_commandline(commandp, len);
	commandp[len - 1] = 0;
}
Exemplo n.º 2
0
void __init setup_arch(char **cmdline_p)
{
	int bootmap_size;

	memory_start = PAGE_ALIGN(_ramstart);
	memory_end = _ramend;

	init_mm.start_code = (unsigned long) &_stext;
	init_mm.end_code = (unsigned long) &_etext;
	init_mm.end_data = (unsigned long) &_edata;
	init_mm.brk = (unsigned long) 0;

	config_BSP(&command_line[0], sizeof(command_line));

#if defined(CONFIG_BOOTPARAM)
	strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
	command_line[sizeof(command_line) - 1] = 0;
#endif /* CONFIG_BOOTPARAM */

#if defined(CONFIG_UBOOT)
	/* CONFIG_UBOOT and CONFIG_BOOTPARAM defined, concatenate cmdline */
	#if defined(CONFIG_BOOTPARAM)
		/* Add the whitespace separator */
		command_line[strlen(CONFIG_BOOTPARAM_STRING)] = ' ';
		/* Parse uboot command line into the rest of the buffer */
		parse_uboot_commandline(
			&command_line[(strlen(CONFIG_BOOTPARAM_STRING)+1)],
			(sizeof(command_line) -
			(strlen(CONFIG_BOOTPARAM_STRING)+1)));
	/* Only CONFIG_UBOOT defined, create cmdline */
	#else
		parse_uboot_commandline(&command_line[0], sizeof(command_line));
	#endif /* CONFIG_BOOTPARAM */
	command_line[sizeof(command_line) - 1] = 0;
#endif /* CONFIG_UBOOT */

	printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU_NAME "\n");

#ifdef CONFIG_UCDIMM
	printk(KERN_INFO "uCdimm by Lineo, Inc. <www.lineo.com>\n");
#endif
#ifdef CONFIG_M68VZ328
	printk(KERN_INFO "M68VZ328 support by Evan Stawnyczy <*****@*****.**>\n");
#endif
#ifdef CONFIG_COLDFIRE
	printk(KERN_INFO "COLDFIRE port done by Greg Ungerer, [email protected]\n");
#ifdef CONFIG_M5307
	printk(KERN_INFO "Modified for M5307 by Dave Miller, [email protected]\n");
#endif
#ifdef CONFIG_ELITE
	printk(KERN_INFO "Modified for M5206eLITE by Rob Scott, [email protected]\n");
#endif
#endif
	printk(KERN_INFO "Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n");

#if defined( CONFIG_PILOT ) && defined( CONFIG_M68328 )
	printk(KERN_INFO "TRG SuperPilot FLASH card support <*****@*****.**>\n");
#endif
#if defined( CONFIG_PILOT ) && defined( CONFIG_M68EZ328 )
	printk(KERN_INFO "PalmV support by Lineo Inc. <*****@*****.**>\n");
#endif
#if defined (CONFIG_M68360)
	printk(KERN_INFO "QUICC port done by SED Systems <*****@*****.**>,\n");
	printk(KERN_INFO "based on 2.0.38 port by Lineo Inc. <*****@*****.**>.\n");
#endif
#ifdef CONFIG_DRAGEN2
	printk(KERN_INFO "DragonEngine II board support by Georges Menie\n");
#endif
#ifdef CONFIG_M5235EVB
	printk(KERN_INFO "Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n");
#endif

	pr_debug("KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x "
		 "BSS=0x%06x-0x%06x\n", (int) &_stext, (int) &_etext,
		 (int) &_sdata, (int) &_edata,
		 (int) &_sbss, (int) &_ebss);
	pr_debug("MEMORY -> ROMFS=0x%06x-0x%06x MEM=0x%06x-0x%06x\n ",
		 (int) &_ebss, (int) memory_start,
		 (int) memory_start, (int) memory_end);

	/* Keep a copy of command line */
	*cmdline_p = &command_line[0];
	memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
	boot_command_line[COMMAND_LINE_SIZE-1] = 0;

#if defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_DUMMY_CONSOLE)
	conswitchp = &dummy_con;
#endif

	/*
	 * Give all the memory to the bootmap allocator, tell it to put the
	 * boot mem_map at the start of memory.
	 */
	bootmap_size = init_bootmem_node(
			NODE_DATA(0),
			memory_start >> PAGE_SHIFT, /* map goes here */
			PAGE_OFFSET >> PAGE_SHIFT,	/* 0 on coldfire */
			memory_end >> PAGE_SHIFT);
	/*
	 * Free the usable memory, we have to make sure we do not free
	 * the bootmem bitmap so we then reserve it after freeing it :-)
	 */
	free_bootmem(memory_start, memory_end - memory_start);
	reserve_bootmem(memory_start, bootmap_size, BOOTMEM_DEFAULT);

#if defined(CONFIG_UBOOT) && defined(CONFIG_BLK_DEV_INITRD)
	if ((initrd_start > 0) && (initrd_start < initrd_end) &&
			(initrd_end < memory_end))
		reserve_bootmem(initrd_start, initrd_end - initrd_start,
				 BOOTMEM_DEFAULT);
#endif /* if defined(CONFIG_BLK_DEV_INITRD) */

	/*
	 * Get kmalloc into gear.
	 */
	paging_init();
}