Skip to content

Commit

Permalink
[platform][jh7110] Tweak logic to find the FDT from the uimage
Browse files Browse the repository at this point in the history
  • Loading branch information
travisg committed Oct 15, 2023
1 parent 6b7d0ab commit 58fd2c3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions platform/jh7110/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Expand Down

0 comments on commit 58fd2c3

Please sign in to comment.