Linux 4.11-rc5
[linux/fpc-iii.git] / arch / s390 / kernel / early_printk.c
blob819cb15c67e8b71f01100a098c9b0c22e0373da7
1 /*
2 * Copyright IBM Corp. 2017
3 */
5 #include <linux/console.h>
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <asm/sclp.h>
10 static void sclp_early_write(struct console *con, const char *s, unsigned int len)
12 __sclp_early_printk(s, len);
15 static struct console sclp_early_console = {
16 .name = "earlysclp",
17 .write = sclp_early_write,
18 .flags = CON_PRINTBUFFER | CON_BOOT,
19 .index = -1,
22 static int __init setup_early_printk(char *buf)
24 if (early_console)
25 return 0;
26 /* Accept only "earlyprintk" and "earlyprintk=sclp" */
27 if (buf && strncmp(buf, "sclp", 4))
28 return 0;
29 if (!sclp.has_linemode && !sclp.has_vt220)
30 return 0;
31 early_console = &sclp_early_console;
32 register_console(early_console);
33 return 0;
35 early_param("earlyprintk", setup_early_printk);