early_ioremap.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #if defined(CONFIG_GENERIC_EARLY_IOREMAP) && defined(CONFIG_MMU)
  20. /* Arch-specific initialization */
  21. extern void early_ioremap_init(void);
  22. /* Generic initialization called by architecture code */
  23. extern void early_ioremap_setup(void);
  24. /*
  25. * Called as last step in paging_init() so library can act
  26. * accordingly for subsequent map/unmap requests.
  27. */
  28. extern void early_ioremap_reset(void);
  29. /*
  30. * Early copy from unmapped memory to kernel mapped memory.
  31. */
  32. extern void copy_from_early_mem(void *dest, phys_addr_t src,
  33. unsigned long size);
  34. #else
  35. static inline void early_ioremap_init(void) { }
  36. static inline void early_ioremap_setup(void) { }
  37. static inline void early_ioremap_reset(void) { }
  38. #endif
  39. #endif /* _ASM_EARLY_IOREMAP_H_ */