Attention is currently required from: SH Kim. Hello SH Kim,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/60190
to review the following change.
Change subject: mb/google/dedede/var/bugzzy: Initialize display signals on user mode ......................................................................
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.
BUG=b:205496327 BRANCH=dedede TEST=built firmware and verified touch screen worked.
Signed-off-by: Seunghwan Kim sh_.kim@samsung.corp-partner.google.com Change-Id: Iaa4d16deb932f43ae1ab33ff5b4e74120ab670db --- M src/mainboard/google/dedede/variants/bugzzy/Makefile.inc A src/mainboard/google/dedede/variants/bugzzy/ramstage.c 2 files changed, 81 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/60190/1
diff --git a/src/mainboard/google/dedede/variants/bugzzy/Makefile.inc b/src/mainboard/google/dedede/variants/bugzzy/Makefile.inc index fd60a18..7412194 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 0000000..5998c9b --- /dev/null +++ b/src/mainboard/google/dedede/variants/bugzzy/ramstage.c @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <bootstate.h> +#include <arch/mmio.h> +#include <baseboard/variants.h> +#include <delay.h> +#include <gpio.h> +#include <console/console.h> +#include <bootmode.h> + +# define GPIO_CLOCK_VAL_OUT (1 << 3) +# define GPIO_CLOCK_DIR_MASK (1 << 0) +# define GPIO_CLOCK_DIR_OUT (1 << 1) +# define GPIO_CLOCK_VAL_MASK (1 << 2) + +/* + * 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) +{ + uint32_t addr32; + uint32_t data32; + uint32_t mmio32; + + if (display_init_required()) + return; + + addr32 = 0xc0010000; // IGD MMIO BASE + data32 = read32((void *) addr32); + addr32 = 0xc0010010; + data32 = read32((void *) addr32); + data32 = data32 & 0xfffffff0; // clear bit3 ~ bit0 + mmio32 = data32; + + // power on + data32 = mmio32; + addr32 = data32 + 0xc7204; + data32 = read32((void *) addr32); + data32 = data32 | 0x1; + write32((void *)addr32, data32); + + udelay(20 * 1000); // delay 20ms + + //reset high + data32 = mmio32; + addr32 = data32 + 0xc5014; + data32 = read32((void *) addr32); + data32 |= GPIO_CLOCK_VAL_OUT; + data32 |= GPIO_CLOCK_DIR_MASK | GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_VAL_MASK; + write32((void *)addr32, data32); + + udelay(2 * 1000); // delay 2ms + + //reset low + data32 = mmio32; + addr32 = data32 + 0xc5014; + data32 = read32((void *) addr32); + data32 &= ~GPIO_CLOCK_VAL_OUT; + data32 |= GPIO_CLOCK_DIR_MASK | GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_VAL_MASK; + write32((void *)addr32, data32); + + udelay(2 * 1000); // delay 2ms + + //reset high + data32 = mmio32; + addr32 = data32 + 0xc5014; + data32 = read32((void *) addr32); + data32 |= GPIO_CLOCK_VAL_OUT; + data32 |= GPIO_CLOCK_DIR_MASK | GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_VAL_MASK; + write32((void *)addr32, data32); + + udelay(60 * 1000); // delay 60ms +} + +BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, wa_init_display_signal, NULL);