Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49764 )
Change subject: src/device: Add Kconfig option to ignore vBIOS errors ......................................................................
src/device: Add Kconfig option to ignore vBIOS errors
At times, it's desirable to run a board that has integrated graphics and an eDP display with no panel attached. With the AMD vBIOS, this returns an error and keeps the board from booting. With the return value masked, it boots correctly to the OS.
BUG=b:175843172 TEST=Boot morphius to OS without a display BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I7d261321cdbe423dd754f6a354e5f50b53563fcb --- M src/device/Kconfig M src/device/oprom/realmode/x86.c 2 files changed, 22 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/49764/1
diff --git a/src/device/Kconfig b/src/device/Kconfig index bb4e913..8bfd59d 100644 --- a/src/device/Kconfig +++ b/src/device/Kconfig @@ -159,6 +159,12 @@ Always uncondtionally run the option regardless of other policies.
+config IGNORE_VBIOS_ERRORS + def_bool n + depends on VGA_ROM_RUN + help + Don't die if the vbios returns an error. + config ON_DEVICE_ROM_LOAD bool "Load Option ROMs on PCI devices" default n if PAYLOAD_SEABIOS diff --git a/src/device/oprom/realmode/x86.c b/src/device/oprom/realmode/x86.c index 6b80ac5..d913029 100644 --- a/src/device/oprom/realmode/x86.c +++ b/src/device/oprom/realmode/x86.c @@ -226,8 +226,12 @@ X86_EAX = realmode_interrupt(0x10, VESA_GET_INFO, 0x0000, 0x0000, 0x0000, buffer_seg, buffer_adr); /* If the VBE function completed successfully, 0x0 is returned in AH */ - if (X86_AH) - die("\nError: In %s function\n", __func__); + if (X86_AH) { + if (!CONFIG(IGNORE_VBIOS_ERRORS)) + die("\nError: In %s function\n", __func__); + else + return; + } memcpy(info, buffer, sizeof(vbe_info_block)); }
@@ -297,15 +301,19 @@ } static u8 vbe_get_mode_info(vbe_mode_info_t * mi) { - printk(BIOS_DEBUG, "VBE: Getting information about VESA mode %04x\n", + printk(BIOS_DEBUG, "--- VBE: Getting information about VESA mode %04x ---\n", mi->video_mode); char *buffer = PTR_TO_REAL_MODE(__realmode_buffer); u16 buffer_seg = (((unsigned long)buffer) >> 4) & 0xff00; u16 buffer_adr = ((unsigned long)buffer) & 0xffff; X86_EAX = realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode, 0x0000, buffer_seg, buffer_adr); - if (vbe_check_for_failure(X86_AH)) - die("\nError: In %s function\n", __func__); + if (vbe_check_for_failure(X86_AH)) { + if (!CONFIG(IGNORE_VBIOS_ERRORS)) + die("\nError: In %s function\n", __func__); + else + return 0; + } memcpy(mi->mode_info_block, buffer, sizeof(mi->mode_info_block)); mode_info_valid = 1; return 0; @@ -320,7 +328,7 @@ mi->video_mode &= ~(1 << 15); X86_EAX = realmode_interrupt(0x10, VESA_SET_MODE, mi->video_mode, 0x0000, 0x0000, 0x0000, 0x0000); - if (vbe_check_for_failure(X86_AH)) + if (!CONFIG(IGNORE_VBIOS_ERRORS) && vbe_check_for_failure(X86_AH)) die("\nError: In %s function\n", __func__); return 0; } @@ -372,7 +380,7 @@ delay(2); X86_EAX = realmode_interrupt(0x10, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000); - if (vbe_check_for_failure(X86_AH)) + if (!CONFIG(IGNORE_VBIOS_ERRORS) && vbe_check_for_failure(X86_AH)) die("\nError: In %s function\n", __func__); }
@@ -411,6 +419,7 @@ if ((dev->class >> 8)== PCI_CLASS_DISPLAY_VGA) vbe_set_graphics(); #endif + printk(BIOS_DEBUG, "... vbe_set_graphics() returned.\n"); }
/* interrupt_handler() is called from assembler code only,