]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: add Linux magic to aarch64 crt0
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 29 Jan 2021 11:35:51 +0000 (12:35 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 29 Jan 2021 19:22:40 +0000 (20:22 +0100)
Add the Linux magic to the EFI file header to allow running our test
programs with GRUB's linux command. Now we can dump the fixed-up device
tree with our dtbdump.efi tool.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
arch/arm/lib/crt0_aarch64_efi.S
include/asm-generic/pe.h

index 368933ecf2d6edfe2542ebb182efe2c0dffc75fa..492195f7654f4da5ea9d463585559cf4669b7c30 100644 (file)
@@ -18,7 +18,8 @@
        .globl  ImageBase
 ImageBase:
        .short  IMAGE_DOS_SIGNATURE             /* 'MZ' */
-       .skip   58                              /* 'MZ' + pad + offset == 64 */
+       .skip   54                              /* 'MZ' + pad + offset == 64 */
+       .long   LINUX_ARM64_MAGIC               /* For GRUB's linux command */
        .long   pe_header - ImageBase           /* Offset to the PE header */
 pe_header:
        .long   IMAGE_NT_SIGNATURE              /* 'PE' */
index b247519a3d5c14fe95e79f60bdd6abd4cebe5dbc..a1df7471348e795de9c47ad7ada27d48abc16a32 100644 (file)
@@ -51,4 +51,6 @@
 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER     12
 #define IMAGE_SUBSYSTEM_EFI_ROM                        13
 
+#define LINUX_ARM64_MAGIC                      0x644d5241
+
 #endif /* _ASM_PE_H */