forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s390: provide sclp based boot console
Use the early sclp code to provide a boot console. This boot console is available if the kernel parameter "earlyprintk" has been specified, just like it works for other architectures that also provide an early boot console. This makes debugging of early problems much easier, since now we finally have working console output even before memory detection is running. The boot console will be automatically disabled as soon as another console will be registered. Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
- Loading branch information
Showing
6 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright IBM Corp. 2017 | ||
*/ | ||
|
||
#include <linux/console.h> | ||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <asm/sclp.h> | ||
|
||
static void sclp_early_write(struct console *con, const char *s, unsigned int len) | ||
{ | ||
__sclp_print_early(s, len); | ||
} | ||
|
||
static struct console sclp_early_console = { | ||
.name = "earlysclp", | ||
.write = sclp_early_write, | ||
.flags = CON_PRINTBUFFER | CON_BOOT, | ||
.index = -1, | ||
}; | ||
|
||
static int __init setup_early_printk(char *buf) | ||
{ | ||
if (early_console) | ||
return 0; | ||
/* Accept only "earlyprintk" and "earlyprintk=sclp" */ | ||
if (buf && strncmp(buf, "sclp", 4)) | ||
return 0; | ||
if (!sclp.has_linemode && !sclp.has_vt220) | ||
return 0; | ||
early_console = &sclp_early_console; | ||
register_console(early_console); | ||
return 0; | ||
} | ||
early_param("earlyprintk", setup_early_printk); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters