Lines Matching +full:used +full:- +full:by +full:- +full:rtas
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
8 * Adapted for Power Macintosh by Paul Mackerras.
9 * Low-level exception handlers and MMU support
10 * rewritten by Paul Mackerras.
13 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
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>
52 * using the layout described in exceptions-64s.S
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
70 * 3. Secondary CPUs enter as directed by OPAL_START_CPU call, which
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
119 /* This flag is set to 1 by a loader if the kernel should run
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
204 #include "exceptions-64s.S"
216 * hotplug case. It is set by cpu hotplug code, and is invalid by default.
287 * but the low bit right by two bits so that the cpu numbering is
290 * If the old value of BUCSR is non-zero, this thread has run
295 * seemed like they'd be overkill. We can't tell just by looking
309 /* turn on 64-bit mode */
336 li r2,-1
341 /* turn on 64-bit mode */
390 addi r11,r11,(2f - 1b)
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
536 li r2,-1
539 * Are we booted from a PROM Of-type client-interface ?
543 b __boot_from_prom /* yes -> prom */
572 addis r26,r26,(_stext - 0b)@ha
573 addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
580 /* Get TOC pointer, non-virtual */
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
691 p_end: .8byte _end - copy_to_here
696 * _end - copy_to_here to the copy limit and run again.
706 * Copy routine used to copy the kernel to start at physical address 0
714 addi r5,r5,-8
715 addi r6,r6,-8
768 /* turn on 64-bit mode */
783 addi r11,r11,(2f - 1b)
879 * zero the stack back-chain pointer and get the TOC virtual address
919 * This puts the TOC pointer into r2, offset by 0x8000 (as expected
920 * by the toolchain). It computes the correct value for wherever we
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
959 * to clear it now for kexec-style entry.
965 srdi. r11,r11,3 /* shift right by 3 */
967 addi r8,r8,-8
999 stdu r0,-STACK_FRAME_MIN_SIZE(r1)