Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37a048d7 authored by Sean Anderson's avatar Sean Anderson Committed by Greg Kroah-Hartman
Browse files

riscv: Set text_offset correctly for M-Mode



[ Upstream commit 79605f1394261995c2b955c906a5a20fb27cdc84 ]

M-Mode Linux is loaded at the start of RAM, not 2MB later. Perhaps this
should be calculated based on PAGE_OFFSET somehow? Even better would be to
deprecate text_offset and instead introduce something absolute.

Signed-off-by: default avatarSean Anderson <seanga2@gmail.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6d8b4337
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -26,12 +26,17 @@ ENTRY(_start)
	/* reserved */
	.word 0
	.balign 8
#ifdef CONFIG_RISCV_M_MODE
	/* Image load offset (0MB) from start of RAM for M-mode */
	.dword 0
#else
#if __riscv_xlen == 64
	/* Image load offset(2MB) from start of RAM */
	.dword 0x200000
#else
	/* Image load offset(4MB) from start of RAM */
	.dword 0x400000
#endif
#endif
	/* Effective size of kernel image */
	.dword _end - _start