riscv: provide a flat image loader

This allows just loading the kernel at a pre-set address without
qemu going bonkers trying to map the ELF file.

Contains a contribution from Aurabindo Jayamohanan to reuse the
PAGE_OFFSET definition.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anup Patel <anup@brainfault.org>
[paul.walmsley@sifive.com: fixed checkpatch issue; minor commit
 message fix]
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
This commit is contained in:
Christoph Hellwig
2019-10-28 13:10:42 +01:00
committed by Paul Walmsley
parent 6bd33e1ece
commit 405fe7aa0d
4 changed files with 39 additions and 5 deletions

8
arch/riscv/boot/loader.S Normal file
View File

@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0 */
.align 4
.section .payload, "ax", %progbits
.globl _start
_start:
.incbin "arch/riscv/boot/Image"