.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * PowerPC version |
---|
3 | 4 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) |
---|
.. | .. |
---|
15 | 16 | * This file contains the entry point for the 64-bit kernel along |
---|
16 | 17 | * with some early initialization code common to all 64-bit powerpc |
---|
17 | 18 | * variants. |
---|
18 | | - * |
---|
19 | | - * This program is free software; you can redistribute it and/or |
---|
20 | | - * modify it under the terms of the GNU General Public License |
---|
21 | | - * as published by the Free Software Foundation; either version |
---|
22 | | - * 2 of the License, or (at your option) any later version. |
---|
23 | 19 | */ |
---|
24 | 20 | |
---|
25 | 21 | #include <linux/threads.h> |
---|
.. | .. |
---|
186 | 182 | isync |
---|
187 | 183 | bctr |
---|
188 | 184 | #else |
---|
189 | | - BUG_OPCODE |
---|
| 185 | +0: trap |
---|
| 186 | + EMIT_BUG_ENTRY 0b, __FILE__, __LINE__, 0 |
---|
190 | 187 | #endif |
---|
191 | 188 | CLOSE_FIXED_SECTION(first_256B) |
---|
192 | 189 | |
---|
.. | .. |
---|
303 | 300 | rlwimi r3, r3, 30, 2, 30 |
---|
304 | 301 | mtspr SPRN_PIR, r3 |
---|
305 | 302 | 1: |
---|
306 | | -#endif |
---|
307 | | - |
---|
308 | | -_GLOBAL(generic_secondary_thread_init) |
---|
309 | 303 | mr r24,r3 |
---|
310 | 304 | |
---|
311 | 305 | /* turn on 64-bit mode */ |
---|
.. | .. |
---|
315 | 309 | bl relative_toc |
---|
316 | 310 | tovirt(r2,r2) |
---|
317 | 311 | |
---|
318 | | -#ifdef CONFIG_PPC_BOOK3E |
---|
319 | 312 | /* Book3E initialization */ |
---|
320 | 313 | mr r3,r24 |
---|
321 | 314 | bl book3e_secondary_thread_init |
---|
322 | | -#endif |
---|
323 | 315 | b generic_secondary_common_init |
---|
| 316 | + |
---|
| 317 | +#endif /* CONFIG_PPC_BOOK3E */ |
---|
324 | 318 | |
---|
325 | 319 | /* |
---|
326 | 320 | * On pSeries and most other platforms, secondary processors spin |
---|
.. | .. |
---|
540 | 534 | b __after_prom_start |
---|
541 | 535 | #endif /* CONFIG_PPC_BOOK3E */ |
---|
542 | 536 | |
---|
| 537 | +__REF |
---|
543 | 538 | __boot_from_prom: |
---|
544 | 539 | #ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE |
---|
545 | 540 | /* Save parameters */ |
---|
.. | .. |
---|
577 | 572 | /* We never return. We also hit that trap if trying to boot |
---|
578 | 573 | * from OF while CONFIG_PPC_OF_BOOT_TRAMPOLINE isn't selected */ |
---|
579 | 574 | trap |
---|
| 575 | + .previous |
---|
580 | 576 | |
---|
581 | 577 | __after_prom_start: |
---|
582 | 578 | #ifdef CONFIG_RELOCATABLE |
---|
.. | .. |
---|
639 | 635 | sub r5,r5,r11 |
---|
640 | 636 | #else |
---|
641 | 637 | /* just copy interrupts */ |
---|
642 | | - LOAD_REG_IMMEDIATE(r5, FIXED_SYMBOL_ABS_ADDR(__end_interrupts)) |
---|
| 638 | + LOAD_REG_IMMEDIATE_SYM(r5, r11, FIXED_SYMBOL_ABS_ADDR(__end_interrupts)) |
---|
643 | 639 | #endif |
---|
644 | 640 | b 5f |
---|
645 | 641 | 3: |
---|
.. | .. |
---|
801 | 797 | /* Set thread priority to MEDIUM */ |
---|
802 | 798 | HMT_MEDIUM |
---|
803 | 799 | |
---|
804 | | - /* Initialize the kernel stack */ |
---|
805 | | - LOAD_REG_ADDR(r3, current_set) |
---|
806 | | - sldi r28,r24,3 /* get current_set[cpu#] */ |
---|
807 | | - ldx r14,r3,r28 |
---|
808 | | - addi r14,r14,THREAD_SIZE-STACK_FRAME_OVERHEAD |
---|
809 | | - std r14,PACAKSAVE(r13) |
---|
810 | | - |
---|
811 | | - /* Do early setup for that CPU (SLB and hash table pointer) */ |
---|
| 800 | + /* |
---|
| 801 | + * Do early setup for this CPU, in particular initialising the MMU so we |
---|
| 802 | + * can turn it on below. This is a call to C, which is OK, we're still |
---|
| 803 | + * running on the emergency stack. |
---|
| 804 | + */ |
---|
812 | 805 | bl early_setup_secondary |
---|
813 | 806 | |
---|
814 | 807 | /* |
---|
815 | | - * setup the new stack pointer, but *don't* use this until |
---|
816 | | - * translation is on. |
---|
| 808 | + * The primary has initialized our kernel stack for us in the paca, grab |
---|
| 809 | + * it and put it in r1. We must *not* use it until we turn on the MMU |
---|
| 810 | + * below, because it may not be inside the RMO. |
---|
817 | 811 | */ |
---|
818 | | - mr r1, r14 |
---|
| 812 | + ld r1, PACAKSAVE(r13) |
---|
819 | 813 | |
---|
820 | 814 | /* Clear backchain so we get nice backtraces */ |
---|
821 | 815 | li r7,0 |
---|
.. | .. |
---|
975 | 969 | RFI |
---|
976 | 970 | b . /* prevent speculative execution */ |
---|
977 | 971 | |
---|
978 | | - .previous |
---|
979 | 972 | /* This is where all platforms converge execution */ |
---|
980 | 973 | |
---|
981 | 974 | start_here_common: |
---|
.. | .. |
---|
997 | 990 | bl start_kernel |
---|
998 | 991 | |
---|
999 | 992 | /* Not reached */ |
---|
1000 | | - BUG_OPCODE |
---|
| 993 | +0: trap |
---|
| 994 | + EMIT_BUG_ENTRY 0b, __FILE__, __LINE__, 0 |
---|
| 995 | + .previous |
---|
1001 | 996 | |
---|
1002 | 997 | /* |
---|
1003 | 998 | * We put a few things here that have to be page-aligned. |
---|