1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright IBM Corp. 2017
6 #include <linux/console.h>
7 #include <linux/kernel.h>
8 #include <linux/init.h>
12 static void sclp_early_write(struct console *con, const char *s, unsigned int len)
14 __sclp_early_printk(s, len);
17 static struct console sclp_early_console = {
19 .write = sclp_early_write,
20 .flags = CON_PRINTBUFFER | CON_BOOT,
24 void __init register_early_console(void)
28 if (!sclp.has_linemode && !sclp.has_vt220)
30 early_console = &sclp_early_console;
31 register_console(early_console);
34 static int __init setup_early_printk(char *buf)
38 /* Accept only "earlyprintk" and "earlyprintk=sclp" */
39 if (buf && !str_has_prefix(buf, "sclp"))
41 register_early_console();
44 early_param("earlyprintk", setup_early_printk);