2 * Copyright (c) 2003, 2004
3 * The Regents of The University of Michigan
6 * This code is part of the M5 simulator.
8 * Permission is granted to use, copy, create derivative works and
9 * redistribute this software and such derivative works for any purpose,
10 * so long as the copyright notice above, this grant of permission, and
11 * the disclaimer below appear in all copies made; and so long as the
12 * name of The University of Michigan is not used in any advertising or
13 * publicity pertaining to the use or distribution of this software
14 * without specific, written prior authorization.
16 * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
17 * UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
18 * WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
19 * IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
21 * THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
22 * INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
23 * DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
24 * WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
29 * Copyright 1993 Hewlett-Packard Development Company, L.P.
31 * Permission is hereby granted, free of charge, to any person
32 * obtaining a copy of this software and associated documentation
33 * files (the "Software"), to deal in the Software without
34 * restriction, including without limitation the rights to use, copy,
35 * modify, merge, publish, distribute, sublicense, and/or sell copies
36 * of the Software, and to permit persons to whom the Software is
37 * furnished to do so, subject to the following conditions:
39 * The above copyright notice and this permission notice shall be
40 * included in all copies or substantial portions of the Software.
42 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
43 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
45 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
46 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
47 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
48 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
52 #include "dc21164FromGasSources.h" // DECchip 21164 specific definitions
54 #include "fromHudsonOsf.h" // OSF/1 specific definitions
55 #include "fromHudsonMacros.h" // Global macro definitions
61 * First free PFN - a3?
63 * Enable kseg addressing in ICSR
64 * Enable kseg addressing in MCSR
65 * Set VTBR -- Set to 1GB as per SRM, or maybe 8GB??
66 * Set PCBB -- pass pointer in arg
67 * Set PTBR -- get it out of PCB
68 * Set KSP -- get it out of PCB
70 * Jump to kernel address
77 * s5 osf_param (sysconfigtab) NULL
89 /* Point the Vptbr at 8GB */
93 mtpr t0, mVptBr // Load Mbox copy
94 mtpr t0, iVptBr // Load Ibox copy
95 STALL // don't dual issue the load with mtpr -pb
97 /* Turn on superpage mapping in the mbox and icsr */
98 lda t0, (2<<MCSR_V_SP)(zero) // Get a '10' (binary) in MCSR<SP>
99 STALL // don't dual issue the load with mtpr -pb
100 mtpr t0, mcsr // Set the super page mode enable bit
101 STALL // don't dual issue the load with mtpr -pb
108 STALL // don't dual issue the load with mtpr -pb
109 mfpr t0, icsr // Enable superpage mapping
110 STALL // don't dual issue the load with mtpr -pb
114 STALL // Required stall to update chip ...
120 ldq_p s0, PCB_Q_PTBR(a1)
121 sll s0, VA_S_OFF, s0 // Shift PTBR into position
122 STALL // don't dual issue the load with mtpr -pb
123 mtpr s0, ptPtbr // PHYSICAL MBOX INST -> MT PT20 IN 0,1
124 STALL // don't dual issue the load with mtpr -pb
125 ldq_p sp, PCB_Q_KSP(a1)
127 mtpr a0, excAddr // Load the dispatch address.
128 STALL // don't dual issue the load with mtpr -pb
129 bis a3, zero, a0 // first free PFN
130 ldq_p a1, PCB_Q_PTBR(a1) // ptbr
131 ldq_p a2, 24(zero) // argc
132 ldq_p a3, 32(zero) // argv
133 ldq_p a4, 40(zero) // environ
134 lda a5, 0(zero) // osf_param
135 STALL // don't dual issue the load with mtpr -pb
136 mtpr zero, dtbIa // Flush all D-stream TB entries
137 mtpr zero, itbIa // Flush all I-stream TB entries
143 mtpr zero, icFlush // Flush the icache.
147 NOP // Required NOPs ... 1-10
158 NOP // Required NOPs ... 11-20
169 NOP // Required NOPs ... 21-30
180 NOP // Required NOPs ... 31-40
191 NOP // Required NOPs ... 41-44
196 hw_rei_stall // Dispatch to kernel