From 87d1a2597ceedd03a7d4005db1bf82b72b423a18 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 26 Nov 2024 21:43:54 +0100 Subject: Show the detected machine model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally I was planning to detect the machine model just in case we needed to do workaround for special cases. But since apparently even VisionFive2 brings its own CPU frequency base on DT, this is not even needed. Hence, fetching the model is now a cool message being shown on boot. Signed-off-by: Miquel Sabaté Solà --- include/fbos/dt.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/fbos/dt.h b/include/fbos/dt.h index bbeb7cd..49ac27a 100644 --- a/include/fbos/dt.h +++ b/include/fbos/dt.h @@ -6,8 +6,14 @@ // Default value for the 'dt_info.cpu_freq' property if none could be retrieved. #define DEFAULT_CPU_FREQ 10000000 +// Maximum length for the string representing the model. +#define DT_MODEL_MAX 64 + // Holds all the information that we gather from the initial DeviceTree blob. struct dt_info { + // Model of the system that this kernel is running on. + char model[DT_MODEL_MAX]; + // Ticks per second. If `get_dt_info` fails at setting this value, then // `DEFAULT_CPU_FREQ` is used. uint64_t cpu_freq; -- cgit v1.2.3