device/resource: Add _kb postfix for resource allocators
There is a lot of going back-and-forth with the KiB arguments, start
the work to migrate away from this.
Change-Id: I329864d36137e9a99b5640f4f504c45a02060a40
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64658
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/amd/sabrina/root_complex.c b/src/soc/amd/sabrina/root_complex.c
index 8f91b2a..76ed765 100644
--- a/src/soc/amd/sabrina/root_complex.c
+++ b/src/soc/amd/sabrina/root_complex.c
@@ -120,27 +120,27 @@
pci_dev_read_resources for it */
/* 0x0 - 0x9ffff */
- ram_resource(dev, idx++, 0, 0xa0000 / KiB);
+ ram_resource_kb(dev, idx++, 0, 0xa0000 / KiB);
/* 0xa0000 - 0xbffff: legacy VGA */
- mmio_resource(dev, idx++, 0xa0000 / KiB, 0x20000 / KiB);
+ mmio_resource_kb(dev, idx++, 0xa0000 / KiB, 0x20000 / KiB);
/* 0xc0000 - 0xfffff: Option ROM */
- reserved_ram_resource(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB);
+ reserved_ram_resource_kb(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB);
/* 1MiB - bottom of DRAM reserved for early coreboot usage */
- ram_resource(dev, idx++, (1 * MiB) / KiB,
+ ram_resource_kb(dev, idx++, (1 * MiB) / KiB,
(early_reserved_dram_start - (1 * MiB)) / KiB);
/* DRAM reserved for early coreboot usage */
- reserved_ram_resource(dev, idx++, early_reserved_dram_start / KiB,
+ reserved_ram_resource_kb(dev, idx++, early_reserved_dram_start / KiB,
(early_reserved_dram_end - early_reserved_dram_start) / KiB);
/*
* top of DRAM consumed early - low top usable RAM
* cbmem_top() accounts for low UMA and TSEG if they are used.
*/
- ram_resource(dev, idx++, early_reserved_dram_end / KiB,
+ ram_resource_kb(dev, idx++, early_reserved_dram_end / KiB,
(mem_usable - early_reserved_dram_end) / KiB);
mmconf_resource(dev, idx++);
@@ -164,9 +164,9 @@
continue; /* Done separately */
if (res->type == EFI_RESOURCE_SYSTEM_MEMORY)
- ram_resource(dev, idx++, res->addr / KiB, res->length / KiB);
+ ram_resource_kb(dev, idx++, res->addr / KiB, res->length / KiB);
else if (res->type == EFI_RESOURCE_MEMORY_RESERVED)
- reserved_ram_resource(dev, idx++, res->addr / KiB, res->length / KiB);
+ reserved_ram_resource_kb(dev, idx++, res->addr / KiB, res->length / KiB);
else
printk(BIOS_ERR, "Error: failed to set resources for type %d\n",
res->type);
diff --git a/src/soc/amd/sabrina/uart.c b/src/soc/amd/sabrina/uart.c
index 0ffdacf..981e6f0 100644
--- a/src/soc/amd/sabrina/uart.c
+++ b/src/soc/amd/sabrina/uart.c
@@ -114,7 +114,7 @@
static void uart_read_resources(struct device *dev)
{
- mmio_resource(dev, 0, dev->path.mmio.addr / KiB, 4);
+ mmio_resource_kb(dev, 0, dev->path.mmio.addr / KiB, 4);
}
struct device_operations sabrina_uart_mmio_ops = {