intel/gma: Only enable bus mastering if we are going to use it

Also fix wrong 32-bit writes.

Change-Id: Ib038f0cd558223536da08ba2264774db11cd8357
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40727
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Nico Huber
2020-04-26 19:46:35 +02:00
parent dfdf102000
commit dd59762729
9 changed files with 23 additions and 55 deletions

View File

@@ -585,18 +585,14 @@ static void gma_enable_swsci(void)
static void gma_func0_init(struct device *dev)
{
u32 reg32;
intel_gma_init_igd_opregion();
/* IGD needs to be Bus Master */
reg32 = pci_read_config32(dev, PCI_COMMAND);
reg32 |= PCI_COMMAND_MASTER;
pci_write_config32(dev, PCI_COMMAND, reg32);
/* Init graphics power management */
gma_pm_init_pre_vbios(dev);
if (!CONFIG(NO_GFX_INIT))
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
if (!CONFIG(MAINBOARD_USE_LIBGFXINIT))
/* PCI Init, will run VBIOS */
pci_dev_init(dev);