ioremap.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-05-06 Jesven first version
  9. */
  10. #ifndef __IOREMAP_H__
  11. #define __IOREMAP_H__
  12. #include <stddef.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /**
  17. * IOREMAP family
  18. * `rt_ioremap` default to map physical memory in MMIO region as DEVICE memory
  19. * to kernel space. And there are 3 variants currently supported.
  20. *
  21. * name | attribution
  22. * ------------------ | -----------
  23. * rt_ioremap_nocache | Device (MMU_MAP_K_DEVICE)
  24. * rt_ioremap_cache | Normal memory (MMU_MAP_K_RWCB)
  25. * rt_ioremap_wt | Normal memory but guarantee that
  26. * | Each write access should go to system memory directly
  27. * | Currently as non-cacheable
  28. */
  29. void *rt_ioremap(void *paddr, size_t size);
  30. void *rt_ioremap_nocache(void *paddr, size_t size);
  31. void *rt_ioremap_cached (void *paddr, size_t size);
  32. void rt_iounmap(volatile void *addr);
  33. extern void *rt_ioremap_start;
  34. extern size_t rt_ioremap_size;
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif /*__LWP_IOREMAP_H__*/