paljtoslave.S revision 8013
12SN/A/*
21458SN/A * Copyright (c) 2003, 2004
32SN/A * The Regents of The University of Michigan
42SN/A * All Rights Reserved
52SN/A *
62SN/A * This code is part of the M5 simulator, developed by Nathan Binkert,
72SN/A * Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions
82SN/A * from Ron Dreslinski, Dave Greene, Lisa Hsu, Ali Saidi, and Andrew
92SN/A * Schultz.
102SN/A *
112SN/A * Permission is granted to use, copy, create derivative works and
122SN/A * redistribute this software and such derivative works for any purpose,
132SN/A * so long as the copyright notice above, this grant of permission, and
142SN/A * the disclaimer below appear in all copies made; and so long as the
152SN/A * name of The University of Michigan is not used in any advertising or
162SN/A * publicity pertaining to the use or distribution of this software
172SN/A * without specific, written prior authorization.
182SN/A *
192SN/A * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
202SN/A * UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
212SN/A * WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
222SN/A * IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
232SN/A * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
242SN/A * THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
252SN/A * INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
262SN/A * DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
272665Ssaidi@eecs.umich.edu * WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
282665Ssaidi@eecs.umich.edu * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
292665Ssaidi@eecs.umich.edu */
302SN/A
312SN/A/*
321147SN/A * Copyright 1993 Hewlett-Packard Development Company, L.P.
331147SN/A *
342SN/A * Permission is hereby granted, free of charge, to any person
352037SN/A * obtaining a copy of this software and associated documentation
362037SN/A * files (the "Software"), to deal in the Software without
372428SN/A * restriction, including without limitation the rights to use, copy,
381858SN/A * modify, merge, publish, distribute, sublicense, and/or sell copies
3956SN/A * of the Software, and to permit persons to whom the Software is
402SN/A * furnished to do so, subject to the following conditions:
412107SN/A *
422SN/A * The above copyright notice and this permission notice shall be
432972Sgblack@eecs.umich.edu * included in all copies or substantial portions of the Software.
442972Sgblack@eecs.umich.edu *
452972Sgblack@eecs.umich.edu * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
462238SN/A * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
472972Sgblack@eecs.umich.edu * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
482972Sgblack@eecs.umich.edu * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
492972Sgblack@eecs.umich.edu * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
502972Sgblack@eecs.umich.edu * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
512972Sgblack@eecs.umich.edu * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
522972Sgblack@eecs.umich.edu * SOFTWARE.
532972Sgblack@eecs.umich.edu */
542972Sgblack@eecs.umich.edu
552972Sgblack@eecs.umich.edu#include "dc21164FromGasSources.h"	// DECchip 21164 specific definitions
562972Sgblack@eecs.umich.edu#include "ev5_defs.h"
573454Sgblack@eecs.umich.edu#include "fromHudsonOsf.h"		// OSF/1 specific definitions
583454Sgblack@eecs.umich.edu#include "fromHudsonMacros.h"		// Global macro definitions
592972Sgblack@eecs.umich.edu
602238SN/A/*
612972Sgblack@eecs.umich.edu * args:
622238SN/A *   a0: here
633093Sksewell@umich.edu *   a1: boot location
643093Sksewell@umich.edu *   a2: CSERVE_J_KTOPAL
653093Sksewell@umich.edu *   a3: restrart_pv
662972Sgblack@eecs.umich.edu *   a4: vptb
672972Sgblack@eecs.umich.edu *   a5: my_rpb
682972Sgblack@eecs.umich.edu *
692972Sgblack@eecs.umich.edu * SRM Console Architecture III 3-26
702972Sgblack@eecs.umich.edu */
712972Sgblack@eecs.umich.edu
722972Sgblack@eecs.umich.edu        .global	palJToSlave
732972Sgblack@eecs.umich.edu        .text	3
742972Sgblack@eecs.umich.edupalJToSlave:
752972Sgblack@eecs.umich.edu
762972Sgblack@eecs.umich.edu        ALIGN_BRANCH
772972Sgblack@eecs.umich.edu
782972Sgblack@eecs.umich.edu        bis	a3, zero, pv
792972Sgblack@eecs.umich.edu        bis	zero, zero, t11
802972Sgblack@eecs.umich.edu        bis	zero, zero, ra
812972Sgblack@eecs.umich.edu
822972Sgblack@eecs.umich.edu        /* Point the Vptbr to a2 */
832972Sgblack@eecs.umich.edu
842972Sgblack@eecs.umich.edu        mtpr	a4, mVptBr	// Load Mbox copy
852972Sgblack@eecs.umich.edu        mtpr	a4, iVptBr	// Load Ibox copy
862972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
872972Sgblack@eecs.umich.edu
882972Sgblack@eecs.umich.edu        /* Turn on superpage mapping in the mbox and icsr */
892972Sgblack@eecs.umich.edu        lda	t0, (2<<MCSR_V_SP)(zero) // Get a '10' (binary) in MCSR<SP>
902972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
912972Sgblack@eecs.umich.edu        mtpr	t0, mcsr	// Set the super page mode enable bit
922972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
932972Sgblack@eecs.umich.edu
942972Sgblack@eecs.umich.edu        lda	t0, 0(zero)
952972Sgblack@eecs.umich.edu        mtpr	t0, dtbAsn
962972Sgblack@eecs.umich.edu        mtpr	t0, itbAsn
972972Sgblack@eecs.umich.edu
982972Sgblack@eecs.umich.edu        LDLI	(t1,0x20000000)
992972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
1002972Sgblack@eecs.umich.edu        mfpr	t0, icsr	// Enable superpage mapping
1012972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
1022972Sgblack@eecs.umich.edu        bis	t0, t1, t0
1032972Sgblack@eecs.umich.edu        mtpr	t0, icsr
1042972Sgblack@eecs.umich.edu
1052972Sgblack@eecs.umich.edu        STALL			// Required stall to update chip ...
1062972Sgblack@eecs.umich.edu        STALL
1072972Sgblack@eecs.umich.edu        STALL
1082972Sgblack@eecs.umich.edu        STALL
1092972Sgblack@eecs.umich.edu        STALL
1102972Sgblack@eecs.umich.edu
1112972Sgblack@eecs.umich.edu        ldq_p	s0, PCB_Q_PTBR(a5)
1122972Sgblack@eecs.umich.edu        sll	s0, VA_S_OFF, s0 // Shift PTBR into position
1132972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
1142972Sgblack@eecs.umich.edu        mtpr	s0, ptPtbr	// PHYSICAL MBOX INST -> MT PT20 IN 0,1
1152972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
1162972Sgblack@eecs.umich.edu        ldq_p	sp, PCB_Q_KSP(a5)
1172972Sgblack@eecs.umich.edu
1182972Sgblack@eecs.umich.edu        mtpr	zero, dtbIa	// Flush all D-stream TB entries
1192972Sgblack@eecs.umich.edu        mtpr	zero, itbIa	// Flush all I-stream TB entries
1202972Sgblack@eecs.umich.edu
1212972Sgblack@eecs.umich.edu        mtpr	a1, excAddr	// Load the dispatch address.
1222972Sgblack@eecs.umich.edu
1232972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
1242972Sgblack@eecs.umich.edu        STALL			// don't dual issue the load with mtpr -pb
1252972Sgblack@eecs.umich.edu        mtpr	zero, dtbIa	// Flush all D-stream TB entries
1262972Sgblack@eecs.umich.edu        mtpr	zero, itbIa	// Flush all I-stream TB entries
1272972Sgblack@eecs.umich.edu        br	zero, 2f
1282972Sgblack@eecs.umich.edu
1292972Sgblack@eecs.umich.edu        ALIGN_BLOCK
1302972Sgblack@eecs.umich.edu
1312972Sgblack@eecs.umich.edu2:	NOP
1322238SN/A        mtpr	zero, icFlush	// Flush the icache.
1332238SN/A        NOP
1342238SN/A        NOP
1352512SN/A
1362972Sgblack@eecs.umich.edu        NOP			// Required NOPs ... 1-10
1372972Sgblack@eecs.umich.edu        NOP
1382972Sgblack@eecs.umich.edu        NOP
1392972Sgblack@eecs.umich.edu        NOP
1402972Sgblack@eecs.umich.edu        NOP
1412972Sgblack@eecs.umich.edu        NOP
1422972Sgblack@eecs.umich.edu        NOP
1432972Sgblack@eecs.umich.edu        NOP
1442972Sgblack@eecs.umich.edu        NOP
1452972Sgblack@eecs.umich.edu        NOP
1462972Sgblack@eecs.umich.edu
1472972Sgblack@eecs.umich.edu        NOP			// Required NOPs ... 11-20
1482972Sgblack@eecs.umich.edu        NOP
1492972Sgblack@eecs.umich.edu        NOP
1502972Sgblack@eecs.umich.edu        NOP
1512972Sgblack@eecs.umich.edu        NOP
1522972Sgblack@eecs.umich.edu        NOP
1532972Sgblack@eecs.umich.edu        NOP
1542972Sgblack@eecs.umich.edu        NOP
1552972Sgblack@eecs.umich.edu        NOP
1562972Sgblack@eecs.umich.edu        NOP
1572972Sgblack@eecs.umich.edu
1582972Sgblack@eecs.umich.edu        NOP			// Required NOPs ... 21-30
1592972Sgblack@eecs.umich.edu        NOP
1602972Sgblack@eecs.umich.edu        NOP
1612972Sgblack@eecs.umich.edu        NOP
1622972Sgblack@eecs.umich.edu        NOP
1632972Sgblack@eecs.umich.edu        NOP
1642972Sgblack@eecs.umich.edu        NOP
1652972Sgblack@eecs.umich.edu        NOP
1662972Sgblack@eecs.umich.edu        NOP
1672972Sgblack@eecs.umich.edu        NOP
1682972Sgblack@eecs.umich.edu
1692972Sgblack@eecs.umich.edu        NOP			// Required NOPs ... 31-40
1702972Sgblack@eecs.umich.edu        NOP
1712972Sgblack@eecs.umich.edu        NOP
1722972Sgblack@eecs.umich.edu        NOP
1732972Sgblack@eecs.umich.edu        NOP
1742972Sgblack@eecs.umich.edu        NOP
1752972Sgblack@eecs.umich.edu        NOP
1762972Sgblack@eecs.umich.edu        NOP
1772972Sgblack@eecs.umich.edu        NOP
1782972Sgblack@eecs.umich.edu        NOP
1792972Sgblack@eecs.umich.edu
1802972Sgblack@eecs.umich.edu        NOP			// Required NOPs ... 41-44
1812972Sgblack@eecs.umich.edu        NOP
1822972Sgblack@eecs.umich.edu        NOP
1832972Sgblack@eecs.umich.edu        NOP
1842972Sgblack@eecs.umich.edu
1852972Sgblack@eecs.umich.edu        hw_rei_stall		// Dispatch to kernel
1862972Sgblack@eecs.umich.edu
1872972Sgblack@eecs.umich.edu