18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2020 Loongson Technology Co., Ltd. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci#ifndef _ASM_LOONGARCH_EFI_H 68c2ecf20Sopenharmony_ci#define _ASM_LOONGARCH_EFI_H 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#include <linux/efi.h> 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_civoid __init efi_init(void); 118c2ecf20Sopenharmony_civoid __init efi_runtime_init(void); 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#define ARCH_EFI_IRQ_FLAGS_MASK 0x00000004 /* Bit 2: CSR.CRMD.IE */ 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistatic inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt) 168c2ecf20Sopenharmony_ci{ 178c2ecf20Sopenharmony_ci} 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#define arch_efi_call_virt_setup() \ 208c2ecf20Sopenharmony_ci({ \ 218c2ecf20Sopenharmony_ci}) 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#define arch_efi_call_virt(p, f, args...) \ 248c2ecf20Sopenharmony_ci({ \ 258c2ecf20Sopenharmony_ci efi_##f##_t * __f; \ 268c2ecf20Sopenharmony_ci __f = p->f; \ 278c2ecf20Sopenharmony_ci __f(args); \ 288c2ecf20Sopenharmony_ci}) 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define arch_efi_call_virt_teardown() \ 318c2ecf20Sopenharmony_ci({ \ 328c2ecf20Sopenharmony_ci}) 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define EFI_ALLOC_ALIGN SZ_64K 358c2ecf20Sopenharmony_ci#define EFI_RT_VIRTUAL_OFFSET CSR_DMW0_BASE 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_cistruct screen_info *alloc_screen_info(void); 388c2ecf20Sopenharmony_civoid free_screen_info(struct screen_info *si); 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_cistatic inline unsigned long efi_get_max_fdt_addr(unsigned long image_addr) 418c2ecf20Sopenharmony_ci{ 428c2ecf20Sopenharmony_ci return ULONG_MAX; 438c2ecf20Sopenharmony_ci} 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_cistatic inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr) 468c2ecf20Sopenharmony_ci{ 478c2ecf20Sopenharmony_ci return ULONG_MAX; 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci#endif /* _ASM_LOONGARCH_EFI_H */ 51