mb/siemens/mc_apl5: Disable IGD if no EDID data available

To avoid possible panel failures due to incorrect timing settings for
PTN3460, the internal graphic device should be disabled.

Change-Id: Ie0b9ed99fb78461bb48d6f2ff328643cd8c2cd15
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35242
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
This commit is contained in:
Mario Scheithauer 2019-09-04 09:40:44 +02:00 committed by Patrick Georgi
parent d5c8912f1e
commit f839052fe7
1 changed files with 25 additions and 0 deletions

View File

@ -16,9 +16,32 @@
#include <console/console.h> #include <console/console.h>
#include <hwilib.h> #include <hwilib.h>
#include <device/i2c_simple.h> #include <device/i2c_simple.h>
#include <device/pci_ops.h>
#include <soc/pci_devs.h>
#include <types.h> #include <types.h>
#include <variant/ptn3460.h> #include <variant/ptn3460.h>
static void igd_disable(void)
{
struct device *root_dev = pcidev_path_on_root(SA_DEVFN_ROOT);
uint8_t deven;
uint16_t ggc;
/* GMCH Graphics Control Register */
ggc = pci_read_config16(root_dev, 0x50);
/* Set size of Graphics Translation Table Memory (GGMS) [7:6]
* to 0 and select 0 MB for Graphics Memory (GMS) [15:8]. */
ggc &= ~(0xffc0);
/* Disable IGD VGA (IVD). */
ggc |= 0x2;
pci_write_config16(root_dev, 0x50, ggc);
/* Device Enable Register */
deven = pci_read_config8(root_dev, 0x54);
/* Disable IGD device (D2F0EN). */
deven &= ~(0x10);
pci_write_config8(root_dev, 0x54, deven);
}
/** /**
* This function sets up the DP2LVDS-converter to be used with the appropriate * This function sets up the DP2LVDS-converter to be used with the appropriate
* lcd panel. * lcd panel.
@ -42,6 +65,8 @@ int ptn3460_init(const char *hwi_block)
/* Get all needed information from hwinfo block. */ /* Get all needed information from hwinfo block. */
if (hwilib_get_field(Edid, edid_data, sizeof(edid_data)) != if (hwilib_get_field(Edid, edid_data, sizeof(edid_data)) !=
sizeof(edid_data)) { sizeof(edid_data)) {
/* Disable IGD to avoid panel failures. */
igd_disable();
printk(BIOS_ERR, "LCD: No EDID data available in %s\n", printk(BIOS_ERR, "LCD: No EDID data available in %s\n",
hwi_block); hwi_block);
return 1; return 1;