2022-05-31 18:04:11 +08:00
|
|
|
#
|
|
|
|
# arch/loongarch/boot/Makefile
|
|
|
|
#
|
|
|
|
# Copyright (C) 2020-2022 Loongson Technology Corporation Limited
|
|
|
|
#
|
|
|
|
|
|
|
|
drop-sections := .comment .note .options .note.gnu.build-id
|
|
|
|
strip-flags := $(addprefix --remove-section=,$(drop-sections)) -S
|
|
|
|
OBJCOPYFLAGS_vmlinux.efi := -O binary $(strip-flags)
|
|
|
|
|
|
|
|
quiet_cmd_strip = STRIP $@
|
|
|
|
cmd_strip = $(STRIP) -s -o $@ $<
|
|
|
|
|
efi/loongarch: Add efistub booting support
This patch adds efistub booting support, which is the standard UEFI boot
protocol for LoongArch to use.
We use generic efistub, which means we can pass boot information (i.e.,
system table, memory map, kernel command line, initrd) via a light FDT
and drop a lot of non-standard code.
We use a flat mapping to map the efi runtime in the kernel's address
space. In efi, VA = PA; in kernel, VA = PA + PAGE_OFFSET. As a result,
flat mapping is not identity mapping, SetVirtualAddressMap() is still
needed for the efi runtime.
Tested-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
[ardb: change fpic to fpie as suggested by Xi Ruoyao]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2022-08-19 18:20:37 +08:00
|
|
|
targets := vmlinux.elf
|
|
|
|
$(obj)/vmlinux.elf: vmlinux FORCE
|
2022-05-31 18:04:11 +08:00
|
|
|
$(call if_changed,strip)
|
efi/loongarch: Add efistub booting support
This patch adds efistub booting support, which is the standard UEFI boot
protocol for LoongArch to use.
We use generic efistub, which means we can pass boot information (i.e.,
system table, memory map, kernel command line, initrd) via a light FDT
and drop a lot of non-standard code.
We use a flat mapping to map the efi runtime in the kernel's address
space. In efi, VA = PA; in kernel, VA = PA + PAGE_OFFSET. As a result,
flat mapping is not identity mapping, SetVirtualAddressMap() is still
needed for the efi runtime.
Tested-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
[ardb: change fpic to fpie as suggested by Xi Ruoyao]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2022-08-19 18:20:37 +08:00
|
|
|
|
|
|
|
targets += vmlinux.efi
|
|
|
|
$(obj)/vmlinux.efi: vmlinux FORCE
|
|
|
|
$(call if_changed,objcopy)
|
2022-08-22 20:39:49 +08:00
|
|
|
|
|
|
|
EFI_ZBOOT_PAYLOAD := vmlinux.efi
|
|
|
|
EFI_ZBOOT_BFD_TARGET := elf64-loongarch
|
|
|
|
EFI_ZBOOT_MACH_TYPE := LOONGARCH64
|
|
|
|
|
|
|
|
include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot
|