mb/google/nissa/var/meliks: Initialize display signals on user mode
Meliks 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.
Bugzzy has fixed the same issue, copied the WA code from bugzzy.
- 1106bcce0d: `bugzzy: Initialize display signals on user mode`
Reference: HX83121-A panel specification (Page 60 - 64):
https://drive.google.com/file/d/1Q0wjzHmSOa_r2FwiNe4PtKWmhhacBw4W/view?pli=1&resourcekey=0-pnGgp8yzf68UpyqNE1Caew
BUG=b:412584604, b:398703068
BRANCH=nissa
TEST=Verified touch screen worked with test coreboot without FW splash
screen. (crrev/c/6647126)
- A part of `cbmem -t` result before this change:
```
115:finished elog init 914,227 (2,679)
70:device setup done 915,121 (893)
...
1101:jumping to kernel 1,055,074 (9,849)
Total Time: 1,055,039
```
- A part of `cbmem -t` result after this change:
```
115:finished elog init 911,708 (2,674)
70:device setup done 936,680 (24,971)
...
1101:jumping to kernel 1,073,415 (9,360)
Total Time: 1,073,379
```
Change-Id: I92c7754cfbdf73e84a25b6d45b062ba9cafb04ab
Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88107
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
parent
f846ec1e37
commit
a60c5d205b
1 changed files with 57 additions and 1 deletions
|
|
@ -2,10 +2,17 @@
|
|||
|
||||
#define __SIMPLE_DEVICE__
|
||||
|
||||
#include <soc/ramstage.h>
|
||||
#include <bootmode.h>
|
||||
#include <bootstate.h>
|
||||
#include <delay.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include <device/mmio.h>
|
||||
#include <drivers/intel/gma/i915_reg.h>
|
||||
#include <soc/pci_devs.h>
|
||||
#include <soc/ramstage.h>
|
||||
|
||||
#define DPHY_0_CLOCK_LANE_TIMING 0x162180
|
||||
#define RESET_DPHY_0_CLOCK_LANE_TIMING 0
|
||||
|
|
@ -54,3 +61,52 @@ void mainboard_silicon_init_params(FSP_S_CONFIG *params)
|
|||
the HW default */
|
||||
reset_display_dphy_clock();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Meliks 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue