From 7adfe80469e32e10db0387b395c16d6494a0cd8e Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Fri, 26 Mar 2021 12:20:46 +0100 Subject: [PATCH] nb/intel/haswell: Replace `DMIBAR64` and `EPBAR64` While 64-bit writes seem to work properly, there could be unknown side-effects in some cases, e.g. when running in long mode. Since reference code uses two 32-bit writes, follow suit. Change-Id: I48ed3d94c7865b3a3cce52108e99cf1656b57fc2 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/51855 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/northbridge/intel/haswell/haswell.h | 4 ---- src/northbridge/intel/haswell/northbridge.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/northbridge/intel/haswell/haswell.h b/src/northbridge/intel/haswell/haswell.h index 2001f7b038..a37238fef7 100644 --- a/src/northbridge/intel/haswell/haswell.h +++ b/src/northbridge/intel/haswell/haswell.h @@ -82,16 +82,12 @@ * EPBAR - Egress Port Root Complex Register Block */ -#define EPBAR64(x) (*((volatile u64 *)((uintptr_t)CONFIG_FIXED_EPBAR_MMIO_BASE + (x)))) - #include "registers/epbar.h" /* * DMIBAR */ -#define DMIBAR64(x) (*((volatile u64 *)((uintptr_t)CONFIG_FIXED_DMIBAR_MMIO_BASE + (x)))) - #include "registers/dmibar.h" #ifndef __ASSEMBLER__ diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c index ab42e721d1..3494422438 100644 --- a/src/northbridge/intel/haswell/northbridge.c +++ b/src/northbridge/intel/haswell/northbridge.c @@ -469,7 +469,8 @@ static void northbridge_topology_init(void) reg32 &= ~(0xff << 16); reg32 |= 1 | (1 << 16); EPBAR32(EPLE1D) = reg32; - EPBAR64(EPLE1A) = CONFIG_FIXED_DMIBAR_MMIO_BASE; + EPBAR32(EPLE1A) = CONFIG_FIXED_DMIBAR_MMIO_BASE; + EPBAR32(EPLE1A + 4) = 0; for (unsigned int i = 0; i <= 2; i++) { const struct device *const dev = pcidev_on_root(1, i); @@ -477,7 +478,8 @@ static void northbridge_topology_init(void) if (!dev || !dev->enabled) continue; - EPBAR64(eple_a[i]) = (u64)PCI_DEV(0, 1, i); + EPBAR32(eple_a[i]) = (u32)PCI_DEV(0, 1, i); + EPBAR32(eple_a[i] + 4) = 0; reg32 = EPBAR32(eple_d[i]); reg32 &= ~(0xff << 16); @@ -503,9 +505,11 @@ static void northbridge_topology_init(void) reg32 &= ~(0xffff << 16); reg32 |= 1 | (2 << 16); DMIBAR32(DMILE1D) = reg32; - DMIBAR64(DMILE1A) = CONFIG_FIXED_RCBA_MMIO_BASE; + DMIBAR32(DMILE1A) = CONFIG_FIXED_RCBA_MMIO_BASE; + DMIBAR32(DMILE1A + 4) = 0; - DMIBAR64(DMILE2A) = CONFIG_FIXED_EPBAR_MMIO_BASE; + DMIBAR32(DMILE2A) = CONFIG_FIXED_EPBAR_MMIO_BASE; + DMIBAR32(DMILE2A + 4) = 0; reg32 = DMIBAR32(DMILE2D); reg32 &= ~(0xff << 16); reg32 |= 1 | (1 << 16);