aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-26 13:59:54 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-26 13:59:54 +0100
commit7870d56b155c2be73cdacfba94eeb893cd55628e (patch)
treef95699d91e19635c7aa0e99dbf114da2a06e80a2 /test
parent30d6ab8c6b40b2897fa3f49cce0302cc6c3a66e6 (diff)
downloadfbos-7870d56b155c2be73cdacfba94eeb893cd55628e.tar.gz
fbos-7870d56b155c2be73cdacfba94eeb893cd55628e.zip
dt: Fetch the CPU frequency as well
If the 'timebase-frequency' property is available under the 'cpus' node from the DTB blob, it makes sense to try to fetch this value from there instead of hardcoding it. For other use-cases, where this information is not available through DT (e.g. ACPI on the VisionFive2 board), we will have to hardcode it with a default value even if it's not the proper one. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_dt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/test_dt.c b/test/test_dt.c
index 31f729f..1eb9751 100644
--- a/test/test_dt.c
+++ b/test/test_dt.c
@@ -19,11 +19,17 @@ int main(void)
contents[fsize] = 0;
- struct initrd_addr addr = find_dt_initrd_addr(contents);
+ struct dt_info info = {
+ .cpu_freq = 0,
+ .initrd_start = 0,
+ .initrd_end = 0,
+ };
+ get_dt_info(contents, &info);
free(contents);
- assert(addr.start == 0x84200000);
- assert(addr.end == 0x84200c00);
+ assert(info.initrd_start == 0x84200000);
+ assert(info.initrd_end == 0x84200c00);
+ assert(info.cpu_freq == 0x989680);
exit(0);
}