Linux 5.6.13
[linux/fpc-iii.git] / arch / riscv / include / asm / fixmap.h
blob42d2c42f3cc946d2b3b9eabe6758eb9fcd64e4ea
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2019 Western Digital Corporation or its affiliates.
4 */
6 #ifndef _ASM_RISCV_FIXMAP_H
7 #define _ASM_RISCV_FIXMAP_H
9 #include <linux/kernel.h>
10 #include <linux/sizes.h>
11 #include <asm/page.h>
12 #include <asm/pgtable.h>
14 #ifdef CONFIG_MMU
16 * Here we define all the compile-time 'special' virtual addresses.
17 * The point is to have a constant address at compile time, but to
18 * set the physical address only in the boot process.
20 * These 'compile-time allocated' memory buffers are page-sized. Use
21 * set_fixmap(idx,phys) to associate physical memory with fixmap indices.
23 enum fixed_addresses {
24 FIX_HOLE,
25 #define FIX_FDT_SIZE SZ_1M
26 FIX_FDT_END,
27 FIX_FDT = FIX_FDT_END + FIX_FDT_SIZE / PAGE_SIZE - 1,
28 FIX_PTE,
29 FIX_PMD,
30 FIX_EARLYCON_MEM_BASE,
31 __end_of_fixed_addresses
34 #define FIXMAP_PAGE_IO PAGE_KERNEL
36 #define __early_set_fixmap __set_fixmap
38 #define __late_set_fixmap __set_fixmap
39 #define __late_clear_fixmap(idx) __set_fixmap((idx), 0, FIXMAP_PAGE_CLEAR)
41 extern void __set_fixmap(enum fixed_addresses idx,
42 phys_addr_t phys, pgprot_t prot);
44 #include <asm-generic/fixmap.h>
46 #endif /* CONFIG_MMU */
47 #endif /* _ASM_RISCV_FIXMAP_H */