]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/blob - arch/s390/kernel/early_printk.c
Merge tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git...
[rpmsg/rpmsg.git] / arch / s390 / kernel / early_printk.c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  *    Copyright IBM Corp. 2017
4  */
6 #include <linux/console.h>
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <asm/sclp.h>
11 static void sclp_early_write(struct console *con, const char *s, unsigned int len)
12 {
13         __sclp_early_printk(s, len, 0);
14 }
16 static struct console sclp_early_console = {
17         .name  = "earlysclp",
18         .write = sclp_early_write,
19         .flags = CON_PRINTBUFFER | CON_BOOT,
20         .index = -1,
21 };
23 static int __init setup_early_printk(char *buf)
24 {
25         if (early_console)
26                 return 0;
27         /* Accept only "earlyprintk" and "earlyprintk=sclp" */
28         if (buf && strncmp(buf, "sclp", 4))
29                 return 0;
30         if (!sclp.has_linemode && !sclp.has_vt220)
31                 return 0;
32         early_console = &sclp_early_console;
33         register_console(early_console);
34         return 0;
35 }
36 early_param("earlyprintk", setup_early_printk);