diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in index 855a62f70b..bed503b168 100644 --- a/boot/edk2/Config.in +++ b/boot/edk2/Config.in @@ -108,6 +108,21 @@ comment "QEMU SBSA depends on ATF not using EDK2 as BL33" endchoice +config BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL + bool "OVMF Debug on Serial" + depends on BR2_ENABLE_DEBUG + depends on BR2_TARGET_EDK2_PLATFORM_OVMF_I386 || \ + BR2_TARGET_EDK2_PLATFORM_OVMF_X64 + help + When EDK2 OVMF is built with debug, messages are printed to + IO port 0x402. Those messages are not shown in the normal + Qemu emulated serial port. Enabling this option will print + debug messages on the emulated serial port, potentially + mixing messages with UEFI serial console output. + + See OVMF README: + https://github.com/tianocore/edk2/blob/master/OvmfPkg/README + config BR2_TARGET_EDK2_FD_NAME string default "OVMF" if BR2_TARGET_EDK2_PLATFORM_OVMF_I386 diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk index 399bd346ef..95cbe415ef 100644 --- a/boot/edk2/edk2.mk +++ b/boot/edk2/edk2.mk @@ -16,8 +16,15 @@ EDK2_INSTALL_IMAGES = YES ifeq ($(BR2_ENABLE_DEBUG),y) EDK2_BUILD_TYPE = DEBUG +ifeq ($(BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL),y) +# DEBUG_ON_SERIAL_PORT is only tested to be set, so don't disable it, as +# it would still be set. +EDK2_BUILD_OPTS += -DDEBUG_ON_SERIAL_PORT=TRUE +endif else EDK2_BUILD_TYPE = RELEASE +# DEBUG_ON_SERIAL_PORT is only valid in debug builds, so useless to set +# it (enabled or disabled) on a relase build. endif # Build system notes.