diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2022-05-26 19:03:55 +0300 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-06-24 19:51:12 +0000 |
commit | 4e4edf7d60b5206e1ad442b05d4d0b607c2131fb (patch) | |
tree | ca4842b726972665a53dac570aab6b6fef266120 /src/soc/intel/broadwell | |
parent | 2a167ffbbfc82e552c8804069986c1091f747105 (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/broadwell')
-rw-r--r-- | src/soc/intel/broadwell/northbridge.c | 8 |
1 files changed, 4 insertions, 4 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; |