soc/intel/alderlake: Wait for panel power cycle to complete

The Alder Lake PEIM graphics driver executed as part of the FSP does
not wait for the panel power cycle to complete before it initializes
communication with the display. It can result in AUX channel
communication time out and PEIM graphics driver failing to bring up
graphics.

If we have performed some graphics operation in romstage, it is
possible that a panel power cycle is still in progress. To prevent any
issue with the PEIM graphics driver it is preferable to ensure that
panel power cycle is complete.

This patch replaces commit ba2cef5b54
("soc/intel/common/block/early_graphics: Introduce a 200 ms delay")
workaround patch.

BUG=b:264526798
BRANCH=firmware-brya-14505.B
TEST=Developer screen is visible in the recovery flow

Change-Id: Iadd6c9552b184f7d6ec8df9d0d392634864ba50b
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72419
Reviewed-by: Anil Kumar K <anil.kumar.k@intel.com>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
This commit is contained in:
Jeremy Compostella 2023-01-19 19:06:09 -07:00 committed by Nick Vaccaro
parent b628beca34
commit a2a7fecabf
3 changed files with 47 additions and 17 deletions

View File

@ -3753,6 +3753,8 @@
#define PIPEB_PP_DIVISOR 0x61310 #define PIPEB_PP_DIVISOR 0x61310
#define PCH_PP_STATUS 0xc7200 #define PCH_PP_STATUS 0xc7200
#define PANEL_POWER_CYCLE_ACTIVE (1 << 27)
#define PCH_PP_CONTROL 0xc7204 #define PCH_PP_CONTROL 0xc7204
#define PANEL_UNLOCK_REGS (0xabcd << 16) #define PANEL_UNLOCK_REGS (0xabcd << 16)
#define PANEL_UNLOCK_MASK (0xffff << 16) #define PANEL_UNLOCK_MASK (0xffff << 16)

View File

@ -3,9 +3,12 @@
#include <assert.h> #include <assert.h>
#include <console/console.h> #include <console/console.h>
#include <cpu/intel/microcode.h> #include <cpu/intel/microcode.h>
#include <delay.h>
#include <device/device.h> #include <device/device.h>
#include <device/pci.h> #include <device/pci.h>
#include <device/pci_ids.h> #include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <drivers/intel/gma/i915_reg.h>
#include <fsp/api.h> #include <fsp/api.h>
#include <fsp/fsp_debug_event.h> #include <fsp/fsp_debug_event.h>
#include <fsp/ppi/mp_service_ppi.h> #include <fsp/ppi/mp_service_ppi.h>
@ -1205,6 +1208,46 @@ static void soc_silicon_init_params(FSP_S_CONFIG *s_cfg,
fill_fsps_params[i](s_cfg, config); fill_fsps_params[i](s_cfg, config);
} }
/*
* The Alder Lake PEIM graphics driver executed as part of the FSP does not wait
* for the panel power cycle to complete before it initializes communication
* with the display. It can result in AUX channel communication time out and
* PEIM graphics driver failing to bring up graphics.
*
* If we have performed some graphics operations in romstage, it is possible
* that a panel power cycle is still in progress. To prevent any issue with the
* PEIM graphics driver it is preferable to ensure that panel power cycle is
* complete.
*
* BUG:b:264526798
*/
static void wait_for_panel_power_cycle_done(const struct soc_intel_alderlake_config *config)
{
const struct i915_gpu_panel_config *panel_cfg;
uint32_t bar0;
void *mmio;
if (!CONFIG(RUN_FSP_GOP))
return;
bar0 = pci_s_read_config32(SA_DEV_IGD, PCI_BASE_ADDRESS_0);
mmio = (void *)(bar0 & ~PCI_BASE_ADDRESS_MEM_ATTR_MASK);
if (!mmio)
return;
panel_cfg = &config->panel_cfg;
for (size_t i = 0;; i++) {
uint32_t status = read32(mmio + PCH_PP_STATUS);
if (!(status & PANEL_POWER_CYCLE_ACTIVE))
break;
if (i == panel_cfg->cycle_delay_ms) {
printk(BIOS_ERR, "Panel power cycle is still active.\n");
break;
}
mdelay(1);
}
}
/* UPD parameters to be initialized before SiliconInit */ /* UPD parameters to be initialized before SiliconInit */
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
{ {
@ -1214,6 +1257,8 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
config = config_of_soc(); config = config_of_soc();
soc_silicon_init_params(s_cfg, config); soc_silicon_init_params(s_cfg, config);
mainboard_silicon_init_params(s_cfg); mainboard_silicon_init_params(s_cfg);
wait_for_panel_power_cycle_done(config);
} }
/* /*

View File

@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* SPDX-License-Identifier: GPL-2.0-or-later */
#include <delay.h>
#include <device/pci.h> #include <device/pci.h>
#include <drivers/intel/gma/libgfxinit.h> #include <drivers/intel/gma/libgfxinit.h>
#include <intelblocks/early_graphics.h> #include <intelblocks/early_graphics.h>
@ -44,20 +43,4 @@ void early_graphics_stop(void)
return; return;
gma_gfxstop(); gma_gfxstop();
/*
* Temporary workaround
*
* It has been reported that the PEIM graphics driver may temporarily
* fail communication with the display if the time between libgfxinit
* turning off the displays and the PEIM driver initialization is too
* short. 200 ms has been identified as a safe delay.
*
* An investigation is in progress to come up with a better and long
* term solution.
*
* BUG:b:264526798
*/
if (CONFIG(RUN_FSP_GOP))
mdelay(200);
} }