summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-06-28 21:43:31 +0300
committerFelix Held <felix-coreboot@felixheld.de>2022-07-05 13:08:34 +0000
commit0a18d64d00a9fcfd096c14f28e7b4d62bca0a829 (patch)
treec6574f70b348b215850e49f97236cd6038e31985 /src/soc
parente0ddbbb0d2f14300eb08561a508d767d92a6201a (diff)
nb,soc/intel: Handle upper RAM boundary
Change-Id: I2d99523647dfb43265db8f2701b525afd1870fc5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55929 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/baytrail/northcluster.c3
-rw-r--r--src/soc/intel/braswell/northcluster.c3
-rw-r--r--src/soc/intel/broadwell/northbridge.c7
-rw-r--r--src/soc/intel/common/block/systemagent/systemagent.c8
-rw-r--r--src/soc/intel/denverton_ns/systemagent.c7
5 files changed, 6 insertions, 22 deletions
diff --git a/src/soc/intel/baytrail/northcluster.c b/src/soc/intel/baytrail/northcluster.c
index 3d6cae9b61..ecfc3ff503 100644
--- a/src/soc/intel/baytrail/northcluster.c
+++ b/src/soc/intel/baytrail/northcluster.c
@@ -100,8 +100,7 @@ static void nc_read_resources(struct device *dev)
*/
bmbound_hi = iosf_bunit_read(BUNIT_BMBOUND_HI) & ~((1 << 24) - 1);
bmbound_hi <<= 4;
- if (bmbound_hi > 4ull * GiB)
- ram_from_to(dev, index++, 4ull * GiB, bmbound_hi);
+ upper_ram_end(dev, index++, bmbound_hi);
/*
* Reserve everything between A segment and 1MB:
diff --git a/src/soc/intel/braswell/northcluster.c b/src/soc/intel/braswell/northcluster.c
index 8337f50c32..63347ee471 100644
--- a/src/soc/intel/braswell/northcluster.c
+++ b/src/soc/intel/braswell/northcluster.c
@@ -116,8 +116,7 @@ static void nc_read_resources(struct device *dev)
*/
bmbound_hi = iosf_bunit_read(BUNIT_BMBOUND_HI) & ~((1 << 24) - 1);
bmbound_hi <<= 4;
- if (bmbound_hi > 4ull * GiB)
- ram_from_to(dev, index++, 4ull * GiB, bmbound_hi);
+ upper_ram_end(dev, index++, bmbound_hi);
/*
* Reserve everything between A segment and 1MB:
diff --git a/src/soc/intel/broadwell/northbridge.c b/src/soc/intel/broadwell/northbridge.c
index 4adf926d95..b65a7589b0 100644
--- a/src/soc/intel/broadwell/northbridge.c
+++ b/src/soc/intel/broadwell/northbridge.c
@@ -259,7 +259,6 @@ static void mc_report_map_entries(struct device *dev, uint64_t *values)
static void mc_add_dram_resources(struct device *dev, int *resource_cnt)
{
unsigned long base_k, size_k;
- unsigned long touud_k;
unsigned long index;
struct resource *resource;
uint64_t mc_values[NUM_MAP_ENTRIES];
@@ -342,11 +341,7 @@ static void mc_add_dram_resources(struct device *dev, int *resource_cnt)
IORESOURCE_ASSIGNED;
/* 4GiB -> TOUUD */
- base_k = 4096 * 1024; /* 4GiB */
- touud_k = mc_values[TOUUD_REG] >> 10;
- size_k = touud_k - base_k;
- if (touud_k > base_k)
- ram_resource_kb(dev, index++, base_k, size_k);
+ upper_ram_end(dev, index++, mc_values[TOUUD_REG]);
/* Reserve everything between A segment and 1MB:
*
diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c
index 04580c2569..1fbd8aa7f0 100644
--- a/src/soc/intel/common/block/systemagent/systemagent.c
+++ b/src/soc/intel/common/block/systemagent/systemagent.c
@@ -186,7 +186,7 @@ static void sa_get_mem_map(struct device *dev, uint64_t *values)
*/
static void sa_add_dram_resources(struct device *dev, int *resource_count)
{
- uintptr_t base_k, touud_k;
+ uintptr_t base_k;
size_t size_k;
uint64_t sa_map_values[MAX_MAP_ENTRIES];
uintptr_t top_of_ram;
@@ -212,11 +212,7 @@ static void sa_add_dram_resources(struct device *dev, int *resource_count)
mmio_resource_kb(dev, index++, base_k / KiB, size_k / KiB);
/* 4GiB -> TOUUD */
- base_k = 4 * (GiB / KiB); /* 4GiB */
- touud_k = sa_map_values[SA_TOUUD_REG] / KiB;
- size_k = touud_k - base_k;
- if (touud_k > base_k)
- ram_resource_kb(dev, index++, base_k, size_k);
+ upper_ram_end(dev, index++, sa_map_values[SA_TOUUD_REG]);
/*
* Reserve everything between A segment and 1MB:
diff --git a/src/soc/intel/denverton_ns/systemagent.c b/src/soc/intel/denverton_ns/systemagent.c
index 116dc90089..29953a6931 100644
--- a/src/soc/intel/denverton_ns/systemagent.c
+++ b/src/soc/intel/denverton_ns/systemagent.c
@@ -191,7 +191,6 @@ static void mc_report_map_entries(struct device *dev, uint64_t *values)
static void mc_add_dram_resources(struct device *dev)
{
unsigned long base_k, size_k;
- unsigned long touud_k;
unsigned long index;
struct resource *resource;
uint64_t mc_values[NUM_MAP_ENTRIES];
@@ -262,11 +261,7 @@ static void mc_add_dram_resources(struct device *dev)
IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;
/* 4GiB -> TOUUD */
- base_k = 4096 * 1024; /* 4GiB */
- touud_k = mc_values[TOUUD_REG] >> 10;
- size_k = touud_k - base_k;
- if (touud_k > base_k)
- ram_resource_kb(dev, index++, base_k, size_k);
+ upper_ram_end(dev, index++, mc_values[TOUUD_REG]);
/*
* Reserve everything between A segment and 1MB: