@@ -18,10 +18,11 @@ VOID JumpToAddressAArch64(
1818 UINT32 DesVersion = 0 ;
1919 UINT32 PayloadAddress32 = (UINT32 ) Address ;
2020 UINT32 PayloadLength32 = (UINT32 ) PayloadLength ;
21-
2221 EFI_PHYSICAL_ADDRESS DynamicEl1ParamAddress = 0xA0000000 ;
23- el1_system_param * DynamicEl1Param ;
22+ EL1_SYSTEM_PARAM * DynamicEl1Param ;
2423
24+ // This is a bit hacky, but it can save me some time
25+ // on the call convention.
2526 Status = gBS -> AllocatePages (
2627 AllocateAddress ,
2728 EfiRuntimeServicesData ,
@@ -92,73 +93,9 @@ VOID JumpToAddressAArch64(
9293 while (TRUE) { }
9394}
9495
95- VOID JumpToAddressAArch32 (
96- EFI_HANDLE ImageHandle ,
97- EFI_PHYSICAL_ADDRESS AArch32Address ,
98- EFI_PHYSICAL_ADDRESS AArch64Address ,
99- VOID * AArch64PayloadBuffer ,
100- UINT64 AArch64PayloadLength
96+ BOOLEAN CheckElf64Header (
97+ Elf64_Ehdr * bl_elf_hdr
10198)
102- {
103-
104- EFI_STATUS Status ;
105- UINTN MemMapSize = 0 ;
106- EFI_MEMORY_DESCRIPTOR * MemMap = 0 ;
107- UINTN MapKey = 0 ;
108- UINTN DesSize = 0 ;
109- UINT32 DesVersion = 0 ;
110- UINT32 PayloadAddress32 = (UINT32 ) AArch64Address ;
111- UINT32 PayloadLength32 = (UINT32 ) AArch64PayloadLength ;
112-
113- /* Entry */
114- VOID (* entry )() = (VOID * ) AArch32Address ;
115-
116- Print (L"Exiting boot services... \n" );
117-
118- gBS -> GetMemoryMap (
119- & MemMapSize ,
120- MemMap ,
121- & MapKey ,
122- & DesSize ,
123- & DesVersion
124- );
125-
126- /* Shutdown */
127- Status = gBS -> ExitBootServices (
128- ImageHandle ,
129- MapKey
130- );
131-
132- if (EFI_ERROR (Status ))
133- {
134- Print (L"Failed to exit BS\n" );
135- return ;
136- }
137-
138- /* Move LOAD section to actual location */
139- SetMem (
140- (VOID * )PayloadAddress32 ,
141- PayloadLength32 ,
142- 0xFF );
143-
144- CopyMem (
145- (VOID * )PayloadAddress32 ,
146- AArch64PayloadBuffer ,
147- PayloadLength32
148- );
149-
150- /* De-initialize */
151- ArmDeInitialize ();
152-
153- /* Disable GIC */
154- writel (0 , GIC_DIST_CTRL );
155-
156- /* Lets go */
157- entry ();
158-
159- }
160-
161- BOOLEAN CheckElf64Header (Elf64_Ehdr * bl_elf_hdr )
16299{
163100
164101 EFI_PHYSICAL_ADDRESS ElfEntryPoint ;
@@ -222,7 +159,9 @@ BOOLEAN CheckElf64Header(Elf64_Ehdr * bl_elf_hdr)
222159 return TRUE;
223160}
224161
225- static BOOLEAN PCIExpressIsPhyReady (VOID )
162+ static BOOLEAN PCIExpressIsPhyReady (
163+ VOID
164+ )
226165{
227166 if (readl (MSM_PCIE_PHY + PCIE_PHY_PCS_STATUS ) & BIT (6 ))
228167 return FALSE;
@@ -326,7 +265,7 @@ EFI_STATUS efi_main(
326265 continue ;
327266 }
328267
329- // Read image and parse ELF32 file
268+ // Read image and parse ELF64 file
330269 Print (L"Opened payload image\n" );
331270
332271 Status = PayloadFileProtocol -> GetInfo (
0 commit comments