soc/intel/apollolake: Fix MMIO reserved ranges calculation

mmio_resource() takes memory address in kilobytes. This patch
adds resources properly.

Change-Id: Id78dcecf05ad5b2c84e5bb5445ae3a4e4ec9d419
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14203
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Andrey Petrov 2016-03-30 18:15:30 -07:00 committed by Martin Roth
parent 808a9c223d
commit 15c736be05
1 changed files with 6 additions and 4 deletions

View File

@ -30,13 +30,15 @@ static uint32_t get_bar(device_t dev, unsigned int index)
static int mc_add_fixed_mmio_resources(device_t dev, int index)
{
unsigned long addr;
/* PCI extended config region */
mmio_resource(dev, index++, ALIGN_DOWN(get_bar(dev, PCIEXBAR), 256*MiB),
PCIEX_SIZE / KiB);
addr = ALIGN_DOWN(get_bar(dev, PCIEXBAR), 256*MiB) / KiB;
mmio_resource(dev, index++, addr, PCIEX_SIZE / KiB);
/* Memory Controller Hub */
mmio_resource(dev, index++, ALIGN_DOWN(get_bar(dev, MCHBAR), 32*KiB),
MCH_BASE_SIZE / KiB);
addr = ALIGN_DOWN(get_bar(dev, MCHBAR), 32*KiB) / KiB;
mmio_resource(dev, index++, addr, MCH_BASE_SIZE / KiB);
return index;
}