29 #include <linux/tty.h>
32 #include <linux/serial_core.h>
34 #include <linux/serial.h>
37 #include <asm/serial.h>
38 #ifdef CONFIG_FIX_EARLYCON_MEM
39 #include <asm/pgtable.h>
40 #include <asm/fixmap.h>
80 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
101 const char *
s,
unsigned int count)
103 struct uart_port *port = &early_device.port;
128 quot = (dlm << 8) | dll;
129 return (port->
uartclk / 16) / quot;
162 mmio = !
strncmp(options,
"mmio,", 5);
163 mmio32 = !
strncmp(options,
"mmio32,", 7);
164 if (mmio || mmio32) {
170 #ifdef CONFIG_FIX_EARLYCON_MEM
181 (
unsigned long long) port->
mapbase);
185 }
else if (!
strncmp(options,
"io,", 3)) {
192 options =
strchr(options,
',');
199 device->
baud = probe_baud(port);
206 "Early serial console at MMIO%s 0x%llx (options '%s')\n",
208 (
unsigned long long)port->
mapbase,
212 "Early serial console at I/O port 0x%lx (options '%s')\n",
221 .write = early_serial8250_write,
226 static int __init early_serial8250_setup(
char *options)
231 if (device->
port.membase || device->
port.iobase)
234 err = parse_options(device, options);
247 options =
strstr(cmdline,
"uart8250,");
249 options =
strstr(cmdline,
"uart,");
254 options =
strchr(cmdline,
',') + 1;
255 err = early_serial8250_setup(options);
271 if (!device->
port.membase && !device->
port.iobase)
279 "ttyS", line, device->
options);
282 "ttyS", line, device->
options);