Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_EARLY_IOREMAP_H_
0003 #define _ASM_EARLY_IOREMAP_H_
0004 
0005 #include <linux/types.h>
0006 
0007 /*
0008  * early_ioremap() and early_iounmap() are for temporary early boot-time
0009  * mappings, before the real ioremap() is functional.
0010  */
0011 extern void __iomem *early_ioremap(resource_size_t phys_addr,
0012                    unsigned long size);
0013 extern void *early_memremap(resource_size_t phys_addr,
0014                 unsigned long size);
0015 extern void *early_memremap_ro(resource_size_t phys_addr,
0016                    unsigned long size);
0017 extern void *early_memremap_prot(resource_size_t phys_addr,
0018                  unsigned long size, unsigned long prot_val);
0019 extern void early_iounmap(void __iomem *addr, unsigned long size);
0020 extern void early_memunmap(void *addr, unsigned long size);
0021 
0022 #if defined(CONFIG_GENERIC_EARLY_IOREMAP) && defined(CONFIG_MMU)
0023 /* Arch-specific initialization */
0024 extern void early_ioremap_init(void);
0025 
0026 /* Generic initialization called by architecture code */
0027 extern void early_ioremap_setup(void);
0028 
0029 /*
0030  * Called as last step in paging_init() so library can act
0031  * accordingly for subsequent map/unmap requests.
0032  */
0033 extern void early_ioremap_reset(void);
0034 
0035 /*
0036  * Early copy from unmapped memory to kernel mapped memory.
0037  */
0038 extern void copy_from_early_mem(void *dest, phys_addr_t src,
0039                 unsigned long size);
0040 
0041 #else
0042 static inline void early_ioremap_init(void) { }
0043 static inline void early_ioremap_setup(void) { }
0044 static inline void early_ioremap_reset(void) { }
0045 #endif
0046 
0047 #endif /* _ASM_EARLY_IOREMAP_H_ */