summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-03 00:29:19 -0400
committerIan Moffett <ian@osmora.org>2025-07-03 00:29:19 -0400
commit197b0ecd37e8c41015586ee9711c807b9b625b0b (patch)
treef7ba4a089353f3388d48cc783b0c5e982395a089 /sys/arch
parent99b2cad147b58b424f059c1fc49d68da57cf3bfa (diff)
kernel/aarch64: Add 'board_info' structure
Introduce a 'board_info' structure as well as an md_get_board() routine to get information about the host Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/aarch64/aarch64/machdep.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/arch/aarch64/aarch64/machdep.c b/sys/arch/aarch64/aarch64/machdep.c
index 33d7c42..9a96cbb 100644
--- a/sys/arch/aarch64/aarch64/machdep.c
+++ b/sys/arch/aarch64/aarch64/machdep.c
@@ -31,6 +31,7 @@
#include <sys/panic.h>
#include <machine/cpu.h>
#include <machine/sync.h>
+#include <machine/board.h>
struct cpu_info g_bsp_ci = {0};
@@ -98,3 +99,13 @@ cpu_startup(struct cpu_info *ci)
__ASMV("msr tpidr_el1, %0" :: "r" (ci));
md_cpu_init();
}
+
+void
+md_get_board(struct board_info *res)
+{
+ uint64_t midr_el1;
+
+ __ASMV("mrs %0, midr_el1" : "=r" (midr_el1));
+ res->partno = (midr_el1 >> 4) & 0xFFF;
+ res->implementer = (midr_el1 >> 24) & 0xFF;
+}