blob: 2edef8d7fa6b8a1fe65bacb8e0d110f55b5e803f [file] [log] [blame]
Mark Salter9e5c33d2014-04-07 15:39:48 -07001#ifndef _ASM_EARLY_IOREMAP_H_
2#define _ASM_EARLY_IOREMAP_H_
3
4#include <linux/types.h>
5
6/*
7 * early_ioremap() and early_iounmap() are for temporary early boot-time
8 * mappings, before the real ioremap() is functional.
9 */
10extern void __iomem *early_ioremap(resource_size_t phys_addr,
11 unsigned long size);
12extern void *early_memremap(resource_size_t phys_addr,
13 unsigned long size);
Juergen Gross2592dbb2015-07-17 06:51:33 +020014extern void *early_memremap_ro(resource_size_t phys_addr,
15 unsigned long size);
Tom Lendackyf88a68f2017-07-17 16:10:09 -050016extern void *early_memremap_prot(resource_size_t phys_addr,
17 unsigned long size, unsigned long prot_val);
Mark Salter9e5c33d2014-04-07 15:39:48 -070018extern void early_iounmap(void __iomem *addr, unsigned long size);
19extern void early_memunmap(void *addr, unsigned long size);
20
21/*
22 * Weak function called by early_ioremap_reset(). It does nothing, but
23 * architectures may provide their own version to do any needed cleanups.
24 */
25extern void early_ioremap_shutdown(void);
26
27#if defined(CONFIG_GENERIC_EARLY_IOREMAP) && defined(CONFIG_MMU)
28/* Arch-specific initialization */
29extern void early_ioremap_init(void);
30
31/* Generic initialization called by architecture code */
32extern void early_ioremap_setup(void);
33
34/*
35 * Called as last step in paging_init() so library can act
36 * accordingly for subsequent map/unmap requests.
37 */
38extern void early_ioremap_reset(void);
39
Mark Salter6b0f68e2015-09-08 15:03:01 -070040/*
41 * Early copy from unmapped memory to kernel mapped memory.
42 */
43extern void copy_from_early_mem(void *dest, phys_addr_t src,
44 unsigned long size);
45
Mark Salter9e5c33d2014-04-07 15:39:48 -070046#else
47static inline void early_ioremap_init(void) { }
48static inline void early_ioremap_setup(void) { }
49static inline void early_ioremap_reset(void) { }
50#endif
51
52#endif /* _ASM_EARLY_IOREMAP_H_ */