summaryrefslogtreecommitdiff
path: root/src/mainboard/google/dedede
diff options
context:
space:
mode:
authorSeunghwan Kim <sh_.kim@samsung.corp-partner.google.com>2021-12-17 15:57:52 +0900
committerTim Wawrzynczak <twawrzynczak@chromium.org>2022-01-03 21:15:07 +0000
commit1106bcce0df6569a93a36a02326e1eb34b181068 (patch)
tree388be0758486fe96d43a1b80abfeff2e04f7f49c /src/mainboard/google/dedede
parent2a4858afed4c8618182a78a6de965d1cad6e8630 (diff)
mb/google/dedede/var/bugzzy: Initialize display signals on user mode
Bugzzy uses panel-built-in touch screen, it needs to set panel power and reset signal to high for touch screen to work. On user mode, coreboot doesn't initialize graphics since there is no screen display before OS. So we would add a WA to initialize required signals on user mode. It takes under 30 ms delay on booting time. BUG=b:205496327 BRANCH=dedede TEST=Verified touch screen worked with test coreboot and test touch screen 028D firmware Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com> Change-Id: Iaa4d16deb932f43ae1ab33ff5b4e74120ab670db Reviewed-on: https://review.coreboot.org/c/coreboot/+/60190 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/dedede')
-rw-r--r--src/mainboard/google/dedede/variants/bugzzy/Makefile.inc1
-rw-r--r--src/mainboard/google/dedede/variants/bugzzy/ramstage.c59
2 files changed, 60 insertions, 0 deletions
diff --git a/src/mainboard/google/dedede/variants/bugzzy/Makefile.inc b/src/mainboard/google/dedede/variants/bugzzy/Makefile.inc
index fd60a18b69..74121943dd 100644
--- a/src/mainboard/google/dedede/variants/bugzzy/Makefile.inc
+++ b/src/mainboard/google/dedede/variants/bugzzy/Makefile.inc
@@ -1,5 +1,6 @@
## SPDX-License-Identifier: GPL-2.0-or-later
ramstage-y += gpio.c
+ramstage-y += ramstage.c
smm-y += variant.c
diff --git a/src/mainboard/google/dedede/variants/bugzzy/ramstage.c b/src/mainboard/google/dedede/variants/bugzzy/ramstage.c
new file mode 100644
index 0000000000..7844b6e360
--- /dev/null
+++ b/src/mainboard/google/dedede/variants/bugzzy/ramstage.c
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <bootstate.h>
+#include <arch/mmio.h>
+#include <delay.h>
+#include <bootmode.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <soc/pci_devs.h>
+#include <drivers/intel/gma/i915_reg.h>
+
+static void panel_power_on(uintptr_t igd_bar)
+{
+ setbits32((void *)(igd_bar + PCH_PP_CONTROL), PANEL_POWER_ON);
+}
+
+static void panel_reset_assert(uintptr_t igd_bar)
+{
+ clrsetbits32((void *)(igd_bar + PCH_GPIOB),
+ GPIO_CLOCK_VAL_OUT,
+ GPIO_CLOCK_DIR_MASK | GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_VAL_MASK);
+}
+
+static void panel_reset_deassert(uintptr_t igd_bar)
+{
+ const uint32_t data32 = GPIO_CLOCK_VAL_OUT |
+ GPIO_CLOCK_DIR_MASK | GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_VAL_MASK;
+ setbits32((void *)(igd_bar + PCH_GPIOB), data32);
+}
+
+/*
+ * Bugzzy uses panel-built-in touch screen, it needs to set panel power and
+ * reset signal to high for touch screen to work.
+ * On user mode, coreboot doesn't initialize graphics since there is no screen
+ * display before OS. We would add this WA to initialize required signals on
+ * user mode.
+ */
+static void wa_init_display_signal(void *unused)
+{
+ struct device *igd_dev = pcidev_path_on_root(SA_DEVFN_IGD);
+ uintptr_t igd_bar;
+
+ if (display_init_required() || !igd_dev)
+ return;
+
+ igd_bar = find_resource(igd_dev, PCI_BASE_ADDRESS_0)->base;
+ if (!igd_bar)
+ return;
+
+ panel_power_on(igd_bar);
+ mdelay(20);
+ panel_reset_deassert(igd_bar);
+ mdelay(2);
+ panel_reset_assert(igd_bar);
+ mdelay(2);
+ panel_reset_deassert(igd_bar);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, wa_init_display_signal, NULL);