static int __init setup_serial_console(struct pcdp_uart *uart) { #ifdef CONFIG_SERIAL_8250_CONSOLE int mmio; static char options[64], *p = options; char parity; mmio = (uart->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY); p += sprintf(p, "uart8250,%s,0x%llx", mmio ? "mmio" : "io", uart->addr.address); if (uart->baud) { p += sprintf(p, ",%llu", uart->baud); if (uart->bits) { switch (uart->parity) { case 0x2: parity = 'e'; break; case 0x3: parity = 'o'; break; default: parity = 'n'; } p += sprintf(p, "%c%d", parity, uart->bits); } } add_preferred_console("uart", 8250, &options[9]); return setup_early_serial8250_console(options); #else return -ENODEV; #endif }
void __init setup_arch(char **cmdline_p) { unsigned long max_low_pfn; config_BSP(&command_line[0], COMMAND_LINE_SIZE); /* detect System on Chip parameters */ detect_soc(); /* process 1's initial memory region is the kernel code/data */ 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) &_end; #ifdef CONFIG_BLK_DEV_INITRD initrd_start = (unsigned long)&__initrd_start; initrd_end = (unsigned long)&__initrd_end; #endif /* setup bootmem allocator */ max_low_pfn = setup_memory(); /* paging_init() sets up the MMU and marks all pages as reserved */ paging_init(); #ifdef CONFIG_SERIAL_8250_CONSOLE // early_serial_console_init(command_line); RGD setup_early_serial8250_console(command_line); #endif #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE) if(!conswitchp) conswitchp = &dummy_con; #endif *cmdline_p = command_line; /* Save command line copy for /proc/cmdline RGD removed 2.6.21*/ //memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); //saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; /* fire up 8051 */ // printk("Starting 8051...\n"); // oc8051_init(); #ifndef CONFIG_OR32_ANONYMOUS printk("Linux/or32 port 2003-2005 OpenCores <*****@*****.**>\n"); #endif /* CONFIG_OR32_ANONYMOUS */ }
static void __init console_config(void) { char console_string[40]; int baud = 0; char parity = '\0', bits = '\0', flow = '\0'; char *s; s = fw_getenv("modetty0"); if (s) { while (*s >= '0' && *s <= '9') baud = baud*10 + *s++ - '0'; if (*s == ',') s++; if (*s) parity = *s++; if (*s == ',') s++; if (*s) bits = *s++; if (*s == ',') s++; if (*s == 'h') flow = 'r'; } if (baud == 0) baud = 38400; if (parity != 'n' && parity != 'o' && parity != 'e') parity = 'n'; if (bits != '7' && bits != '8') bits = '8'; if (flow == '\0') flow = 'r'; if ((strstr(fw_getcmdline(), "earlycon=")) == NULL) { sprintf(console_string, "uart8250,io,0x3f8,%d%c%c", baud, parity, bits); setup_early_serial8250_console(console_string); } if ((strstr(fw_getcmdline(), "console=")) == NULL) { sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); strcat(fw_getcmdline(), console_string); pr_info("Config serial console:%s\n", console_string); } }