summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ec/google/wilco/chip.c2
-rw-r--r--src/northbridge/intel/haswell/northbridge.c8
-rw-r--r--src/northbridge/intel/x4x/northbridge.c2
-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
6 files changed, 14 insertions, 21 deletions
diff --git a/src/ec/google/wilco/chip.c b/src/ec/google/wilco/chip.c
index 911eb25074..2243004fda 100644
--- a/src/ec/google/wilco/chip.c
+++ b/src/ec/google/wilco/chip.c
@@ -161,9 +161,9 @@ static void wilco_ec_resource(struct device *dev, int index,
size_t base, size_t size)
{
struct resource *res = new_resource(dev, index);
- res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
res->base = base;
res->size = size;
+ res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
}
static void wilco_ec_read_resources(struct device *dev)
diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c
index 606461b4e7..a1bd143dd2 100644
--- a/src/northbridge/intel/haswell/northbridge.c
+++ b/src/northbridge/intel/haswell/northbridge.c
@@ -106,11 +106,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));
@@ -298,7 +298,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 * MiB;
- resource->size = mc_values[BGSM_REG] - resource->base;
+ resource->size = mc_values[BGSM_REG] - (mc_values[TSEG_REG] - dpr.size * MiB);
resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED | IORESOURCE_STORED |
IORESOURCE_RESERVE | IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;
@@ -306,7 +306,7 @@ static void mc_add_dram_resources(struct device *dev, int *resource_cnt)
if (mc_values[BGSM_REG] != mc_values[TOLUD_REG]) {
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/northbridge/intel/x4x/northbridge.c b/src/northbridge/intel/x4x/northbridge.c
index 5b61224b55..8a104a811a 100644
--- a/src/northbridge/intel/x4x/northbridge.c
+++ b/src/northbridge/intel/x4x/northbridge.c
@@ -72,7 +72,7 @@ static void mch_domain_read_resources(struct device *dev)
/* cbmem_top can be shifted downwards due to alignment.
Mark the region between cbmem_top and tomk as unusable */
- delta_cbmem = tomk - ((uint32_t)(uintptr_t)cbmem_top() >> 10);
+ delta_cbmem = tomk - ((uintptr_t)cbmem_top() >> 10);
tomk -= delta_cbmem;
uma_sizek += delta_cbmem;
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 */