Commit 79605f13 authored by Sean Anderson's avatar Sean Anderson Committed by Palmer Dabbelt

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: default avatarSean Anderson <seanga2@gmail.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 1bd14a66
...@@ -35,12 +35,17 @@ ENTRY(_start) ...@@ -35,12 +35,17 @@ ENTRY(_start)
.word 0 .word 0
#endif #endif
.balign 8 .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 #if __riscv_xlen == 64
/* Image load offset(2MB) from start of RAM */ /* Image load offset(2MB) from start of RAM */
.dword 0x200000 .dword 0x200000
#else #else
/* Image load offset(4MB) from start of RAM */ /* Image load offset(4MB) from start of RAM */
.dword 0x400000 .dword 0x400000
#endif
#endif #endif
/* Effective size of kernel image */ /* Effective size of kernel image */
.dword _end - _start .dword _end - _start
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment