/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2019 Western Digital Corporation or its affiliates.3*/45#ifndef _ASM_RISCV_FIXMAP_H6#define _ASM_RISCV_FIXMAP_H78#include <linux/kernel.h>9#include <linux/sizes.h>10#include <linux/pgtable.h>11#include <asm/page.h>1213#ifdef CONFIG_MMU14/*15* Here we define all the compile-time 'special' virtual addresses.16* The point is to have a constant address at compile time, but to17* set the physical address only in the boot process.18*19* These 'compile-time allocated' memory buffers are page-sized. Use20* set_fixmap(idx,phys) to associate physical memory with fixmap indices.21*/22enum fixed_addresses {23FIX_HOLE,24/*25* The fdt fixmap mapping must be PMD aligned and will be mapped26* using PMD entries in fixmap_pmd in 64-bit and a PGD entry in 32-bit.27*/28FIX_FDT_END,29FIX_FDT = FIX_FDT_END + FIX_FDT_SIZE / PAGE_SIZE - 1,3031/* Below fixmaps will be mapped using fixmap_pte */32FIX_PTE,33FIX_PMD,34FIX_PUD,35FIX_P4D,36FIX_TEXT_POKE1,37FIX_TEXT_POKE0,38FIX_EARLYCON_MEM_BASE,3940__end_of_permanent_fixed_addresses,41/*42* Temporary boot-time mappings, used by early_ioremap(),43* before ioremap() is functional.44*/45#define NR_FIX_BTMAPS (SZ_256K / PAGE_SIZE)46#define FIX_BTMAPS_SLOTS 747#define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)4849FIX_BTMAP_END = __end_of_permanent_fixed_addresses,50FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,5152__end_of_fixed_addresses53};5455#define __early_set_fixmap __set_fixmap5657#define __late_set_fixmap __set_fixmap58#define __late_clear_fixmap(idx) __set_fixmap((idx), 0, FIXMAP_PAGE_CLEAR)5960extern void __set_fixmap(enum fixed_addresses idx,61phys_addr_t phys, pgprot_t prot);6263#include <asm-generic/fixmap.h>6465#endif /* CONFIG_MMU */66#endif /* _ASM_RISCV_FIXMAP_H */676869