summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_firmware.c
diff options
context:
space:
mode:
authorCaleb Connolly <caleb.connolly@linaro.org>2024-08-09 01:59:25 +0200
committerCaleb Connolly <caleb.connolly@linaro.org>2024-09-06 10:47:45 +0200
commit2f99cea71dd2bd0d1fb961e83803ded4165c5460 (patch)
tree89c0bf3272a58365b44c5f982b7f067d299db34f /lib/efi_loader/efi_firmware.c
parent82efffc38f8f834393ab06375d4e8bd38dec024a (diff)
mach-snapdragon: parse memory ourselves
The generic memory parsing code in U-Boot lacks a few things that we need on Qualcomm: 1. It sets gd->ram_size and gd->ram_base to represent a single memory block. 2. setup_dest_addr() later relocates U-Boot to ram_base + ram_size, the end of that first memory block. This results in all memory beyond U-Boot being unusable in Linux when booting with EFI. Since the ranges in the memory node may be out of order, the only way for us to correctly determine the relocation address for U-Boot is to parse all memory regions and find the highest valid address. We can't use fdtdec_setup_memory_banksize() since it stores the result in gd->bd which is not yet allocated. Hence, this commit, which implements an optimised parser to read the memory blocks and store them in the .data section where they will survive relocation. We set ram_base and ram_size to describe the entire address space of memory, with the assumption that the last memory region is big enough for U-Boot, its DTB, and heap. On all boards tested so far this seems to be a reasonable assumption. As a nice side effect, our fdt parsing also winds up being faster since we avoid the overhead of checking address/size-cells or populating struct resource. We can safely make these optimisations since we only support ARM64, and trust the reg property to be populated correctly. After relocation, we then populate gd->bd->bi_dram with the data we parsed earlier. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Diffstat (limited to 'lib/efi_loader/efi_firmware.c')
0 files changed, 0 insertions, 0 deletions