soc/intel/broadwell: Conditionally skip PRE_GRAPHICS_DELAY

It was commented that the need for the delay was mainly related
to external displays and only with VBIOS execution. Move the
delay such that it is done only when we actually need to execute
the VBIOS aka option rom.

A delay is currently only defined for librem/purism_bdw in
its Kconfig. As the description of the issue sounds like it
would equally happen on other platforms when VBIOS is involved,
promote the Kconfig visible option to global scope.

Change-Id: I4503158576f35057373f003586bbf76af4d59b3d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48787
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki
2020-12-19 23:43:56 +02:00
parent 021c621eb0
commit 0f30063abf
6 changed files with 19 additions and 25 deletions

View File

@@ -117,6 +117,16 @@ config NO_GFX_INIT
endchoice endchoice
config PRE_GRAPHICS_DELAY
int "Graphics initialization delay in ms"
default 0
depends on VGA_ROM_RUN
help
On some systems, coreboot boots so fast that connected monitors
(mostly TVs) won't be able to wake up fast enough to talk to the
VBIOS. On those systems we need to wait for a bit before executing
the VBIOS.
config ONBOARD_VGA_IS_PRIMARY config ONBOARD_VGA_IS_PRIMARY
bool "Use onboard VGA as primary video device" bool "Use onboard VGA as primary video device"
default n default n

View File

@@ -732,6 +732,12 @@ static int should_load_oprom(struct device *dev)
return 0; return 0;
} }
static void oprom_pre_graphics_stall(void)
{
if (CONFIG_PRE_GRAPHICS_DELAY)
mdelay(CONFIG_PRE_GRAPHICS_DELAY);
}
/** Default handler: only runs the relevant PCI BIOS. */ /** Default handler: only runs the relevant PCI BIOS. */
void pci_dev_init(struct device *dev) void pci_dev_init(struct device *dev)
{ {
@@ -760,6 +766,9 @@ void pci_dev_init(struct device *dev)
if (!should_run_oprom(dev, rom)) if (!should_run_oprom(dev, rom))
return; return;
/* Wait for any configured pre-graphics delay */
oprom_pre_graphics_stall();
run_bios(dev, (unsigned long)ram); run_bios(dev, (unsigned long)ram);
gfx_set_init_done(1); gfx_set_init_done(1);

View File

@@ -90,15 +90,6 @@ config HASWELL_HIDE_PEG_FROM_MRC
However, it prevents MRC from programming PEG AFE registers, However, it prevents MRC from programming PEG AFE registers,
which can make PEG devices unstable. When unsure, choose N. which can make PEG devices unstable. When unsure, choose N.
config PRE_GRAPHICS_DELAY
int "Graphics initialization delay in ms"
default 0
help
On some systems, coreboot boots so fast that connected monitors
(mostly TVs) won't be able to wake up fast enough to talk to the
VBIOS. On those systems we need to wait for a bit before executing
the VBIOS.
# The UEFI System Agent binary needs to be at a fixed offset in the flash # The UEFI System Agent binary needs to be at a fixed offset in the flash
# and can therefore only reside in the COREBOOT fmap region # and can therefore only reside in the COREBOOT fmap region
config RO_REGION_ONLY config RO_REGION_ONLY

View File

@@ -444,7 +444,6 @@ static void gma_func0_init(struct device *dev)
if (!lightup_ok) { if (!lightup_ok) {
printk(BIOS_SPEW, "FUI did not run; using VBIOS\n"); printk(BIOS_SPEW, "FUI did not run; using VBIOS\n");
mdelay(CONFIG_PRE_GRAPHICS_DELAY);
pci_dev_init(dev); pci_dev_init(dev);
} }

View File

@@ -141,15 +141,6 @@ config RO_REGION_ONLY
endif # HAVE_MRC endif # HAVE_MRC
config PRE_GRAPHICS_DELAY
int "Graphics initialization delay in ms"
default 0
help
On some systems, coreboot boots so fast that connected monitors
(mostly TVs) won't be able to wake up fast enough to talk to the
VBIOS. On those systems we need to wait for a bit before executing
the VBIOS.
config INTEL_PCH_UART_CONSOLE config INTEL_PCH_UART_CONSOLE
bool "Use Serial IO UART for console" bool "Use Serial IO UART for console"
default n default n

View File

@@ -513,12 +513,6 @@ static void igd_init(struct device *dev)
if (!CONFIG(NO_GFX_INIT)) if (!CONFIG(NO_GFX_INIT))
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
/* Wait for any configured pre-graphics delay */
if (!acpi_is_wakeup_s3()) {
if (!CONFIG(CHROMEOS) || display_init_required())
mdelay(CONFIG_PRE_GRAPHICS_DELAY);
}
/* Early init steps */ /* Early init steps */
if (is_broadwell) { if (is_broadwell) {
reg_script_run_on_dev(dev, broadwell_early_init_script); reg_script_run_on_dev(dev, broadwell_early_init_script);