Lines Matching +full:bl +full:- +full:code +full:- +full:offset
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
9 * Low-level exception handlers and MMU support
16 * This file contains the entry point for the 64-bit kernel along
17 * with some early initialization code common to all 64-bit powerpc
28 #include <asm/head-64.h>
29 #include <asm/asm-offsets.h>
42 #include <asm/ppc-opcode.h>
43 #include <asm/feature-fixups.h>
45 #include <asm/exception-64s.h>
47 #include <asm/exception-64e.h>
51 * spin code sits at 0x0000...0x00ff. On server, the vectors follow
52 * using the layout described in exceptions-64s.S
56 * Entering into this code we make the following assumptions:
61 * 3. If the RTAS supports "query-cpu-stopped-state", then secondary
62 * CPUs will enter as directed by "start-cpu" RTAS call, which is
65 * directed by the "start-cpu" RTS call, with PIR in r3.
66 * -or- For OPAL entry:
68 * 2. The primary CPU enters at 0 with device-tree in r3, OPAL base
103 /* Secondary processors spin on this value until it becomes non-zero.
104 * When non-zero, it contains the real address of the function the cpu
121 * is used by kexec-tools to keep the kdump kernel in the
129 #define RUN_AT_LOAD_DEFAULT 0x72756e30 /* "run0" -- relocate to 0 by default */
132 /* Do not move this variable as kexec-tools knows about it. */
142 * The following code is used to hold secondary processors
144 * before the bulk of the kernel has been relocated. This code
165 /* than 0x100, so only need to grab low order offset. */
189 /* Make sure that patched code is visible */
199 * On server, we include the exception vectors code here as it
204 #include "exceptions-64s.S"
216 * hotplug case. It is set by cpu hotplug code, and is invalid by default.
290 * If the old value of BUCSR is non-zero, this thread has run
309 /* turn on 64-bit mode */
310 bl enable_64b_mode
314 bl book3e_secondary_thread_init
315 bl relative_toc
323 * in the following code.
336 li r2,-1
341 /* turn on 64-bit mode */
342 bl enable_64b_mode
348 bl book3e_secondary_core_init
378 bl book3e_start_thread
382 bl book3e_stop_thread
390 addi r11,r11,(2f - 1b)
395 bl relative_toc
467 isync /* In case code patching happened */
504 1: bl __cpu_preinit_ppc970
508 bl __mmu_off
521 * r5 != NULL -> OF entry, we go to prom_init, "legacy" parameter content
524 * r5 == NULL -> kexec style entry. r3 is a physical pointer to the
530 bl enable_64b_mode
536 li r2,-1
539 * Are we booted from a PROM Of-type client-interface ?
543 b __boot_from_prom /* yes -> prom */
555 bl relative_toc
559 bl start_initialization_book3e
561 bl start_initialization_book3s
565 bl relative_toc
572 addis r26,r26,(_stext - 0b)@ha
573 addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
580 /* Get TOC pointer, non-virtual */
581 bl relative_toc
586 addis r26,r26,(_stext - 0b)@ha
587 addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
597 * Align the stack to 16-byte boundary
604 /* Relocate code for where we are now */
606 bl relocate
618 bl CFUNC(prom_init)
635 bl relocate
638 bl init_core_book3e
644 * This will leave some code in the first 256B of
653 li r6,0x100 /* Start offset, the first 0x100 */
681 bl copy_and_flush /* copy the first n bytes */
682 /* this includes the code being */
684 /* Jump to the copy of this code that we just made */
691 p_end: .8byte _end - copy_to_here
696 * _end - copy_to_here to the copy limit and run again.
701 5: bl copy_and_flush /* copy the rest */
708 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
714 addi r5,r5,-8
715 addi r6,r6,-8
768 /* turn on 64-bit mode */
769 bl enable_64b_mode
783 addi r11,r11,(2f - 1b)
788 bl relative_toc
791 bl __restore_cpu_ppc970
847 bl CFUNC(early_setup_secondary)
879 * zero the stack back-chain pointer and get the TOC virtual address
880 * before going into C code.
886 bl CFUNC(start_secondary)
897 bl CFUNC(start_secondary)
919 * This puts the TOC pointer into r2, offset by 0x8000 (as expected
921 * are running at the moment, using position-independent code.
924 * TOC in -mcmodel=medium mode. After we relocate to 0 but before
933 tdnei r2,-1
939 ld r2,(p_toc - 0b)(r11)
945 p_toc: .8byte .TOC. - 0b
949 * This is where the main kernel code starts.
954 bl relative_toc
959 * to clear it now for kexec-style entry.
967 addi r8,r8,-8
999 stdu r0,-STACK_FRAME_MIN_SIZE(r1)
1007 bl CFUNC(kasan_early_init)
1040 bl CFUNC(start_kernel)