Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89175cf7 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

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: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f0319748
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -979,9 +979,10 @@
			address. The serial port must already be setup
			address. The serial port must already be setup
			and configured. Options are not yet supported.
			and configured. Options are not yet supported.


	earlyprintk=	[X86,SH,BLACKFIN,ARM,M68k]
	earlyprintk=	[X86,SH,BLACKFIN,ARM,M68k,S390]
			earlyprintk=vga
			earlyprintk=vga
			earlyprintk=efi
			earlyprintk=efi
			earlyprintk=sclp
			earlyprintk=xen
			earlyprintk=xen
			earlyprintk=serial[,ttySn[,baudrate]]
			earlyprintk=serial[,ttySn[,baudrate]]
			earlyprintk=serial[,0x...[,baudrate]]
			earlyprintk=serial[,0x...[,baudrate]]
@@ -1016,6 +1017,8 @@


			The xen output can only be used by Xen PV guests.
			The xen output can only be used by Xen PV guests.


			The sclp output can only be used on s390.

	edac_report=	[HW,EDAC] Control how to report EDAC event
	edac_report=	[HW,EDAC] Control how to report EDAC event
			Format: {"on" | "off" | "force"}
			Format: {"on" | "off" | "force"}
			on: enable EDAC to report H/W event. May be overridden
			on: enable EDAC to report H/W event. May be overridden
+4 −0
Original line number Original line Diff line number Diff line
@@ -20,4 +20,8 @@ config S390_PTDUMP
config DEBUG_SET_MODULE_RONX
config DEBUG_SET_MODULE_RONX
	def_bool y
	def_bool y
	depends on MODULES
	depends on MODULES

config EARLY_PRINTK
	def_bool y

endmenu
endmenu
+1 −0
Original line number Original line Diff line number Diff line
@@ -118,6 +118,7 @@ int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count);
int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
void sclp_early_detect(void);
void sclp_early_detect(void);
void _sclp_print_early(const char *);
void _sclp_print_early(const char *);
void __sclp_print_early(const char *s, unsigned int len);
void sclp_ocf_cpc_name_copy(char *dst);
void sclp_ocf_cpc_name_copy(char *dst);


static inline int sclp_get_core_info(struct sclp_core_info *info, int early)
static inline int sclp_get_core_info(struct sclp_core_info *info, int early)
+1 −1
Original line number Original line Diff line number Diff line
@@ -76,7 +76,7 @@ obj-$(CONFIG_AUDIT) += audit.o
compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o
obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o
obj-$(CONFIG_COMPAT)		+= compat_wrapper.o $(compat-obj-y)
obj-$(CONFIG_COMPAT)		+= compat_wrapper.o $(compat-obj-y)

obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
obj-$(CONFIG_KPROBES)		+= kprobes.o
obj-$(CONFIG_KPROBES)		+= kprobes.o
obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
+35 −0
Original line number Original line Diff line number Diff line
/*
 *    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);
Loading