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 
13 #include <stddef.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /**
20  * IOREMAP family
21  * `rt_ioremap` default to map physical memory in MMIO region as DEVICE memory
22  * to kernel space. And there are 3 variants currently supported.
23  *
24  * name               | attribution
25  * ------------------ | -----------
26  * rt_ioremap_nocache | Device (MMU_MAP_K_DEVICE)
27  * rt_ioremap_cache   | Normal memory (MMU_MAP_K_RWCB)
28  * rt_ioremap_wt      | Normal memory but guarantee that
29  *                    | Each write access should go to system memory directly
30  *                    | Currently as non-cacheable
31  */
32 
33 void *rt_ioremap_early(void *paddr, size_t size);
34 void *rt_ioremap(void *paddr, size_t size);
35 void *rt_ioremap_nocache(void *paddr, size_t size);
36 void *rt_ioremap_cached(void *paddr, size_t size);
37 void *rt_ioremap_wt(void *paddr, size_t size);
38 void rt_iounmap(volatile void *addr);
39 
40 extern void *rt_ioremap_start;
41 extern size_t rt_ioremap_size;
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif  /*__LWP_IOREMAP_H__*/
48