From 9a7198392a2d98cdc7ba3d6d454de29751afb25f Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 5 Jul 2023 10:57:30 +0200 Subject: nb/e7505: Rework nb resource reading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use newer functions and avoid the * / KiB dance - Use existing functions for figuring out TSEG and UMA - Don't have resources overlap Signed-off-by: Arthur Heymans Change-Id: Ia8562660cf69d188b0cab4869aa3190f014dbfdc Reviewed-on: https://review.coreboot.org/c/coreboot/+/76276 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/northbridge/intel/e7505/northbridge.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/northbridge/intel/e7505') diff --git a/src/northbridge/intel/e7505/northbridge.c b/src/northbridge/intel/e7505/northbridge.c index a353759d3b..b51b2ab5c4 100644 --- a/src/northbridge/intel/e7505/northbridge.c +++ b/src/northbridge/intel/e7505/northbridge.c @@ -6,13 +6,13 @@ #include #include #include +#include #include "e7505.h" static void mch_domain_read_resources(struct device *dev) { int idx; - unsigned long tolmk; uint64_t tom, remapbase, remaplimit; struct device *mc_dev; @@ -22,9 +22,6 @@ static void mch_domain_read_resources(struct device *dev) if (!mc_dev) die("Could not find MCH device\n"); - tolmk = pci_read_config16(mc_dev, TOLM) >> 11; - tolmk <<= 17; - tom = pci_read_config8(mc_dev, DRB_ROW_7); tom <<= 26; @@ -39,12 +36,15 @@ static void mch_domain_read_resources(struct device *dev) /* Report the memory regions */ idx = 10; - ram_resource_kb(dev, idx++, 0, tolmk); - mmio_resource_kb(dev, idx++, 0xa0000 / KiB, (0xc0000 - 0xa0000) / KiB); - - uintptr_t tseg_memory_base = northbridge_get_tseg_base(); - size_t tseg_memory_size = northbridge_get_tseg_size(); - mmio_resource_kb(dev, idx++, tseg_memory_base / KiB, tseg_memory_size / KiB); + ram_range(dev, idx++, 0, 0xa0000); + mmio_from_to(dev, idx++, 0xa0000, 0xc0000); + ram_from_to(dev, idx++, 0xc0000, 1 * MiB); + + uintptr_t tseg_base; + size_t tseg_size; + smm_region(&tseg_base, &tseg_size); + ram_from_to(dev, idx++, 1 * MiB, tseg_base); + mmio_range(dev, idx++, tseg_base, tseg_size); ASSERT(tom == remapbase); upper_ram_end(dev, idx++, remaplimit); -- cgit v1.2.3