aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Geiselbrecht <geist@foobox.com>2023-07-05 23:32:46 -0700
committerTravis Geiselbrecht <geist@foobox.com>2023-10-15 14:41:30 -0700
commit58fd2c36d5dd46a7bd31e44fd59e807e9a31696d (patch)
treeabe9c37c8da985eb9b9089553c929386ed3b1b3b
parent6b7d0ab627f642d55c83518c63a81ce656723d1b (diff)
downloadlk-58fd2c36d5dd46a7bd31e44fd59e807e9a31696d.tar.gz
[platform][jh7110] Tweak logic to find the FDT from the uimage
-rw-r--r--platform/jh7110/platform.c11
1 files 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