2 * This file is part of the LinuxBIOS project.
4 * Copyright (C) 2000 AG Electronics Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 * The assumption is that we're located in ROM and we have a fake stack
22 * located in cache. Our task is to turn on memory proper, the finish
23 * configuring the machine.
28 #include <ppc_asm.tmpl>
35 * init stack pointer to real ram now that memory is on
36 * Note: We use the last 8 bytes on the stack to hold struct cpu_info,
37 * Which are initialized to zero as we clear the stack.
41 addi r1, r1, _estack@l
51 addi r7, r7, _estack@l
74 * Set up the EABI pointers, before we enter any C code
76 lis r13, _SDA_BASE_@ha
77 addi r13, r13, _SDA_BASE_@l
78 lis r2, _SDA2_BASE_@ha
79 addi r2, r2, _SDA2_BASE_@l
82 * load start address into SRR0 for rfi
84 lis r3, hardwaremain@ha
85 addi r3, r3, hardwaremain@l
89 * load the current MSR into SRR1 so that it will be copied
90 * back into MSR on rfi
93 mtspr SRR1, r4 // load SRR1 with r4
96 * If something returns after rfi then die
103 * Complete rest of initialization in C (hardwaremain)
108 * Stop here if something goes wrong
114 /* Remove need for ecrti.o and ectrn.o */