Skip to content

Commit 15ad838

Browse files
tsbogendralfbaechle
authored andcommitted
[MIPS] Always do the ARC64_TWIDDLE_PC thing.
Always jump to the place where the kernel is linked to. This helps where the bootloaders/proms ignores the start address inside the ELF header. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent d85714d commit 15ad838

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎arch/mips/kernel/head.S‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@
2727

2828
#include <kernel-entry-init.h>
2929

30-
.macro ARC64_TWIDDLE_PC
31-
#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
32-
/* We get launched at a XKPHYS address but the kernel is linked to
33-
run at a KSEG0 address, so jump there. */
34-
PTR_LA t0, \@f
35-
jr t0
36-
\@:
37-
#endif
38-
.endm
39-
4030
/*
4131
* inputs are the text nasid in t1, data nasid in t2.
4232
*/
@@ -157,7 +147,11 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
157147

158148
setup_c0_status_pri
159149

160-
ARC64_TWIDDLE_PC
150+
/* We might not get launched at the address the kernel is linked to,
151+
so we jump there. */
152+
PTR_LA t0, 0f
153+
jr t0
154+
0:
161155

162156
#ifdef CONFIG_MIPS_MT_SMTC
163157
/*

‎include/asm-mips/mach-ip27/kernel-entry-init.h‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@
4646
lh t1, KV_RO_NASID_OFFSET(t0)
4747
lh t2, KV_RW_NASID_OFFSET(t0)
4848
MAPPED_KERNEL_SETUP_TLB
49-
ARC64_TWIDDLE_PC
49+
50+
/*
51+
* We might not get launched at the address the kernel is linked to,
52+
* so we jump there.
53+
*/
54+
PTR_LA t0, 0f
55+
jr t0
56+
0:
5057
.endm
5158

5259
#endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */

0 commit comments

Comments
 (0)