efi.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Western Digital Corporation or its affiliates.
  4. */
  5. #ifndef _ASM_EFI_H
  6. #define _ASM_EFI_H
  7. #include <asm/csr.h>
  8. #include <asm/io.h>
  9. #include <asm/mmu_context.h>
  10. #include <asm/ptrace.h>
  11. #include <asm/tlbflush.h>
  12. #ifdef CONFIG_EFI
  13. extern void efi_init(void);
  14. #else
  15. #define efi_init()
  16. #endif
  17. int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
  18. int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
  19. #define arch_efi_call_virt_setup() efi_virtmap_load()
  20. #define arch_efi_call_virt_teardown() efi_virtmap_unload()
  21. #define arch_efi_call_virt(p, f, args...) p->f(args)
  22. #define ARCH_EFI_IRQ_FLAGS_MASK (SR_IE | SR_SPIE)
  23. /* on RISC-V, the FDT may be located anywhere in system RAM */
  24. static inline unsigned long efi_get_max_fdt_addr(unsigned long image_addr)
  25. {
  26. return ULONG_MAX;
  27. }
  28. /* Load initrd at enough distance from DRAM start */
  29. static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr)
  30. {
  31. return image_addr + SZ_256M;
  32. }
  33. #define alloc_screen_info(x...) (&screen_info)
  34. static inline void free_screen_info(struct screen_info *si)
  35. {
  36. }
  37. static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
  38. {
  39. }
  40. void efi_virtmap_load(void);
  41. void efi_virtmap_unload(void);
  42. #endif /* _ASM_EFI_H */