summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-05-26 19:03:55 +0300
committerFelix Held <felix-coreboot@felixheld.de>2022-06-24 19:51:12 +0000
commit4e4edf7d60b5206e1ad442b05d4d0b607c2131fb (patch)
treeca4842b726972665a53dac570aab6b6fef266120 /src/soc/intel
parent2a167ffbbfc82e552c8804069986c1091f747105 (diff)
device/resource: Modify some resource allocation instances
These changes made my crude pattern matching work with coccinelle simpler. Change-Id: I83f3ef38b8663640594b4d726838f7a6f96a58a2 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64698 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/broadwell/northbridge.c8
-rw-r--r--src/soc/intel/denverton_ns/lpc.c4
-rw-r--r--src/soc/intel/denverton_ns/systemagent.c11
3 files changed, 8 insertions, 15 deletions
diff --git a/src/soc/intel/broadwell/northbridge.c b/src/soc/intel/broadwell/northbridge.c
index 4825b8881f..4adf926d95 100644
--- a/src/soc/intel/broadwell/northbridge.c
+++ b/src/soc/intel/broadwell/northbridge.c
@@ -129,11 +129,11 @@ static void mc_add_fixed_mmio_resources(struct device *dev)
continue;
resource = new_resource(dev, mc_fixed_resources[i].index);
+ resource->base = base;
+ resource->size = size;
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
IORESOURCE_STORED | IORESOURCE_RESERVE |
IORESOURCE_ASSIGNED;
- resource->base = base;
- resource->size = size;
printk(BIOS_DEBUG, "%s: Adding %s @ %x 0x%08lx-0x%08lx.\n",
__func__, mc_fixed_resources[i].description, index,
(unsigned long)base, (unsigned long)(base + size - 1));
@@ -328,7 +328,7 @@ static void mc_add_dram_resources(struct device *dev, int *resource_cnt)
/* TSEG - DPR -> BGSM */
resource = new_resource(dev, index++);
resource->base = mc_values[TSEG_REG] - dpr_size;
- resource->size = mc_values[BGSM_REG] - resource->base;
+ resource->size = mc_values[BGSM_REG] - (mc_values[TSEG_REG] - dpr_size);
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
IORESOURCE_STORED | IORESOURCE_RESERVE |
IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;
@@ -336,7 +336,7 @@ static void mc_add_dram_resources(struct device *dev, int *resource_cnt)
/* BGSM -> TOLUD */
resource = new_resource(dev, index++);
resource->base = mc_values[BGSM_REG];
- resource->size = mc_values[TOLUD_REG] - resource->base;
+ resource->size = mc_values[TOLUD_REG] - mc_values[BGSM_REG];
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
IORESOURCE_STORED | IORESOURCE_RESERVE |
IORESOURCE_ASSIGNED;
diff --git a/src/soc/intel/denverton_ns/lpc.c b/src/soc/intel/denverton_ns/lpc.c
index 38df89261e..1fc1ea35c7 100644
--- a/src/soc/intel/denverton_ns/lpc.c
+++ b/src/soc/intel/denverton_ns/lpc.c
@@ -405,10 +405,6 @@ static void pci_p2sb_read_resources(struct device *dev)
res->size = 16 * 1024 * 1024; /* 16MB PCR config space */
res->flags = IORESOURCE_MEM | IORESOURCE_FIXED | IORESOURCE_STORED |
IORESOURCE_ASSIGNED;
- printk(BIOS_DEBUG,
- "Adding P2SB PCR config space BAR 0x%08lx-0x%08lx.\n",
- (unsigned long)(res->base),
- (unsigned long)(res->base + res->size));
/* Add MMIO resource
* Use 0xdb as an unused index for IOAPIC.
diff --git a/src/soc/intel/denverton_ns/systemagent.c b/src/soc/intel/denverton_ns/systemagent.c
index 774ab2d5d9..116dc90089 100644
--- a/src/soc/intel/denverton_ns/systemagent.c
+++ b/src/soc/intel/denverton_ns/systemagent.c
@@ -104,11 +104,11 @@ static void mc_add_fixed_mmio_resources(struct device *dev)
continue;
resource = new_resource(dev, mc_fixed_resources[i].index);
+ resource->base = base;
+ resource->size = size;
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
IORESOURCE_STORED | IORESOURCE_RESERVE |
IORESOURCE_ASSIGNED;
- resource->base = base;
- resource->size = size;
printk(BIOS_DEBUG, "%s: Adding %s @ %x 0x%08lx-0x%08lx.\n",
__func__, mc_fixed_resources[i].description, index,
(unsigned long)base, (unsigned long)(base + size - 1));
@@ -248,7 +248,7 @@ static void mc_add_dram_resources(struct device *dev)
/* top_of_ram -> TSEG */
resource = new_resource(dev, index++);
resource->base = top_of_ram;
- resource->size = mc_values[TSEG_REG] - resource->base;
+ resource->size = mc_values[TSEG_REG] - top_of_ram;
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
IORESOURCE_STORED | IORESOURCE_RESERVE |
IORESOURCE_ASSIGNED;
@@ -256,13 +256,10 @@ static void mc_add_dram_resources(struct device *dev)
/* TSEG -> TOLUD */
resource = new_resource(dev, index++);
resource->base = mc_values[TSEG_REG];
- resource->size = mc_values[TOLUD_REG] - resource->base;
+ resource->size = mc_values[TOLUD_REG] - mc_values[TSEG_REG];
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
IORESOURCE_STORED | IORESOURCE_RESERVE |
IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;
- printk(BIOS_DEBUG,
- "SMM memory location: 0x%llx SMM memory size: 0x%llx\n",
- resource->base, resource->size);
/* 4GiB -> TOUUD */
base_k = 4096 * 1024; /* 4GiB */