ioremap.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_early(void *paddr, size_t size);
  30. void *rt_ioremap(void *paddr, size_t size);
  31. void *rt_ioremap_nocache(void *paddr, size_t size);
  32. void *rt_ioremap_cached(void *paddr, size_t size);
  33. void *rt_ioremap_wt(void *paddr, size_t size);
  34. void rt_iounmap(volatile void *addr);
  35. extern void *rt_ioremap_start;
  36. extern size_t rt_ioremap_size;
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif /*__LWP_IOREMAP_H__*/