aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/graphics
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-04-26 20:37:32 +0200
committerNico Huber <nico.h@gmx.de>2020-05-27 21:35:29 +0000
commitdd274e2971ff128742e362daef65181dc2818aaa (patch)
tree12baa9f4f93344ba846ef82f0eebb6f3d2796253 /src/soc/intel/common/block/graphics
parentdd597627295e0063e29ba43a0b2d6fdefb12c2c6 (diff)
soc/intel/gma: Move DDI-A 4-lane config to common code
Change-Id: I0572dbbfb61e5e0129fe6a3a1b5894145d74fd0d Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40728 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block/graphics')
-rw-r--r--src/soc/intel/common/block/graphics/Kconfig5
-rw-r--r--src/soc/intel/common/block/graphics/graphics.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/graphics/Kconfig b/src/soc/intel/common/block/graphics/Kconfig
index 4ab92001c3..e632cb9bb0 100644
--- a/src/soc/intel/common/block/graphics/Kconfig
+++ b/src/soc/intel/common/block/graphics/Kconfig
@@ -2,3 +2,8 @@ config SOC_INTEL_COMMON_BLOCK_GRAPHICS
bool
help
Intel Processor common Graphics support
+
+config SOC_INTEL_CONFIGURE_DDI_A_4_LANES
+ bool
+ help
+ Selected by platforms that require DDI-A bifurcation setup.
diff --git a/src/soc/intel/common/block/graphics/graphics.c b/src/soc/intel/common/block/graphics/graphics.c
index ba4bc85a22..e2c90600ac 100644
--- a/src/soc/intel/common/block/graphics/graphics.c
+++ b/src/soc/intel/common/block/graphics/graphics.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <acpi/acpi.h>
#include <assert.h>
#include <bootmode.h>
#include <console/console.h>
@@ -34,6 +35,13 @@ static void gma_init(struct device *const dev)
/* SoC specific configuration. */
graphics_soc_init(dev);
+ if (CONFIG(SOC_INTEL_CONFIGURE_DDI_A_4_LANES) && !acpi_is_wakeup_s3()) {
+ const u32 ddi_buf_ctl = graphics_gtt_read(DDI_BUF_CTL_A);
+ /* Only program if the buffer is not enabled yet. */
+ if (!(ddi_buf_ctl & DDI_BUF_CTL_ENABLE))
+ graphics_gtt_write(DDI_BUF_CTL_A, ddi_buf_ctl | DDI_A_4_LANES);
+ }
+
/*
* GFX PEIM module inside FSP binary is taking care of graphics
* initialization based on RUN_FSP_GOP Kconfig option and input