Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 1 | #include <linux/console.h> |
| 2 | #include <linux/kernel.h> |
| 3 | #include <linux/init.h> |
| 4 | #include <linux/string.h> |
| 5 | #include <linux/screen_info.h> |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 6 | #include <linux/usb/ch9.h> |
| 7 | #include <linux/pci_regs.h> |
| 8 | #include <linux/pci_ids.h> |
| 9 | #include <linux/errno.h> |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 10 | #include <asm/io.h> |
| 11 | #include <asm/processor.h> |
| 12 | #include <asm/fcntl.h> |
H. Peter Anvin | 30c8264 | 2007-10-15 17:13:22 -0700 | [diff] [blame] | 13 | #include <asm/setup.h> |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 14 | #include <xen/hvc-console.h> |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 15 | #include <asm/pci-direct.h> |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 16 | #include <asm/fixmap.h> |
Kuppuswamy Sathyanarayanan | 05454c2 | 2013-10-17 15:35:27 -0700 | [diff] [blame] | 17 | #include <asm/intel-mid.h> |
Ingo Molnar | 726c0d9 | 2009-02-09 11:32:17 +0100 | [diff] [blame] | 18 | #include <asm/pgtable.h> |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 19 | #include <linux/usb/ehci_def.h> |
Matt Fleming | 72548e8 | 2013-10-04 09:36:56 +0100 | [diff] [blame] | 20 | #include <linux/efi.h> |
| 21 | #include <asm/efi.h> |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 22 | #include <asm/pci_x86.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 24 | /* Simple VGA output */ |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 25 | #define VGABASE (__ISA_IO_base + 0xb8000) |
| 26 | |
| 27 | static int max_ypos = 25, max_xpos = 80; |
Paolo Ciarrocchi | c9cf39a | 2008-02-29 13:26:56 +0100 | [diff] [blame] | 28 | static int current_ypos = 25, current_xpos; |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 29 | |
| 30 | static void early_vga_write(struct console *con, const char *str, unsigned n) |
| 31 | { |
| 32 | char c; |
| 33 | int i, k, j; |
| 34 | |
| 35 | while ((c = *str++) != '\0' && n-- > 0) { |
| 36 | if (current_ypos >= max_ypos) { |
| 37 | /* scroll 1 line up */ |
| 38 | for (k = 1, j = 0; k < max_ypos; k++, j++) { |
| 39 | for (i = 0; i < max_xpos; i++) { |
| 40 | writew(readw(VGABASE+2*(max_xpos*k+i)), |
| 41 | VGABASE + 2*(max_xpos*j + i)); |
| 42 | } |
| 43 | } |
| 44 | for (i = 0; i < max_xpos; i++) |
| 45 | writew(0x720, VGABASE + 2*(max_xpos*j + i)); |
| 46 | current_ypos = max_ypos-1; |
| 47 | } |
Jason Wessel | 61eaf539b | 2010-05-20 21:04:31 -0500 | [diff] [blame] | 48 | #ifdef CONFIG_KGDB_KDB |
| 49 | if (c == '\b') { |
| 50 | if (current_xpos > 0) |
| 51 | current_xpos--; |
| 52 | } else if (c == '\r') { |
| 53 | current_xpos = 0; |
| 54 | } else |
| 55 | #endif |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 56 | if (c == '\n') { |
| 57 | current_xpos = 0; |
| 58 | current_ypos++; |
| 59 | } else if (c != '\r') { |
| 60 | writew(((0x7 << 8) | (unsigned short) c), |
| 61 | VGABASE + 2*(max_xpos*current_ypos + |
| 62 | current_xpos++)); |
| 63 | if (current_xpos >= max_xpos) { |
| 64 | current_xpos = 0; |
| 65 | current_ypos++; |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | static struct console early_vga_console = { |
| 72 | .name = "earlyvga", |
| 73 | .write = early_vga_write, |
| 74 | .flags = CON_PRINTBUFFER, |
| 75 | .index = -1, |
| 76 | }; |
| 77 | |
| 78 | /* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ |
| 79 | |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 80 | static unsigned long early_serial_base = 0x3f8; /* ttyS0 */ |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 81 | |
| 82 | #define XMTRDY 0x20 |
| 83 | |
| 84 | #define DLAB 0x80 |
| 85 | |
| 86 | #define TXR 0 /* Transmit register (WRITE) */ |
| 87 | #define RXR 0 /* Receive register (READ) */ |
| 88 | #define IER 1 /* Interrupt Enable */ |
| 89 | #define IIR 2 /* Interrupt ID */ |
| 90 | #define FCR 2 /* FIFO control */ |
| 91 | #define LCR 3 /* Line control */ |
| 92 | #define MCR 4 /* Modem control */ |
| 93 | #define LSR 5 /* Line Status */ |
| 94 | #define MSR 6 /* Modem Status */ |
| 95 | #define DLL 0 /* Divisor Latch Low */ |
| 96 | #define DLH 1 /* Divisor latch High */ |
| 97 | |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 98 | static void mem32_serial_out(unsigned long addr, int offset, int value) |
| 99 | { |
| 100 | uint32_t *vaddr = (uint32_t *)addr; |
| 101 | /* shift implied by pointer type */ |
| 102 | writel(value, vaddr + offset); |
| 103 | } |
| 104 | |
| 105 | static unsigned int mem32_serial_in(unsigned long addr, int offset) |
| 106 | { |
| 107 | uint32_t *vaddr = (uint32_t *)addr; |
| 108 | /* shift implied by pointer type */ |
| 109 | return readl(vaddr + offset); |
| 110 | } |
| 111 | |
| 112 | static unsigned int io_serial_in(unsigned long addr, int offset) |
| 113 | { |
| 114 | return inb(addr + offset); |
| 115 | } |
| 116 | |
| 117 | static void io_serial_out(unsigned long addr, int offset, int value) |
| 118 | { |
| 119 | outb(value, addr + offset); |
| 120 | } |
| 121 | |
| 122 | static unsigned int (*serial_in)(unsigned long addr, int offset) = io_serial_in; |
| 123 | static void (*serial_out)(unsigned long addr, int offset, int value) = io_serial_out; |
| 124 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 125 | static int early_serial_putc(unsigned char ch) |
| 126 | { |
| 127 | unsigned timeout = 0xffff; |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 128 | |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 129 | while ((serial_in(early_serial_base, LSR) & XMTRDY) == 0 && --timeout) |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 130 | cpu_relax(); |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 131 | serial_out(early_serial_base, TXR, ch); |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 132 | return timeout ? 0 : -1; |
| 133 | } |
| 134 | |
| 135 | static void early_serial_write(struct console *con, const char *s, unsigned n) |
| 136 | { |
| 137 | while (*s && n-- > 0) { |
| 138 | if (*s == '\n') |
| 139 | early_serial_putc('\r'); |
| 140 | early_serial_putc(*s); |
| 141 | s++; |
| 142 | } |
| 143 | } |
| 144 | |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 145 | static __init void early_serial_hw_init(unsigned divisor) |
| 146 | { |
| 147 | unsigned char c; |
| 148 | |
| 149 | serial_out(early_serial_base, LCR, 0x3); /* 8n1 */ |
| 150 | serial_out(early_serial_base, IER, 0); /* no interrupt */ |
| 151 | serial_out(early_serial_base, FCR, 0); /* no fifo */ |
| 152 | serial_out(early_serial_base, MCR, 0x3); /* DTR + RTS */ |
| 153 | |
| 154 | c = serial_in(early_serial_base, LCR); |
| 155 | serial_out(early_serial_base, LCR, c | DLAB); |
| 156 | serial_out(early_serial_base, DLL, divisor & 0xff); |
| 157 | serial_out(early_serial_base, DLH, (divisor >> 8) & 0xff); |
| 158 | serial_out(early_serial_base, LCR, c & ~DLAB); |
| 159 | } |
| 160 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 161 | #define DEFAULT_BAUD 9600 |
| 162 | |
| 163 | static __init void early_serial_init(char *s) |
| 164 | { |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 165 | unsigned divisor; |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 166 | unsigned long baud = DEFAULT_BAUD; |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 167 | char *e; |
| 168 | |
| 169 | if (*s == ',') |
| 170 | ++s; |
| 171 | |
| 172 | if (*s) { |
| 173 | unsigned port; |
Paolo Ciarrocchi | e941f27 | 2008-02-29 13:25:30 +0100 | [diff] [blame] | 174 | if (!strncmp(s, "0x", 2)) { |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 175 | early_serial_base = simple_strtoul(s, &e, 16); |
| 176 | } else { |
Jan Beulich | 30cec97 | 2008-08-29 12:49:55 +0100 | [diff] [blame] | 177 | static const int __initconst bases[] = { 0x3f8, 0x2f8 }; |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 178 | |
Paolo Ciarrocchi | e941f27 | 2008-02-29 13:25:30 +0100 | [diff] [blame] | 179 | if (!strncmp(s, "ttyS", 4)) |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 180 | s += 4; |
| 181 | port = simple_strtoul(s, &e, 10); |
| 182 | if (port > 1 || s == e) |
| 183 | port = 0; |
| 184 | early_serial_base = bases[port]; |
| 185 | } |
| 186 | s += strcspn(s, ","); |
| 187 | if (*s == ',') |
| 188 | s++; |
| 189 | } |
| 190 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 191 | if (*s) { |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 192 | if (kstrtoul(s, 0, &baud) < 0 || baud == 0) |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 193 | baud = DEFAULT_BAUD; |
| 194 | } |
| 195 | |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 196 | /* Convert from baud to divisor value */ |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 197 | divisor = 115200 / baud; |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 198 | |
| 199 | /* These will always be IO based ports */ |
| 200 | serial_in = io_serial_in; |
| 201 | serial_out = io_serial_out; |
| 202 | |
| 203 | /* Set up the HW */ |
| 204 | early_serial_hw_init(divisor); |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 205 | } |
| 206 | |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 207 | #ifdef CONFIG_PCI |
| 208 | /* |
| 209 | * early_pci_serial_init() |
| 210 | * |
| 211 | * This function is invoked when the early_printk param starts with "pciserial" |
| 212 | * The rest of the param should be ",B:D.F,baud" where B, D & F describe the |
| 213 | * location of a PCI device that must be a UART device. |
| 214 | */ |
| 215 | static __init void early_pci_serial_init(char *s) |
| 216 | { |
| 217 | unsigned divisor; |
| 218 | unsigned long baud = DEFAULT_BAUD; |
| 219 | u8 bus, slot, func; |
| 220 | uint32_t classcode, bar0; |
| 221 | uint16_t cmdreg; |
| 222 | char *e; |
| 223 | |
| 224 | |
| 225 | /* |
| 226 | * First, part the param to get the BDF values |
| 227 | */ |
| 228 | if (*s == ',') |
| 229 | ++s; |
| 230 | |
| 231 | if (*s == 0) |
| 232 | return; |
| 233 | |
| 234 | bus = (u8)simple_strtoul(s, &e, 16); |
| 235 | s = e; |
| 236 | if (*s != ':') |
| 237 | return; |
| 238 | ++s; |
| 239 | slot = (u8)simple_strtoul(s, &e, 16); |
| 240 | s = e; |
| 241 | if (*s != '.') |
| 242 | return; |
| 243 | ++s; |
| 244 | func = (u8)simple_strtoul(s, &e, 16); |
| 245 | s = e; |
| 246 | |
| 247 | /* A baud might be following */ |
| 248 | if (*s == ',') |
| 249 | s++; |
| 250 | |
| 251 | /* |
| 252 | * Second, find the device from the BDF |
| 253 | */ |
| 254 | cmdreg = read_pci_config(bus, slot, func, PCI_COMMAND); |
| 255 | classcode = read_pci_config(bus, slot, func, PCI_CLASS_REVISION); |
| 256 | bar0 = read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_0); |
| 257 | |
| 258 | /* |
| 259 | * Verify it is a UART type device |
| 260 | */ |
| 261 | if (((classcode >> 16 != PCI_CLASS_COMMUNICATION_MODEM) && |
| 262 | (classcode >> 16 != PCI_CLASS_COMMUNICATION_SERIAL)) || |
| 263 | (((classcode >> 8) & 0xff) != 0x02)) /* 16550 I/F at BAR0 */ |
| 264 | return; |
| 265 | |
| 266 | /* |
| 267 | * Determine if it is IO or memory mapped |
| 268 | */ |
| 269 | if (bar0 & 0x01) { |
| 270 | /* it is IO mapped */ |
| 271 | serial_in = io_serial_in; |
| 272 | serial_out = io_serial_out; |
| 273 | early_serial_base = bar0&0xfffffffc; |
| 274 | write_pci_config(bus, slot, func, PCI_COMMAND, |
| 275 | cmdreg|PCI_COMMAND_IO); |
| 276 | } else { |
| 277 | /* It is memory mapped - assume 32-bit alignment */ |
| 278 | serial_in = mem32_serial_in; |
| 279 | serial_out = mem32_serial_out; |
| 280 | /* WARNING! assuming the address is always in the first 4G */ |
| 281 | early_serial_base = |
| 282 | (unsigned long)early_ioremap(bar0 & 0xfffffff0, 0x10); |
| 283 | write_pci_config(bus, slot, func, PCI_COMMAND, |
| 284 | cmdreg|PCI_COMMAND_MEMORY); |
| 285 | } |
| 286 | |
| 287 | /* |
| 288 | * Lastly, initalize the hardware |
| 289 | */ |
| 290 | if (*s) { |
| 291 | if (strcmp(s, "nocfg") == 0) |
| 292 | /* Sometimes, we want to leave the UART alone |
| 293 | * and assume the BIOS has set it up correctly. |
| 294 | * "nocfg" tells us this is the case, and we |
| 295 | * should do no more setup. |
| 296 | */ |
| 297 | return; |
| 298 | if (kstrtoul(s, 0, &baud) < 0 || baud == 0) |
| 299 | baud = DEFAULT_BAUD; |
| 300 | } |
| 301 | |
| 302 | /* Convert from baud to divisor value */ |
| 303 | divisor = 115200 / baud; |
| 304 | |
| 305 | /* Set up the HW */ |
| 306 | early_serial_hw_init(divisor); |
| 307 | } |
| 308 | #endif |
| 309 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 310 | static struct console early_serial_console = { |
| 311 | .name = "earlyser", |
| 312 | .write = early_serial_write, |
| 313 | .flags = CON_PRINTBUFFER, |
| 314 | .index = -1, |
| 315 | }; |
| 316 | |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 317 | static inline void early_console_register(struct console *con, int keep_early) |
| 318 | { |
Thomas Gleixner | d0380e6 | 2013-04-29 16:17:18 -0700 | [diff] [blame] | 319 | if (con->index != -1) { |
Jason Wessel | 429a6e5 | 2009-09-23 18:13:13 -0500 | [diff] [blame] | 320 | printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n", |
| 321 | con->name); |
| 322 | return; |
| 323 | } |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 324 | early_console = con; |
| 325 | if (keep_early) |
| 326 | early_console->flags &= ~CON_BOOT; |
| 327 | else |
| 328 | early_console->flags |= CON_BOOT; |
| 329 | register_console(early_console); |
| 330 | } |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 331 | |
| 332 | static int __init setup_early_printk(char *buf) |
| 333 | { |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 334 | int keep; |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 335 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 336 | if (!buf) |
| 337 | return 0; |
| 338 | |
Thomas Gleixner | d0380e6 | 2013-04-29 16:17:18 -0700 | [diff] [blame] | 339 | if (early_console) |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 340 | return 0; |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 341 | |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 342 | keep = (strstr(buf, "keep") != NULL); |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 343 | |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 344 | while (*buf != '\0') { |
| 345 | if (!strncmp(buf, "serial", 6)) { |
Jason Wessel | ea3acb1 | 2009-09-24 09:08:30 -0500 | [diff] [blame] | 346 | buf += 6; |
| 347 | early_serial_init(buf); |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 348 | early_console_register(&early_serial_console, keep); |
Jason Wessel | ea3acb1 | 2009-09-24 09:08:30 -0500 | [diff] [blame] | 349 | if (!strncmp(buf, ",ttyS", 5)) |
| 350 | buf += 5; |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 351 | } |
| 352 | if (!strncmp(buf, "ttyS", 4)) { |
| 353 | early_serial_init(buf + 4); |
| 354 | early_console_register(&early_serial_console, keep); |
| 355 | } |
Stuart R. Anderson | ea9e9d8 | 2015-01-20 12:07:57 +0000 | [diff] [blame^] | 356 | #ifdef CONFIG_PCI |
| 357 | if (!strncmp(buf, "pciserial", 9)) { |
| 358 | early_pci_serial_init(buf + 9); |
| 359 | early_console_register(&early_serial_console, keep); |
| 360 | buf += 9; /* Keep from match the above "serial" */ |
| 361 | } |
| 362 | #endif |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 363 | if (!strncmp(buf, "vga", 3) && |
| 364 | boot_params.screen_info.orig_video_isVGA == 1) { |
| 365 | max_xpos = boot_params.screen_info.orig_video_cols; |
| 366 | max_ypos = boot_params.screen_info.orig_video_lines; |
| 367 | current_ypos = boot_params.screen_info.orig_y; |
| 368 | early_console_register(&early_vga_console, keep); |
| 369 | } |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 370 | #ifdef CONFIG_EARLY_PRINTK_DBGP |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 371 | if (!strncmp(buf, "dbgp", 4) && !early_dbgp_init(buf + 4)) |
| 372 | early_console_register(&early_dbgp_console, keep); |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 373 | #endif |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 374 | #ifdef CONFIG_HVC_XEN |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 375 | if (!strncmp(buf, "xen", 3)) |
| 376 | early_console_register(&xenboot_console, keep); |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 377 | #endif |
Alan Cox | 1ea7c67 | 2011-11-10 13:29:14 +0000 | [diff] [blame] | 378 | #ifdef CONFIG_EARLY_PRINTK_INTEL_MID |
Feng Tang | 4d03355 | 2010-09-13 15:08:56 +0800 | [diff] [blame] | 379 | if (!strncmp(buf, "hsu", 3)) { |
Mika Westerberg | b82e324 | 2011-11-10 13:18:09 +0000 | [diff] [blame] | 380 | hsu_early_console_init(buf + 3); |
Feng Tang | 4d03355 | 2010-09-13 15:08:56 +0800 | [diff] [blame] | 381 | early_console_register(&early_hsu_console, keep); |
| 382 | } |
Feng Tang | c20b5c3 | 2010-09-13 15:08:55 +0800 | [diff] [blame] | 383 | #endif |
Matt Fleming | 72548e8 | 2013-10-04 09:36:56 +0100 | [diff] [blame] | 384 | #ifdef CONFIG_EARLY_PRINTK_EFI |
| 385 | if (!strncmp(buf, "efi", 3)) |
| 386 | early_console_register(&early_efi_console, keep); |
| 387 | #endif |
| 388 | |
Jason Wessel | c953094 | 2009-08-20 15:39:52 -0500 | [diff] [blame] | 389 | buf++; |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 390 | } |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 391 | return 0; |
| 392 | } |
Yinghai Lu | 5c05917 | 2008-07-24 17:29:40 -0700 | [diff] [blame] | 393 | |
Thomas Gleixner | 250c227 | 2007-10-11 11:17:24 +0200 | [diff] [blame] | 394 | early_param("earlyprintk", setup_early_printk); |