aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-06-22 19:29:17 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-06-26 12:06:38 +0000
commit80254118ac73233485d5d01b174036429c80282d (patch)
tree325e9602c3ddf0673c50770986cc2ed192a7da5d
parent62ea7a81654b671744732eb162a92ecb08957b36 (diff)
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 <arthur@aheymans.xyz> Change-Id: Iaaee41aec7806287ef1881372ec8ec47a4cd57d9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76004 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
-rw-r--r--src/mainboard/emulation/qemu-aarch64/mainboard.c6
1 files 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 <ramdetect.h>
+#include <cbmem.h>
#include <symbols.h>
#include <device/device.h>
#include <bootmem.h>
@@ -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 = {