summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/fixmap.h
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-09-17 15:37:11 -0700
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-10-02 14:31:03 -0700
commit6262f661ff5d7d6a2613b95d0b7820c60b46b0b5 (patch)
tree2753d9f367b40e59ecdaa896337d0d13b681b77f /arch/riscv/include/asm/fixmap.h
parent8f3a2b4a96dc014e99e1df327db1450fdbbd5e15 (diff)
RISC-V: Add early ioremap support
UEFI uses early IO or memory mappings for runtime services before normal ioremap() is usable. Add the necessary fixmap bindings and pmd mappings for generic ioremap support to work. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/fixmap.h')
-rw-r--r--arch/riscv/include/asm/fixmap.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/fixmap.h b/arch/riscv/include/asm/fixmap.h
index 11613f38228a..54cbf07fb4e9 100644
--- a/arch/riscv/include/asm/fixmap.h
+++ b/arch/riscv/include/asm/fixmap.h
@@ -27,6 +27,19 @@ enum fixed_addresses {
FIX_TEXT_POKE1,
FIX_TEXT_POKE0,
FIX_EARLYCON_MEM_BASE,
+
+ __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,
+
__end_of_fixed_addresses
};