early_ioremap.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_EARLY_IOREMAP_H_
  3. #define _ASM_EARLY_IOREMAP_H_
  4. #include <linux/types.h>
  5. /*
  6. * early_ioremap() and early_iounmap() are for temporary early boot-time
  7. * mappings, before the real ioremap() is functional.
  8. */
  9. extern void __iomem *early_ioremap(resource_size_t phys_addr,
  10. unsigned long size);
  11. extern void *early_memremap(resource_size_t phys_addr,
  12. unsigned long size);
  13. extern void *early_memremap_ro(resource_size_t phys_addr,
  14. unsigned long size);
  15. extern void *early_memremap_prot(resource_size_t phys_addr,
  16. unsigned long size, unsigned long prot_val);
  17. extern void early_iounmap(void __iomem *addr, unsigned long size);
  18. extern void early_memunmap(void *addr, unsigned long size);
  19. /*
  20. * Weak function called by early_ioremap_reset(). It does nothing, but
  21. * architectures may provide their own version to do any needed cleanups.
  22. */
  23. extern void early_ioremap_shutdown(void);
  24. #if defined(CONFIG_GENERIC_EARLY_IOREMAP) && defined(CONFIG_MMU)
  25. /* Arch-specific initialization */
  26. extern void early_ioremap_init(void);
  27. /* Generic initialization called by architecture code */
  28. extern void early_ioremap_setup(void);
  29. /*
  30. * Called as last step in paging_init() so library can act
  31. * accordingly for subsequent map/unmap requests.
  32. */
  33. extern void early_ioremap_reset(void);
  34. /*
  35. * Early copy from unmapped memory to kernel mapped memory.
  36. */
  37. extern void copy_from_early_mem(void *dest, phys_addr_t src,
  38. unsigned long size);
  39. #else
  40. static inline void early_ioremap_init(void) { }
  41. static inline void early_ioremap_setup(void) { }
  42. static inline void early_ioremap_reset(void) { }
  43. #endif
  44. #endif /* _ASM_EARLY_IOREMAP_H_ */