From 58fd2c36d5dd46a7bd31e44fd59e807e9a31696d Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Wed, 5 Jul 2023 23:32:46 -0700 Subject: [platform][jh7110] Tweak logic to find the FDT from the uimage --- platform/jh7110/platform.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/jh7110/platform.c b/platform/jh7110/platform.c index 40b18acc..db2d579b 100644 --- a/platform/jh7110/platform.c +++ b/platform/jh7110/platform.c @@ -118,7 +118,7 @@ void platform_early_init(void) { const void *fdt = (void *)lk_boot_args[1]; #if WITH_KERNEL_VM - fdt = (const void *)((uintptr_t)fdt + PERIPHERAL_BASE_VIRT); + fdt = (const void *)((uintptr_t)fdt + KERNEL_ASPACE_BASE); #endif struct fdt_walk_callbacks cb = { @@ -137,11 +137,14 @@ void platform_early_init(void) { if (err != 0) { printf("FDT: error finding FDT at %p, using default memory & cpu count\n", fdt); - reserved.regions[0].base = MEMBASE; - reserved.regions[0].len = 0x00200000; // reserve the first 2MB of memory for SBI - reserved.count = 1; } + // Always reserve all of physical memory below the kernel, this is where SBI lives + // TODO: figure out why uboot doesn't always put this here + reserved.regions[reserved.count].base = MEMBASE; + reserved.regions[reserved.count].len = KERNEL_LOAD_OFFSET; + reserved.count++; + /* add a default memory region if we didn't find it in the FDT */ if (!found_mem) { #if WITH_KERNEL_VM -- cgit v1.2.3