summaryrefslogtreecommitdiffstats
path: root/lib/efi_loader/efi_memory.c
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: Handle memory overflowsAndreas Färber2016-04-181-4/+4
| | | | | | | | | | jetson-tk1 has 2 GB of RAM at 0x80000000, causing gd->ram_top to be zero. Handle this by either avoiding ram_top or by using the same type as ram_top to reverse the overflow effect. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Alexander Graf <agraf@suse.de>
* efi_loader: Expose ascending efi memory mapAlexander Graf2016-04-181-2/+7
| | | | | | | | | | | | The EFI memory map does not need to be in a strict order, but 32bit grub2 does expect it to be ascending. If it's not, it may try to allocate memory inside the U-Boot data memory region. We already sort the memory map in descending order, so let's just reverse it when we pass it to a payload. Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Andreas Färber <afaerber@suse.de>
* efi_loader: Always allocate the highest available addressAlexander Graf2016-04-011-0/+29
| | | | | | | | | | | | Some EFI applications (grub2) expect that an allocation always returns the highest available memory address for the given size. Without this, we may run into situations where the initrd gets allocated at a lower address than the kernel. This patch fixes booting in such situations for me. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Implement memory allocation and mapAlexander Graf2016-03-151-0/+319
The EFI loader needs to maintain views of memory - general system memory windows as well as used locations inside those and potential runtime service MMIO windows. To manage all of these, add a few helpers that maintain an internal representation of the map the similar to how the EFI API later on reports it to the application. For allocations, the scheme is very simple. We basically allow allocations to replace chunks of previously done maps, so that a new LOADER_DATA allocation for example can remove a piece of the RAM map. When no specific address is given, we just take the highest possible address in the lowest RAM map that fits the allocation size. Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud