Skip to content

Commit

Permalink
Increase the handover jump time and tries
Browse files Browse the repository at this point in the history
This patch increases the handover jump time from bootloader and number
of tries to a decent number since Celadon boot with coreboot is causing
timing issue.

Tests Done: Build and flash and boot on MTL REX board with coreboot

Tracked-On: OAM-125613
Signed-off-by: N Shyjumon <[email protected]>
Signed-off-by: Tanuj Tekriwal <[email protected]>
  • Loading branch information
tanujtekriwal authored and sysopenci committed Sep 26, 2024
1 parent 7d4c542 commit 41b1d99
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libkernelflinger/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
EFI_PHYSICAL_ADDRESS kernel_start)
{
EFI_STATUS ret = EFI_LOAD_ERROR;
UINTN map_key, i;
UINTN map_key, i, j;

log(L"handover jump ...\n");

Expand All @@ -450,7 +450,7 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
* Hence, we give two chances to ExitBootServices() to
* succeed.
*/
for (i = 0; i < 2; i++) {
for (i = 0; i < 10; i++) {
ret = setup_memory_map(boot_params, &map_key);
if (EFI_ERROR(ret)) {
efi_perror(ret, L"Failed to setup memory map");
Expand All @@ -461,10 +461,16 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
* ExitBootServices() call or memory_map key might mismatch
* and ExitBootServices call might fail.
*/

j=0;
ret = uefi_call_wrapper(BS->ExitBootServices, 2, image, map_key);
if (!EFI_ERROR(ret))
goto boot;
/* FixMe: Temporary change to fix RAM instability by adding
* delay in few MTL Boards. This change needs to be reworked.
*/
do{
j+=1;
}while(j<2000);
}

return ret;
Expand Down

0 comments on commit 41b1d99

Please sign in to comment.