Add basic boot, setup and reset routines for LoongArch. Now, LoongArch machines use UEFI-based firmware. The firmware passes configuration information to the kernel via ACPI and DMI/SMBIOS. Currently an existing interface between the kernel and the bootloader is implemented. Kernel gets 2 values from the bootloader, passed in registers a0 and a1; a0 is an "EFI boot flag" distinguishing UEFI and non-UEFI firmware, while a1 is a pointer to an FDT with systable, memmap, cmdline and initrd information. The standard UEFI boot protocol (EFISTUB) will be added later. Cc: linux-efi@vger.kernel.org Cc: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Co-developed-by: Yun Liu <liuyun@loongson.cn> Signed-off-by: Yun Liu <liuyun@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
|
|
*/
|
|
#ifndef _ASM_LOONGARCH_EFI_H
|
|
#define _ASM_LOONGARCH_EFI_H
|
|
|
|
#include <linux/efi.h>
|
|
|
|
void __init efi_init(void);
|
|
void __init efi_runtime_init(void);
|
|
void efifb_setup_from_dmi(struct screen_info *si, const char *opt);
|
|
|
|
#define ARCH_EFI_IRQ_FLAGS_MASK 0x00000004 /* Bit 2: CSR.CRMD.IE */
|
|
|
|
#define arch_efi_call_virt_setup() \
|
|
({ \
|
|
})
|
|
|
|
#define arch_efi_call_virt(p, f, args...) \
|
|
({ \
|
|
efi_##f##_t * __f; \
|
|
__f = p->f; \
|
|
__f(args); \
|
|
})
|
|
|
|
#define arch_efi_call_virt_teardown() \
|
|
({ \
|
|
})
|
|
|
|
#define EFI_ALLOC_ALIGN SZ_64K
|
|
|
|
struct screen_info *alloc_screen_info(void);
|
|
void free_screen_info(struct screen_info *si);
|
|
|
|
static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr)
|
|
{
|
|
return ULONG_MAX;
|
|
}
|
|
|
|
#endif /* _ASM_LOONGARCH_EFI_H */
|