Relocate edk2 to high memory before boot
This may allow Linux to boot more easily?
This commit is contained in:
parent
372e6ee8ec
commit
b923cb5bdf
@ -18,7 +18,30 @@
|
||||
.align 3
|
||||
|
||||
ASM_FUNC(ArmPlatformPeiBootAction)
|
||||
startlabel:
|
||||
// check if we're located at expected location
|
||||
adr x4, .
|
||||
ldr x5, =ArmPlatformPeiBootAction
|
||||
cmp x4, x5
|
||||
bne docopy
|
||||
ret
|
||||
docopy:
|
||||
// find our start address by getting our expected offset, then subtracting it from our actual address
|
||||
ldr x6, =FixedPcdGet64 (PcdFdBaseAddress)
|
||||
sub x5, x5, x6 // x5 now holds offset of ArmPlatformPeiBootAction from start of FD base
|
||||
sub x4, x4, x5 // x4 now holds address of actual FD base
|
||||
// tweak the return address
|
||||
sub lr, lr, x4
|
||||
add lr, lr, x6
|
||||
ldr x5, =FixedPcdGet64 (PcdFdSize)
|
||||
// crap memcpy
|
||||
loop:
|
||||
ldp x2, x3, [x4], #16
|
||||
stp x2, x3, [x6], #16
|
||||
subs x5, x5, #16
|
||||
b.ne loop
|
||||
ret
|
||||
.ltorg
|
||||
|
||||
//UINTN
|
||||
//ArmPlatformIsPrimaryCore (
|
||||
|
@ -42,3 +42,5 @@
|
||||
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
|
||||
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||
gArmTokenSpaceGuid.PcdFdBaseAddress
|
||||
gArmTokenSpaceGuid.PcdFdSize
|
||||
|
@ -25,7 +25,7 @@
|
||||
################################################################################
|
||||
|
||||
[FD.PIXEL3XL_UEFI]
|
||||
BaseAddress = 0x80080000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in NOR Flash.
|
||||
BaseAddress = 0xd0000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in NOR Flash.
|
||||
Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device
|
||||
ErasePolarity = 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user