Skip to content

Commit 79605f1

Browse files
Forty-Botpalmer-dabbelt
authored andcommitted
riscv: Set text_offset correctly for M-Mode
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: Sean Anderson <seanga2@gmail.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent 1bd14a6 commit 79605f1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

arch/riscv/kernel/head.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,17 @@ ENTRY(_start)
3535
.word 0
3636
#endif
3737
.balign 8
38+
#ifdef CONFIG_RISCV_M_MODE
39+
/* Image load offset (0MB) from start of RAM for M-mode */
40+
.dword 0
41+
#else
3842
#if __riscv_xlen == 64
3943
/* Image load offset(2MB) from start of RAM */
4044
.dword 0x200000
4145
#else
4246
/* Image load offset(4MB) from start of RAM */
4347
.dword 0x400000
48+
#endif
4449
#endif
4550
/* Effective size of kernel image */
4651
.dword _end - _start

0 commit comments

Comments
 (0)