static int __init mxc_early_uart_setup(struct console *console, char *options) { struct mxc_early_uart_device *device = &mxc_early_device; struct uart_port *port = &device->port; int length; if (device->port.membase || device->port.iobase) return -ENODEV; /* Enable Early MXC UART Clock */ clk_enable(device->clk); port->uartclk = 5600000; port->iotype = UPIO_MEM; port->membase = ioremap(port->mapbase, SZ_4K); if (options) { device->baud = simple_strtoul(options, NULL, 0); length = min(strlen(options), sizeof(device->options)); strncpy(device->options, options, length); } else { device->baud = probe_baud(port); snprintf(device->options, sizeof(device->options), "%u", device->baud); } printk(KERN_INFO "MXC_Early serial console at MMIO 0x%x (options '%s')\n", port->mapbase, device->options); return 0; }
static int __init parse_options(struct mxc_early_uart_device *device, char *options) { struct uart_port *port = &device->port; int mapsize = 64; int length; if (!options) return -ENODEV; port->uartclk = 5600000; port->iotype = UPIO_MEM; port->mapbase = simple_strtoul(options, &options, 0); port->membase = ioremap(port->mapbase, mapsize); if ((options = strchr(options, ','))) { options++; device->baud = simple_strtoul(options, NULL, 0); length = min(strcspn(options, " "), sizeof(device->options)); strncpy(device->options, options, length); } else { device->baud = probe_baud(port); snprintf(device->options, sizeof(device->options), "%u", device->baud); } printk(KERN_INFO "MXC_Early serial console at MMIO 0x%lx (options '%s')\n", port->mapbase, device->options); return 0; }
static void parse_console_uart8250(void) { char optstr[64], *options; int baud = DEFAULT_BAUD; int port = 0; /* * console=uart8250,io,0x3f8,115200n8 * need to make sure it is last one console ! */ if (cmdline_find_option("console", optstr, sizeof optstr) <= 0) return; options = optstr; if (!strncmp(options, "uart8250,io,", 12)) port = simple_strtoull(options + 12, &options, 0); else if (!strncmp(options, "uart,io,", 8)) port = simple_strtoull(options + 8, &options, 0); else return; if (options && (options[0] == ',')) baud = simple_strtoull(options + 1, &options, 0); else baud = probe_baud(port); if (port) early_serial_init(port, baud); }
static int __init parse_options(struct early_serial8250_device *device, char *options) { struct uart_port *port = &device->port; int mmio, length; if (!options) return -ENODEV; port->uartclk = BASE_BAUD * 16; if (!strncmp(options, "mmio,", 5)) { port->iotype = UPIO_MEM; port->mapbase = simple_strtoul(options + 5, &options, 0); #ifdef CONFIG_FIX_EARLYCON_MEM set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, port->mapbase & PAGE_MASK); port->membase = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); port->membase += port->mapbase & ~PAGE_MASK; #else port->membase = ioremap_nocache(port->mapbase, 64); if (!port->membase) { printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n", __func__, (unsigned long long)port->mapbase); return -ENOMEM; } #endif mmio = 1; } else if (!strncmp(options, "io,", 3)) { port->iotype = UPIO_PORT; port->iobase = simple_strtoul(options + 3, &options, 0); mmio = 0; } else return -EINVAL; options = strchr(options, ','); if (options) { options++; device->baud = simple_strtoul(options, NULL, 0); length = min(strcspn(options, " "), sizeof(device->options)); strncpy(device->options, options, length); } else { device->baud = probe_baud(port); snprintf(device->options, sizeof(device->options), "%u", device->baud); } printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n", mmio ? "MMIO" : "I/O port", mmio ? (unsigned long long) port->mapbase : (unsigned long long) port->iobase, device->options); return 0; }
static int __init early_serial8250_setup(struct earlycon_device *device, const char *options) { if (!(device->port.membase || device->port.iobase)) return 0; if (!device->baud) { device->baud = probe_baud(&device->port); snprintf(device->options, sizeof(device->options), "%u", device->baud); } init_port(device); early_device = device; device->con->write = early_serial8250_write; return 0; }
static int __init parse_options(struct early_uart_device *device, char *options) { struct uart_port *port = &device->port; int mapsize = 64; int mmio, length; if (!options) return -ENODEV; port->uartclk = BASE_BAUD * 16; if (!strncmp(options, "mmio,", 5)) { port->iotype = UPIO_MEM; port->mapbase = simple_strtoul(options + 5, &options, 0); port->membase = ioremap(port->mapbase, mapsize); if (!port->membase) { printk(KERN_ERR "%s: Couldn't ioremap 0x%lx\n", __FUNCTION__, port->mapbase); return -ENOMEM; } mmio = 1; } else if (!strncmp(options, "io,", 3)) { port->iotype = UPIO_PORT; port->iobase = simple_strtoul(options + 3, &options, 0); mmio = 0; } else return -EINVAL; if ((options = strchr(options, ','))) { options++; device->baud = simple_strtoul(options, NULL, 0); length = min(strcspn(options, " "), sizeof(device->options)); strncpy(device->options, options, length); } else { device->baud = probe_baud(port); snprintf(device->options, sizeof(device->options), "%u", device->baud); } printk(KERN_INFO "Early serial console at %s 0x%lx (options '%s')\n", mmio ? "MMIO" : "I/O port", mmio ? port->mapbase : (unsigned long) port->iobase, device->options); return 0; }