diff options
author | Tarun Tuli <taruntuli@google.com> | 2023-05-04 12:41:13 +0000 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-05-08 13:13:34 +0000 |
commit | 33c666587a77608abe6b387fe97fc99a1681d24c (patch) | |
tree | c98b8557a6a05469ce37d565526bd25e1927523b /src/soc | |
parent | 6711731818d0b0fd246bbecb5be9d64671fbd6eb (diff) |
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>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/common/block/graphics/early_graphics.c | 13 | ||||
-rw-r--r-- | src/soc/intel/common/block/include/intelblocks/early_graphics.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/graphics/early_graphics.c b/src/soc/intel/common/block/graphics/early_graphics.c index 81faede2fa..c8a1d84174 100644 --- a/src/soc/intel/common/block/graphics/early_graphics.c +++ b/src/soc/intel/common/block/graphics/early_graphics.c @@ -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(); diff --git a/src/soc/intel/common/block/include/intelblocks/early_graphics.h b/src/soc/intel/common/block/include/intelblocks/early_graphics.h index c0313cf960..55aa9640d2 100644 --- a/src/soc/intel/common/block/include/intelblocks/early_graphics.h +++ b/src/soc/intel/common/block/include/intelblocks/early_graphics.h @@ -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 */ |