From 80254118ac73233485d5d01b174036429c80282d Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 22 Jun 2023 19:29:17 +0200 Subject: [PATCH] mb/qemu-aarch64: Move probing dram to read_resources While we are at it: - Don't use _kb version of declaring resources - Use cbmem_top instead of probing for memory again Signed-off-by: Arthur Heymans Change-Id: Iaaee41aec7806287ef1881372ec8ec47a4cd57d9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76004 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Lean Sheng Tan --- src/mainboard/emulation/qemu-aarch64/mainboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mainboard/emulation/qemu-aarch64/mainboard.c b/src/mainboard/emulation/qemu-aarch64/mainboard.c index 09b983f330..481745f214 100644 --- a/src/mainboard/emulation/qemu-aarch64/mainboard.c +++ b/src/mainboard/emulation/qemu-aarch64/mainboard.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -#include +#include #include #include #include @@ -13,8 +13,6 @@ 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_kb(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB); } struct chip_operations mainboard_ops = { @@ -44,6 +42,8 @@ static void qemu_aarch64_domain_read_resources(struct device *dev) res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED; mmio_range(dev, index++, VIRT_PCIE_ECAM_BASE, VIRT_PCIE_ECAM_SIZE); + + ram_from_to(dev, index++, (uintptr_t)_dram, (uintptr_t)cbmem_top()); } struct device_operations qemu_aarch64_pci_domain_ops = {