2019-01-07 20:57:01 +05:30
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright ( C ) 2019 Western Digital Corporation or its affiliates .
*/
# ifndef _ASM_RISCV_FIXMAP_H
# define _ASM_RISCV_FIXMAP_H
# include <linux/kernel.h>
# include <linux/sizes.h>
2020-06-08 21:32:38 -07:00
# include <linux/pgtable.h>
2020-06-08 21:32:42 -07:00
# include <asm/page.h>
2019-01-07 20:57:01 +05:30
2019-10-28 13:10:41 +01:00
# ifdef CONFIG_MMU
2019-01-07 20:57:01 +05:30
/*
* Here we define all the compile - time ' special ' virtual addresses .
* The point is to have a constant address at compile time , but to
* set the physical address only in the boot process .
*
* These ' compile - time allocated ' memory buffers are page - sized . Use
* set_fixmap ( idx , phys ) to associate physical memory with fixmap indices .
*/
enum fixed_addresses {
FIX_HOLE ,
2019-06-28 13:36:21 -07:00
FIX_PTE ,
FIX_PMD ,
2021-12-06 11:46:51 +01:00
FIX_PUD ,
2022-01-27 10:48:42 +08:00
FIX_P4D ,
2020-03-10 00:55:43 +08:00
FIX_TEXT_POKE1 ,
FIX_TEXT_POKE0 ,
2019-01-07 20:57:01 +05:30
FIX_EARLYCON_MEM_BASE ,
2020-09-17 15:37:11 -07:00
__end_of_permanent_fixed_addresses ,
/*
* Temporary boot - time mappings , used by early_ioremap ( ) ,
* before ioremap ( ) is functional .
*/
# define NR_FIX_BTMAPS (SZ_256K / PAGE_SIZE)
# define FIX_BTMAPS_SLOTS 7
# define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
FIX_BTMAP_END = __end_of_permanent_fixed_addresses ,
FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1 ,
2019-01-07 20:57:01 +05:30
__end_of_fixed_addresses
} ;
# define FIXMAP_PAGE_IO PAGE_KERNEL
# define __early_set_fixmap __set_fixmap
# define __late_set_fixmap __set_fixmap
# define __late_clear_fixmap(idx) __set_fixmap((idx), 0, FIXMAP_PAGE_CLEAR)
extern void __set_fixmap ( enum fixed_addresses idx ,
phys_addr_t phys , pgprot_t prot ) ;
# include <asm-generic/fixmap.h>
2019-10-28 13:10:41 +01:00
# endif /* CONFIG_MMU */
2019-01-07 20:57:01 +05:30
# endif /* _ASM_RISCV_FIXMAP_H */