summaryrefslogtreecommitdiffstats
path: root/src/mainboard/emulation
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-05-24 20:25:58 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2022-06-22 12:30:15 +0000
commit27d6299d51744bda549b7764b8fde909ad812e33 (patch)
treec30a57ff78e57c9c79a74c4b27cc6e5dfbc94a49 /src/mainboard/emulation
parent37b161fb96c602765fef9f64415f809830b915a4 (diff)
downloadcoreboot-27d6299d51744bda549b7764b8fde909ad812e33.tar.gz
coreboot-27d6299d51744bda549b7764b8fde909ad812e33.tar.bz2
coreboot-27d6299d51744bda549b7764b8fde909ad812e33.zip
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>
Diffstat (limited to 'src/mainboard/emulation')
-rw-r--r--src/mainboard/emulation/qemu-aarch64/mainboard.c2
-rw-r--r--src/mainboard/emulation/qemu-armv7/mainboard.c2
-rw-r--r--src/mainboard/emulation/qemu-i440fx/mainboard.c2
-rw-r--r--src/mainboard/emulation/qemu-i440fx/northbridge.c16
-rw-r--r--src/mainboard/emulation/qemu-power8/mainboard.c2
-rw-r--r--src/mainboard/emulation/qemu-power9/mainboard.c2
-rw-r--r--src/mainboard/emulation/qemu-q35/mainboard.c4
-rw-r--r--src/mainboard/emulation/qemu-riscv/mainboard.c2
-rw-r--r--src/mainboard/emulation/spike-riscv/mainboard.c2
9 files changed, 17 insertions, 17 deletions
diff --git a/src/mainboard/emulation/qemu-aarch64/mainboard.c b/src/mainboard/emulation/qemu-aarch64/mainboard.c
index 988502fd7e7a..181536ce031d 100644
--- a/src/mainboard/emulation/qemu-aarch64/mainboard.c
+++ b/src/mainboard/emulation/qemu-aarch64/mainboard.c
@@ -13,7 +13,7 @@ void bootmem_platform_add_ranges(void)
static void mainboard_enable(struct device *dev)
{
int ram_size_mb = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
- ram_resource(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB);
+ ram_resource_kb(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB);
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/emulation/qemu-armv7/mainboard.c b/src/mainboard/emulation/qemu-armv7/mainboard.c
index 439f243d69a3..4111caab0f2b 100644
--- a/src/mainboard/emulation/qemu-armv7/mainboard.c
+++ b/src/mainboard/emulation/qemu-armv7/mainboard.c
@@ -39,7 +39,7 @@ static void mainboard_enable(struct device *dev)
discovered = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
printk(BIOS_DEBUG, "%d MiB of RAM discovered\n", discovered);
- ram_resource(dev, 0, 0x60000000 >> 10, discovered << 10);
+ ram_resource_kb(dev, 0, 0x60000000 >> 10, discovered << 10);
init_gfx();
}
diff --git a/src/mainboard/emulation/qemu-i440fx/mainboard.c b/src/mainboard/emulation/qemu-i440fx/mainboard.c
index a7c6b3259852..13f0766f535a 100644
--- a/src/mainboard/emulation/qemu-i440fx/mainboard.c
+++ b/src/mainboard/emulation/qemu-i440fx/mainboard.c
@@ -37,7 +37,7 @@ static void qemu_nb_read_resources(struct device *dev)
if (CONFIG(ARCH_RAMSTAGE_X86_64)) {
/* Reserve page tables in DRAM. FIXME: Remove once x86_64 page tables reside in CBMEM */
- reserved_ram_resource(dev, 0, CONFIG_ARCH_X86_64_PGTBL_LOC / KiB,
+ reserved_ram_resource_kb(dev, 0, CONFIG_ARCH_X86_64_PGTBL_LOC / KiB,
(6 * 0x1000) / KiB);
}
}
diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index b55ace0986a1..708e3a66ce1a 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -65,10 +65,10 @@ static void cpu_pci_domain_read_resources(struct device *dev)
list[i].address, list[i].length);
if (list[i].address == 0) {
tomk = list[i].length / 1024;
- ram_resource(dev, idx++, 0, 640);
- ram_resource(dev, idx++, 768, tomk - 768);
+ ram_resource_kb(dev, idx++, 0, 640);
+ ram_resource_kb(dev, idx++, 768, tomk - 768);
} else {
- ram_resource(dev, idx++,
+ ram_resource_kb(dev, idx++,
list[i].address / 1024,
list[i].length / 1024);
}
@@ -99,10 +99,10 @@ static void cpu_pci_domain_read_resources(struct device *dev)
printk(BIOS_DEBUG, "QEMU: cmos: %lu MiB RAM above 4G.\n", high / 1024);
/* Report the memory regions. */
- ram_resource(dev, idx++, 0, 640);
- ram_resource(dev, idx++, 768, tomk - 768);
+ ram_resource_kb(dev, idx++, 0, 640);
+ ram_resource_kb(dev, idx++, 768, tomk - 768);
if (high)
- ram_resource(dev, idx++, 4 * 1024 * 1024, high);
+ ram_resource_kb(dev, idx++, 4 * 1024 * 1024, high);
}
/* Reserve I/O ports used by QEMU */
@@ -119,10 +119,10 @@ static void cpu_pci_domain_read_resources(struct device *dev)
}
/* A segment is legacy VGA region */
- mmio_resource(dev, idx++, 0xa0000 / KiB, (0xc0000 - 0xa0000) / KiB);
+ mmio_resource_kb(dev, idx++, 0xa0000 / KiB, (0xc0000 - 0xa0000) / KiB);
/* C segment to 1MB is reserved RAM (low tables) */
- reserved_ram_resource(dev, idx++, 0xc0000 / KiB, (1 * MiB - 0xc0000) / KiB);
+ reserved_ram_resource_kb(dev, idx++, 0xc0000 / KiB, (1 * MiB - 0xc0000) / KiB);
if (q35 && ((tomk * 1024) < 0xb0000000)) {
/*
diff --git a/src/mainboard/emulation/qemu-power8/mainboard.c b/src/mainboard/emulation/qemu-power8/mainboard.c
index cfee99f7d081..6f8016c8e3f6 100644
--- a/src/mainboard/emulation/qemu-power8/mainboard.c
+++ b/src/mainboard/emulation/qemu-power8/mainboard.c
@@ -11,7 +11,7 @@ static void mainboard_enable(struct device *dev)
}
/* Where does RAM live? */
- ram_resource(dev, 0, 2048, 32768);
+ ram_resource_kb(dev, 0, 2048, 32768);
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/emulation/qemu-power9/mainboard.c b/src/mainboard/emulation/qemu-power9/mainboard.c
index 6c178af4ab40..542339da0a78 100644
--- a/src/mainboard/emulation/qemu-power9/mainboard.c
+++ b/src/mainboard/emulation/qemu-power9/mainboard.c
@@ -8,7 +8,7 @@ static void mainboard_enable(struct device *dev)
{
if (!dev)
die("No dev0; die\n");
- ram_resource(dev, 0, 0, (unsigned long)cbmem_top() / KiB);
+ ram_resource_kb(dev, 0, 0, (unsigned long)cbmem_top() / KiB);
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/emulation/qemu-q35/mainboard.c b/src/mainboard/emulation/qemu-q35/mainboard.c
index 534f6061a196..594b256fec63 100644
--- a/src/mainboard/emulation/qemu-q35/mainboard.c
+++ b/src/mainboard/emulation/qemu-q35/mainboard.c
@@ -55,12 +55,12 @@ static void qemu_nb_read_resources(struct device *dev)
if (CONFIG(ARCH_RAMSTAGE_X86_64)) {
/* Reserve page tables in DRAM. FIXME: Remove once x86_64 page tables reside in CBMEM */
- reserved_ram_resource(dev, 0, CONFIG_ARCH_X86_64_PGTBL_LOC / KiB,
+ reserved_ram_resource_kb(dev, 0, CONFIG_ARCH_X86_64_PGTBL_LOC / KiB,
(6 * 0x1000) / KiB);
}
smm_region(&tseg_base, &tseg_size);
- reserved_ram_resource(dev, ESMRAMC, tseg_base / 1024, tseg_size / 1024);
+ reserved_ram_resource_kb(dev, ESMRAMC, tseg_base / 1024, tseg_size / 1024);
}
diff --git a/src/mainboard/emulation/qemu-riscv/mainboard.c b/src/mainboard/emulation/qemu-riscv/mainboard.c
index 78cbfe2d59b1..af0df9c9b4f2 100644
--- a/src/mainboard/emulation/qemu-riscv/mainboard.c
+++ b/src/mainboard/emulation/qemu-riscv/mainboard.c
@@ -14,7 +14,7 @@ static void mainboard_enable(struct device *dev)
}
dram_mb_detected = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
- ram_resource(dev, 0, (uintptr_t)_dram / KiB, dram_mb_detected * MiB / KiB);
+ ram_resource_kb(dev, 0, (uintptr_t)_dram / KiB, dram_mb_detected * MiB / KiB);
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/emulation/spike-riscv/mainboard.c b/src/mainboard/emulation/spike-riscv/mainboard.c
index 84a11555df9c..2454f0462f55 100644
--- a/src/mainboard/emulation/spike-riscv/mainboard.c
+++ b/src/mainboard/emulation/spike-riscv/mainboard.c
@@ -17,7 +17,7 @@ static void mainboard_enable(struct device *dev)
die("No dev0; die\n");
}
- ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB);
+ ram_resource_kb(dev, 0, 0x80000000/KiB, ram_size/KiB);
}
struct chip_operations mainboard_ops = {