aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/i945/gma.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-04-26 19:46:35 +0200
committerNico Huber <nico.h@gmx.de>2020-05-27 21:35:16 +0000
commitdd597627295e0063e29ba43a0b2d6fdefb12c2c6 (patch)
tree05dc1402dd060b24e77ed4ce95b2ac21c6aa3e19 /src/northbridge/intel/i945/gma.c
parentdfdf102000584e38952122c74858e46fa69acc60 (diff)
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>
Diffstat (limited to 'src/northbridge/intel/i945/gma.c')
-rw-r--r--src/northbridge/intel/i945/gma.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index 71ed4c42ea..183c8f5b59 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -660,8 +660,6 @@ static void gma_ngi(struct device *const dev)
static void gma_func0_init(struct device *dev)
{
- u32 reg32;
-
intel_gma_init_igd_opregion();
/* Unconditionally reset graphics */
@@ -672,9 +670,8 @@ static void gma_func0_init(struct device *dev)
while (pci_read_config8(dev, GDRST) & 1)
;
- /* IGD needs to be Bus Master */
- reg32 = pci_read_config32(dev, PCI_COMMAND);
- pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER);
+ if (!CONFIG(NO_GFX_INIT))
+ pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
if (CONFIG(MAINBOARD_DO_NATIVE_VGA_INIT)) {
int vga_disable = (pci_read_config16(dev, GGC) & 2) >> 1;
@@ -713,12 +710,10 @@ static void gma_func0_disable(struct device *dev)
static void gma_func1_init(struct device *dev)
{
- u32 reg32;
u8 val;
- /* IGD needs to be Bus Master */
- reg32 = pci_read_config32(dev, PCI_COMMAND);
- pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER);
+ if (!CONFIG(NO_GFX_INIT))
+ pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
if (get_option(&val, "tft_brightness") == CB_SUCCESS)
pci_write_config8(dev, 0xf4, val);