summaryrefslogtreecommitdiff
path: root/src/soc/amd/mendocino
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-07-05 12:15:51 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-07-18 21:00:03 +0000
commitb2de1a336855a4900245c7951c938e314f68b897 (patch)
tree4228d939b43f53676ed30f603b79ec71b23951d6 /src/soc/amd/mendocino
parent885efa1102fd39bb7d0558d6d0ad9d10284e1a72 (diff)
soc/amd/*/root_complex.c: Use newer function for resource declarations
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: If2048c9cade731b2e4464d0670e0578f5f4bcea0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76291 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/soc/amd/mendocino')
-rw-r--r--src/soc/amd/mendocino/root_complex.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/soc/amd/mendocino/root_complex.c b/src/soc/amd/mendocino/root_complex.c
index 5e1e11a431..cc21592e9e 100644
--- a/src/soc/amd/mendocino/root_complex.c
+++ b/src/soc/amd/mendocino/root_complex.c
@@ -163,28 +163,25 @@ static void read_resources(struct device *dev)
fixed_io_range_reserved(dev, idx++, PCI_IO_CONFIG_INDEX, PCI_IO_CONFIG_PORT_COUNT);
/* 0x0 - 0x9ffff */
- ram_resource_kb(dev, idx++, 0, 0xa0000 / KiB);
+ ram_range(dev, idx++, 0, 0xa0000);
/* 0xa0000 - 0xbffff: legacy VGA */
- mmio_resource_kb(dev, idx++, VGA_MMIO_BASE / KiB, VGA_MMIO_SIZE / KiB);
+ mmio_range(dev, idx++, VGA_MMIO_BASE, VGA_MMIO_SIZE);
/* 0xc0000 - 0xfffff: Option ROM */
- reserved_ram_resource_kb(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB);
+ reserved_ram_from_to(dev, idx++, 0xc0000, 1 * MiB);
/* 1MiB - bottom of DRAM reserved for early coreboot usage */
- ram_resource_kb(dev, idx++, (1 * MiB) / KiB,
- (early_reserved_dram_start - (1 * MiB)) / KiB);
+ ram_from_to(dev, idx++, 1 * MiB, early_reserved_dram_start);
/* DRAM reserved for early coreboot usage */
- reserved_ram_resource_kb(dev, idx++, early_reserved_dram_start / KiB,
- (early_reserved_dram_end - early_reserved_dram_start) / KiB);
+ reserved_ram_from_to(dev, idx++, early_reserved_dram_start, early_reserved_dram_end);
/*
* top of DRAM consumed early - low top usable RAM
* cbmem_top() accounts for low UMA and TSEG if they are used.
*/
- ram_resource_kb(dev, idx++, early_reserved_dram_end / KiB,
- (mem_usable - early_reserved_dram_end) / KiB);
+ ram_from_to(dev, idx++, early_reserved_dram_end, mem_usable);
mmconf_resource(dev, idx++);
@@ -207,9 +204,9 @@ static void read_resources(struct device *dev)
continue; /* Done separately */
if (res->type == EFI_RESOURCE_SYSTEM_MEMORY)
- ram_resource_kb(dev, idx++, res->addr / KiB, res->length / KiB);
+ ram_range(dev, idx++, res->addr, res->length);
else if (res->type == EFI_RESOURCE_MEMORY_RESERVED)
- reserved_ram_resource_kb(dev, idx++, res->addr / KiB, res->length / KiB);
+ reserved_ram_range(dev, idx++, res->addr, res->length);
else
printk(BIOS_ERR, "Failed to set resources for type %d\n",
res->type);