From 3c3e34d69fe4b185d4c0b698dfc6fcbf11b50dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 31 May 2014 11:32:54 +0300 Subject: i945: Use defines for DEVEN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I32461449354155510c0e14e9d0ce396068ea50d4 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/5890 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Idwer Vollering --- src/northbridge/intel/i945/early_init.c | 11 +++++------ src/northbridge/intel/i945/ram_calc.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/northbridge/intel') diff --git a/src/northbridge/intel/i945/early_init.c b/src/northbridge/intel/i945/early_init.c index 57232af140..a55ea05939 100644 --- a/src/northbridge/intel/i945/early_init.c +++ b/src/northbridge/intel/i945/early_init.c @@ -248,7 +248,7 @@ static void i945_setup_egress_port(void) } /* Is internal graphics enabled? */ - if (pci_read_config8(PCI_DEV(0, 0x0, 0), 0x54) & ((1 << 4) | (1 << 3))) { /* DEVEN */ + if (pci_read_config8(PCI_DEV(0, 0x0, 0), DEVEN) & (DEVEN_D2F0 | DEVEN_D2F1)) { MCHBAR32(MMARB1) |= (1 << 17); } @@ -431,7 +431,7 @@ static void i945_setup_dmi_rcrb(void) #endif DMIBAR32(0x204) = reg32; - if (pci_read_config8(PCI_DEV(0, 0x0, 0), 0x54) & ((1 << 4) | (1 << 3))) { /* DEVEN */ + if (pci_read_config8(PCI_DEV(0, 0x0, 0), DEVEN) & (DEVEN_D2F0 | DEVEN_D2F1)) { printk(BIOS_DEBUG, "Internal graphics: enabled\n"); DMIBAR32(0x200) |= (1 << 21); } else { @@ -649,10 +649,9 @@ static void i945_setup_pci_express_x16(void) reg16 = (1 << 1); pci_write_config16(PCI_DEV(0, 0x0, 0), 0x52, reg16); - /* DEVEN */ - reg32 = pci_read_config32(PCI_DEV(0, 0x0, 0), 0x54); - reg32 &= ~((1 << 3) | (1 << 4)); - pci_write_config32(PCI_DEV(0, 0x0, 0), 0x54, reg32); + reg32 = pci_read_config32(PCI_DEV(0, 0x0, 0), DEVEN); + reg32 &= ~(DEVEN_D2F0 | DEVEN_D2F1); + pci_write_config32(PCI_DEV(0, 0x0, 0), DEVEN, reg32); /* Set VGA enable bit in PCIe bridge */ reg16 = pci_read_config16(PCI_DEV(0, 0x1, 0), 0x3e); diff --git a/src/northbridge/intel/i945/ram_calc.c b/src/northbridge/intel/i945/ram_calc.c index 51eb0ff463..23e3f41fa4 100644 --- a/src/northbridge/intel/i945/ram_calc.c +++ b/src/northbridge/intel/i945/ram_calc.c @@ -28,7 +28,7 @@ unsigned long get_top_of_ram(void) { u32 tom; - if (pci_read_config8(PCI_DEV(0, 0x0, 0), DEVEN) & ((1 << 4) | (1 << 3))) { + if (pci_read_config8(PCI_DEV(0, 0x0, 0), DEVEN) & (DEVEN_D2F0 | DEVEN_D2F1)) { /* IGD enabled, get top of Memory from BSM register */ tom = pci_read_config32(PCI_DEV(0,2,0), BSM); } else { -- cgit v1.2.3