soc/intel/early_graphics: support to allow early graphics GPIO config

For early Sign of Life to work, we may need certain pin configurations
very early in boot (e.g. HDMI).  This may happen before romstage GPIOs
are configured, and bootblock is not suitable for field upgrading
existing devices.  Add a separate GPIO table that can be configured
when early graphics is invoked.

BUG=b:277861633
BRANCH=firmware-brya-14505.B
TEST=Builds and SoL functions on HDMI enabled variants

Change-Id: I7b3ce96a4166451e72aa70b3086eff3fb8b082b7
Signed-off-by: Tarun Tuli <taruntuli@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74697
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
This commit is contained in:
Tarun Tuli 2023-05-04 12:41:13 +00:00 committed by Felix Held
parent 6711731818
commit 33c666587a
2 changed files with 16 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#include <device/pci.h>
#include <drivers/intel/gma/libgfxinit.h>
#include <intelblocks/early_graphics.h>
#include <soc/gpio.h>
#include <soc/pci_devs.h>
static void device_init(void)
@ -20,9 +21,17 @@ static void device_init(void)
(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
}
__weak const struct pad_config *variant_early_graphics_gpio_table(size_t *num)
{
*num = 0;
return NULL;
}
bool early_graphics_init(void)
{
int ret;
const struct pad_config *pads;
size_t pads_num;
if (!CONFIG(MAINBOARD_USE_EARLY_LIBGFXINIT))
return false;
@ -30,6 +39,10 @@ bool early_graphics_init(void)
/* Perform minimal graphic MMIO configuration. */
device_init();
/* Optionally configure any required display related GPIOs */
pads = variant_early_graphics_gpio_table(&pads_num);
gpio_configure_pads(pads, pads_num);
/* Configure display panel. */
early_graphics_soc_panel_init();

View File

@ -25,4 +25,7 @@ bool early_graphics_init(void);
/* Clear graphics configuration, turn off the displays. */
void early_graphics_stop(void);
/* Allow early configuration of any display related GPIOs as needed */
const struct pad_config *variant_early_graphics_gpio_table(size_t *num);
#endif /* SOC_INTEL_COMMON_BLOCK_GRAPHICS_EARLY_H */