Skip to content
Snippets Groups Projects
Commit dede284d authored by Andreas Färber's avatar Andreas Färber Committed by Tom Rini
Browse files

efi_loader: Handle memory overflows


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: default avatarAndreas Färber <afaerber@suse.de>
Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
parent bd716dd0
No related branches found
No related tags found
No related merge requests found
...@@ -220,7 +220,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type, ...@@ -220,7 +220,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
switch (type) { switch (type) {
case 0: case 0:
/* Any page */ /* Any page */
addr = efi_find_free_memory(len, gd->ram_top); addr = efi_find_free_memory(len, gd->start_addr_sp);
if (!addr) { if (!addr) {
r = EFI_NOT_FOUND; r = EFI_NOT_FOUND;
break; break;
...@@ -320,9 +320,9 @@ efi_status_t efi_get_memory_map(unsigned long *memory_map_size, ...@@ -320,9 +320,9 @@ efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
int efi_memory_init(void) int efi_memory_init(void)
{ {
uint64_t runtime_start, runtime_end, runtime_pages; unsigned long runtime_start, runtime_end, runtime_pages;
uint64_t uboot_start, uboot_pages; unsigned long uboot_start, uboot_pages;
uint64_t uboot_stack_size = 16 * 1024 * 1024; unsigned long uboot_stack_size = 16 * 1024 * 1024;
int i; int i;
/* Add RAM */ /* Add RAM */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment