1 /* $NetBSD: explora_start.S,v 1.5 2008/04/28 20:23:17 martin Exp $ */
4 * Copyright (c) 2003 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Juergen Hannken-Illjes.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
35 * iccr = 0x00008001 0x80000000-0x87ffffff 0xf80000000-0xffffffff
36 * dccr = 0x00008001 0x80000000-0x87ffffff 0xf80000000-0xffffffff
38 * msr = 0x00001000 ME=machine check enable
46 #include <machine/param.h>
47 #include <machine/psl.h>
48 #include <machine/trap.h>
49 #include <machine/asm.h>
51 #include <powerpc/spr.h>
52 #include <powerpc/ibm4xx/dcr403cgx.h>
53 #include <powerpc/ibm4xx/pmap.h>
56 #include "opt_ppcparam.h"
59 * Initially the dram starts at 0x01000000. This is way too high.
60 * We relocate dram to 0x00000000. We use the video ram at 0xf0000000
61 * as a temporary staging area.
64 #define STAGE1_BASE 0xf0000000
78 /* Disable exceptions, caches, invalidate all TLB's. */
88 /* Clear caches and invalidate tlbs */
109 /* Get current address -- NOT the same as . */
114 subi 3,3,_next-__start
116 ori 4,4,STAGE1_BASE@l
129 /* Jump into the staging area so we can remap the dram. */
132 ori 0,0,stage1reloc@l
136 stage1reloc = .-__start+STAGE1_BASE
138 /* Remap the dram from 0x01000000 to 0x00000000. */
140 #define REMAP(r, tmp1, tmp2) \
143 ori tmp2,tmp2,0xffff ; \
146 addis tmp1,tmp1,0xf000 ; \
163 #ifdef PPC_4XX_NOCACHE
173 /* get start of bss */
174 lis 7,_C_LABEL(edata)-4@h
175 ori 7,7,_C_LABEL(edata)-4@l
176 /* get end of kernel */
177 lis 4,_C_LABEL(end)@h
178 ori 4,4,_C_LABEL(end)@l
186 INIT_CPUINFO(4,1,9,0)
191 /* Run the remaining setup in C. */
192 bl _C_LABEL(bootstrap)
200 stage1size = .-__start
202 #include <powerpc/ibm4xx/4xx_locore.S>