git: 1d5f967fa777 - main - kboot: Add powerpc stub for enumerate_memory_arch()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 03 Feb 2023 15:50:39 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=1d5f967fa7776fd8119bab7fbe66bffde03e4735
commit 1d5f967fa7776fd8119bab7fbe66bffde03e4735
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-02-03 15:38:29 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-02-03 15:41:39 +0000
kboot: Add powerpc stub for enumerate_memory_arch()
Add stub for new MI interface for enumerating memory. Right now powerpc
looks in the FDT table at a later point in boot since we don't need to
pass a specific memory table to the kernel. Leave it like that for now,
but note plans for the future.
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38248
---
stand/kboot/arch/powerpc64/load_addr.c | 12 ++++++++++++
stand/kboot/main.c | 1 -
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/stand/kboot/arch/powerpc64/load_addr.c b/stand/kboot/arch/powerpc64/load_addr.c
index 81b5d0d50581..ac3374ff20f2 100644
--- a/stand/kboot/arch/powerpc64/load_addr.c
+++ b/stand/kboot/arch/powerpc64/load_addr.c
@@ -208,3 +208,15 @@ kboot_get_kernel_machine_bits(void)
return (bits);
}
#endif
+
+/* Need to transition from current hacky FDT way to this code */
+bool enumerate_memory_arch(void)
+{
+ /*
+ * For now, we dig it out of the FDT, plus we need to pass all data into
+ * the kernel via the (adjusted) FDT we find.
+ */
+ setenv("usefdt", "1", 1);
+
+ return true;
+}
diff --git a/stand/kboot/main.c b/stand/kboot/main.c
index b8523cb202a2..bc2dad96dbfe 100644
--- a/stand/kboot/main.c
+++ b/stand/kboot/main.c
@@ -254,7 +254,6 @@ main(int argc, const char **argv)
printf("\n%s", bootprog_info);
setenv("LINES", "24", 1);
- setenv("usefdt", "1", 1);
memory_limits();