aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/i945/gma.c
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2020-06-08 12:09:03 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-06-10 18:49:18 +0000
commite3c68d2e1bc21dbd5b47925959779aeb57c4a538 (patch)
treefe1017531e57e65291ed9723f3cff31e657a1a4d /src/northbridge/intel/i945/gma.c
parentc803f65206188ca74526054c54bce4f405a55850 (diff)
nb/intel/i945: Use PCI bitwise ops
Tested with BUILD_TIMELESS=1, Getac P470 does not change. Change-Id: I181f69372829cf712fd72887b5f2c7134bfcf15a Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42190 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> 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, 3 insertions, 10 deletions
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index 34d129d502..929968e384 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -701,9 +701,7 @@ static void gma_func0_disable(struct device *dev)
pci_write_config16(dev, GCFC, 0xa00);
pci_write_config16(dev_host, GGC, (1 << 1));
- unsigned int reg32 = pci_read_config32(dev_host, DEVEN);
- reg32 &= ~(DEVEN_D2F0 | DEVEN_D2F1);
- pci_write_config32(dev_host, DEVEN, reg32);
+ pci_and_config32(dev_host, DEVEN, ~(DEVEN_D2F0 | DEVEN_D2F1));
dev->enabled = 0;
}
@@ -730,13 +728,8 @@ static void gma_generate_ssdt(const struct device *device)
static void gma_func0_read_resources(struct device *dev)
{
- u8 reg8;
-
- /* Set Untrusted Aperture Size to 256mb */
- reg8 = pci_read_config8(dev, MSAC);
- reg8 &= ~0x3;
- reg8 |= 0x2;
- pci_write_config8(dev, MSAC, reg8);
+ /* Set Untrusted Aperture Size to 256MB */
+ pci_update_config8(dev, MSAC, ~0x3, 0x2);
pci_dev_read_resources(dev);
}