summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2021-02-26 09:32:15 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-03-01 08:27:14 +0000
commita8f76904fbd2edf09807ee21afeae0fea8510d7f (patch)
treec47e7c4f241d22a7a389e92d0232ed48a2416552
parentd40a4c2bb4d237c174ef11ad73afc5a67ed555e7 (diff)
nb/intel/haswell: Fix DPR size handling
DPR register's size field is given in whole MiB, so correct where it is used to ensure the correct size multiple (KiB vs. MiB) is used with it. Fixes: 5d7c3a4f0 ("nb/intel/haswell/northbridge.c: Correct DPR handling") Change-Id: I3ca388907c61f1e47eab44ae8bc26e0f611fe1e3 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51104 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/northbridge/intel/haswell/northbridge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c
index df9cc184d1..b19e7bd8b5 100644
--- a/src/northbridge/intel/haswell/northbridge.c
+++ b/src/northbridge/intel/haswell/northbridge.c
@@ -298,12 +298,12 @@ static void mc_add_dram_resources(struct device *dev, int *resource_cnt)
/* 0xc0000 -> TSEG - DPR */
base_k = 0xc0000 >> 10;
size_k = (unsigned long)(mc_values[TSEG_REG] >> 10) - base_k;
- size_k -= dpr.size >> 10;
+ size_k -= dpr.size * MiB / KiB;
ram_resource(dev, index++, base_k, size_k);
/* TSEG - DPR -> BGSM */
resource = new_resource(dev, index++);
- resource->base = mc_values[TSEG_REG] - dpr.size;
+ resource->base = mc_values[TSEG_REG] - dpr.size * MiB;
resource->size = mc_values[BGSM_REG] - resource->base;
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED | IORESOURCE_STORED |
IORESOURCE_RESERVE | IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;