summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/efi.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-10-12 14:57:32 +0200
committerArd Biesheuvel <ardb@kernel.org>2022-11-09 12:42:03 +0100
commit895bc3a135ffe9475de04b30e274f57a176cd3ef (patch)
tree095e1bef70d74e863ba6bd043e4f3dc60e701d19 /arch/riscv/include/asm/efi.h
parent1f1ba325a23df6739b6b5e52f40ec1aa228108b2 (diff)
efi: libstub: Factor out min alignment and preferred kernel load address
Factor out the expressions that describe the preferred placement of the loaded image as well as the minimum alignment so we can reuse them in the decompressor. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'arch/riscv/include/asm/efi.h')
-rw-r--r--arch/riscv/include/asm/efi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/efi.h b/arch/riscv/include/asm/efi.h
index d0570936cb8c..a742868eb23c 100644
--- a/arch/riscv/include/asm/efi.h
+++ b/arch/riscv/include/asm/efi.h
@@ -31,6 +31,17 @@ static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr)
return ULONG_MAX;
}
+static inline unsigned long efi_get_kimg_min_align(void)
+{
+ /*
+ * RISC-V requires the kernel image to placed 2 MB aligned base for 64
+ * bit and 4MB for 32 bit.
+ */
+ return IS_ENABLED(CONFIG_64BIT) ? SZ_2M : SZ_4M;
+}
+
+#define EFI_KIMG_PREFERRED_ADDRESS efi_get_kimg_min_align()
+
void efi_virtmap_load(void);
void efi_virtmap_unload(void);