summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorMaximilian Brune <maximilian.brune@9elements.com>2024-08-12 03:47:41 +0200
committerFelix Held <felix-coreboot@felixheld.de>2024-08-20 12:54:12 +0000
commitdb1e9ce832c4b8aa5d1355b09e353789756ab86a (patch)
tree7a540c12731078de43ae237199d22a548bf3888b /src/mainboard
parenta985352350b5efa7388cdf9e4db8bc2fac25443f (diff)
arch/riscv: Remove ram probing
Previously RAM probing was necessary for our QEMU-RISCV target in order to find the available amount of memory. Now we get the memory from the devicetree propagated by QEMU, so there is no reason to keep it anymore. Tested: Start QEMU-RISCV and cause an exception to make sure the trap handler still works. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I9b1e0dc78fc2a66d6085fe99a71245ff46f8e63c Reviewed-on: https://review.coreboot.org/c/coreboot/+/83873 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/emulation/qemu-riscv/Kconfig7
-rw-r--r--src/mainboard/emulation/qemu-riscv/cbmem.c7
2 files changed, 3 insertions, 11 deletions
diff --git a/src/mainboard/emulation/qemu-riscv/Kconfig b/src/mainboard/emulation/qemu-riscv/Kconfig
index 27b1b58127..9b5a6f0dce 100644
--- a/src/mainboard/emulation/qemu-riscv/Kconfig
+++ b/src/mainboard/emulation/qemu-riscv/Kconfig
@@ -69,13 +69,6 @@ config RISCV_WORKING_HARTID
int
default 0
-config DRAM_SIZE_MB
- int
- default 16383
- help
- Qemu maps MMIO at ALIGN_UP(top_of_mem, 16 * GiB)
- To avoid confusing the dram probing algorithm, avoid large dram sizes (16G - 1m)
-
config OPENSBI_PLATFORM
string
default "generic"
diff --git a/src/mainboard/emulation/qemu-riscv/cbmem.c b/src/mainboard/emulation/qemu-riscv/cbmem.c
index 3e114159b6..ff3f5db3fc 100644
--- a/src/mainboard/emulation/qemu-riscv/cbmem.c
+++ b/src/mainboard/emulation/qemu-riscv/cbmem.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <assert.h>
#include <cbmem.h>
#include <symbols.h>
#include <ramdetect.h>
@@ -11,9 +12,7 @@ uintptr_t cbmem_top_chipset(void)
uint64_t top;
top = fdt_get_memory_top((void *)HLS()->fdt);
- if (top)
- return MIN(top, (uint64_t)4 * GiB - 1);
+ ASSERT_MSG(top, "Failed reading memory range from FDT");
- size_t dram_mb_detected = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
- return (uintptr_t)_dram + dram_mb_detected * MiB;
+ return MIN(top, (uint64_t)4 * GiB - 1);
}