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

Commit 69c1f396 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Ingo Molnar
Browse files

efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation



Move the x86 EFI earlyprintk implementation to a shared location under
drivers/firmware and tweak it slightly so we can expose it as an earlycon
implementation (which is generic) rather than earlyprintk (which is only
implemented for a few architectures)

This also involves switching to write-combine mappings by default (which
is required on ARM since device mappings lack memory semantics, and so
memcpy/memset may not be used on them), and adding support for shared
memory framebuffers on cache coherent non-x86 systems (which do not
tolerate mismatched attributes).

Note that 32-bit ARM does not populate its struct screen_info early
enough for earlycon=efifb to work, so it is disabled there.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Jones <pjones@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20190202094119.13230-10-ard.biesheuvel@linaro.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent ce9084ba
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1073,9 +1073,15 @@
			specified address. The serial port must already be
			setup and configured. Options are not yet supported.

		efifb,[options]
			Start an early, unaccelerated console on the EFI
			memory mapped framebuffer (if available). On cache
			coherent non-x86 systems that use system memory for
			the framebuffer, pass the 'ram' option so that it is
			mapped with the correct attributes.

	earlyprintk=	[X86,SH,ARM,M68k,S390]
			earlyprintk=vga
			earlyprintk=efi
			earlyprintk=sclp
			earlyprintk=xen
			earlyprintk=serial[,ttySn[,baudrate]]
+0 −10
Original line number Diff line number Diff line
@@ -40,16 +40,6 @@ config EARLY_PRINTK_DBGP
	  with klogd/syslogd or the X server. You should normally say N here,
	  unless you want to debug such a crash. You need usb debug device.

config EARLY_PRINTK_EFI
	bool "Early printk via the EFI framebuffer"
	depends on EFI && EARLY_PRINTK
	select FONT_SUPPORT
	---help---
	  Write kernel log output directly into the EFI framebuffer.

	  This is useful for kernel debugging when your machine crashes very
	  early before the console code is initialized.

config EARLY_PRINTK_USB_XDBC
	bool "Early printk via the xHCI debug port"
	depends on EARLY_PRINTK && PCI
+0 −1
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@ static inline bool efi_runtime_supported(void)
	return false;
}

extern struct console early_efi_console;
extern void parse_efi_setup(u64 phys_addr, u32 data_len);

extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt);
+0 −4
Original line number Diff line number Diff line
@@ -388,10 +388,6 @@ static int __init setup_early_printk(char *buf)
		if (!strncmp(buf, "xen", 3))
			early_console_register(&xenboot_console, keep);
#endif
#ifdef CONFIG_EARLY_PRINTK_EFI
		if (!strncmp(buf, "efi", 3))
			early_console_register(&early_efi_console, keep);
#endif
#ifdef CONFIG_EARLY_PRINTK_USB_XDBC
		if (!strncmp(buf, "xdbc", 4))
			early_xdbc_parse_parameter(buf + 4);
+0 −1
Original line number Diff line number Diff line
@@ -3,5 +3,4 @@ OBJECT_FILES_NON_STANDARD_efi_thunk_$(BITS).o := y
OBJECT_FILES_NON_STANDARD_efi_stub_$(BITS).o := y

obj-$(CONFIG_EFI) 		+= quirks.o efi.o efi_$(BITS).o efi_stub_$(BITS).o
obj-$(CONFIG_EARLY_PRINTK_EFI)	+= early_printk.o
obj-$(CONFIG_EFI_MIXED)		+= efi_thunk_$(BITS).o
Loading