]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/s390/kernel/early_printk.c
Merge tag 'imx-drm-next-2017-10-18' of git://git.pengutronix.de/git/pza/linux into...
[mirror_ubuntu-bionic-kernel.git] / arch / s390 / kernel / early_printk.c
CommitLineData
89175cf7
HC
1/*
2 * Copyright IBM Corp. 2017
3 */
4
5#include <linux/console.h>
6#include <linux/kernel.h>
7#include <linux/init.h>
8#include <asm/sclp.h>
9
10static void sclp_early_write(struct console *con, const char *s, unsigned int len)
11{
d5ab7a34 12 __sclp_early_printk(s, len);
89175cf7
HC
13}
14
15static struct console sclp_early_console = {
16 .name = "earlysclp",
17 .write = sclp_early_write,
18 .flags = CON_PRINTBUFFER | CON_BOOT,
19 .index = -1,
20};
21
22static int __init setup_early_printk(char *buf)
23{
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;
34}
35early_param("earlyprintk", setup_early_printk);