Home | History | Annotate | Line # | Download | only in include
r3900regs.h revision 1.1
      1  1.1  uch /*	$NetBSD: r3900regs.h,v 1.1 1999/11/29 11:13:11 uch Exp $ */
      2  1.1  uch 
      3  1.1  uch /*
      4  1.1  uch  * Copyright (c) 1999, by UCHIYAMA Yasushi
      5  1.1  uch  * All rights reserved.
      6  1.1  uch  *
      7  1.1  uch  * Redistribution and use in source and binary forms, with or without
      8  1.1  uch  * modification, are permitted provided that the following conditions
      9  1.1  uch  * are met:
     10  1.1  uch  * 1. Redistributions of source code must retain the above copyright
     11  1.1  uch  *    notice, this list of conditions and the following disclaimer.
     12  1.1  uch  * 2. The name of the developer may NOT be used to endorse or promote products
     13  1.1  uch  *    derived from this software without specific prior written permission.
     14  1.1  uch  *
     15  1.1  uch  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     16  1.1  uch  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     17  1.1  uch  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     18  1.1  uch  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     19  1.1  uch  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     20  1.1  uch  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     21  1.1  uch  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     22  1.1  uch  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     23  1.1  uch  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     24  1.1  uch  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     25  1.1  uch  * SUCH DAMAGE.
     26  1.1  uch  *
     27  1.1  uch  */
     28  1.1  uch /*
     29  1.1  uch  *	[address space]
     30  1.1  uch  *	kseg2		0xc0000000 - 0xfeffffff
     31  1.1  uch  *	reserved	0xff000000 - 0xfffeffff
     32  1.1  uch  *	kseg2		0xffff0000 - 0xffffffff
     33  1.1  uch  * -> vmparam.h VM_MAX_KERNEL_ADDRESS
     34  1.1  uch  */
     35  1.1  uch 
     36  1.1  uch /*
     37  1.1  uch  *	[cause register]
     38  1.1  uch  */
     39  1.1  uch #define	R3900_CR_EXC_CODE	MIPS3_CR_EXC_CODE /* five bits */
     40  1.1  uch #undef MIPS1_CR_EXC_CODE
     41  1.1  uch #define MIPS1_CR_EXC_CODE	R3900_CR_EXC_CODE
     42  1.1  uch 
     43  1.1  uch /*
     44  1.1  uch  *	[status register]
     45  1.1  uch  *	R3900 don't have PE, CM, PZ, SwC and IsC.
     46  1.1  uch  */
     47  1.1  uch #define R3900_SR_NMI		0x00100000 /* r3k PE position */
     48  1.1  uch #undef MIPS1_PARITY_ERR
     49  1.1  uch #undef MIPS1_CACHE_MISS
     50  1.1  uch #undef MIPS1_PARITY_ZERO
     51  1.1  uch #undef MIPS1_SWAP_CACHES
     52  1.1  uch #undef MIPS1_ISOL_CACHES
     53  1.1  uch 
     54  1.1  uch /*
     55  1.1  uch  *	[context register]
     56  1.1  uch  * - no changes.
     57  1.1  uch  */
     58  1.1  uch 
     59  1.1  uch 
     60  1.1  uch /*
     61  1.1  uch  *	TX3900 Coprocessor 0 registers
     62  1.1  uch  */
     63  1.1  uch #define	R3900_COP_0_CONFIG	$3
     64  1.1  uch #define	R3900_COP_0_DEBUG	$16
     65  1.1  uch #define	R3900_COP_0_DEPC	$17
     66  1.1  uch 
     67  1.1  uch #define R3920_COP_0_PAGEMASK	$5
     68  1.1  uch #define R3920_COP_0_WIRED	$6
     69  1.1  uch #define	R3920_COP_0_CACHE	$7
     70  1.1  uch #define R3920_COP_0_TAG_LO	$20
     71  1.1  uch 
     72  1.1  uch /*
     73  1.1  uch  *	TLB entry
     74  1.1  uch  *	3912 ... TLB entry is 64bits wide and R3000A compatible
     75  1.1  uch  *	3922 ... TLB entry is 96bits wide
     76  1.1  uch  */
     77  1.1  uch 
     78  1.1  uch /*
     79  1.1  uch  *	Index register
     80  1.1  uch  *	3912 ... index field[8:12] (32 entry)
     81  1.1  uch  */
     82  1.1  uch #define R3900_TLB_NUM_TLB_ENTRIES	32
     83  1.1  uch #define R3920_TLB_NUM_TLB_ENTRIES	64
     84  1.1  uch #undef MIPS1_TLB_NUM_TLB_ENTRIES
     85  1.1  uch #ifdef TX391X
     86  1.1  uch #define MIPS1_TLB_NUM_TLB_ENTRIES	R3900_TLB_NUM_TLB_ENTRIES
     87  1.1  uch #elif defined TX392X
     88  1.1  uch #define MIPS1_TLB_NUM_TLB_ENTRIES	R3920_TLB_NUM_TLB_ENTRIES
     89  1.1  uch #endif
     90  1.1  uch 
     91  1.1  uch /*
     92  1.1  uch  *	Config register (R3900 specific)
     93  1.1  uch  */
     94  1.1  uch #define R3900_CONFIG_ICS_SHIFT		19
     95  1.1  uch #define R3900_CONFIG_ICS_MASK		0x00380000
     96  1.1  uch #define R3900_CONFIG_ICS_1KB		0x00000000
     97  1.1  uch #define R3900_CONFIG_ICS_2KB		0x00080000
     98  1.1  uch #define R3900_CONFIG_ICS_4KB		0x00100000
     99  1.1  uch #define R3900_CONFIG_ICS_8KB		0x00180000
    100  1.1  uch #define R3900_CONFIG_ICS_16KB		0x00200000
    101  1.1  uch 
    102  1.1  uch #define R3900_CONFIG_DCS_SHIFT		16
    103  1.1  uch #define R3900_CONFIG_DCS_1KB		0x00000000
    104  1.1  uch #define R3900_CONFIG_DCS_2KB		0x00010000
    105  1.1  uch #define R3900_CONFIG_DCS_4KB		0x00020000
    106  1.1  uch #define R3900_CONFIG_DCS_8KB		0x00030000
    107  1.1  uch #define R3900_CONFIG_DCS_16KB		0x00040000
    108  1.1  uch 
    109  1.1  uch 
    110  1.1  uch #define R3900_CONFIG_DCS_MASK		0x00070000
    111  1.1  uch #define R3900_CONFIG_CWFON		0x00004000
    112  1.1  uch #define R3900_CONFIG_WBON		0x00002000
    113  1.1  uch #define R3900_CONFIG_RF_SHIFT		10
    114  1.1  uch #define R3900_CONFIG_RF_MASK		0x00000c00
    115  1.1  uch #define R3900_CONFIG_DOZE		0x00000200
    116  1.1  uch #define R3900_CONFIG_HALT		0x00000100
    117  1.1  uch #define R3900_CONFIG_LOCK		0x00000080
    118  1.1  uch #define R3900_CONFIG_ICE		0x00000020
    119  1.1  uch #define R3900_CONFIG_DCE		0x00000010
    120  1.1  uch #define R3900_CONFIG_IRSIZE_SHIFT	2
    121  1.1  uch #define R3900_CONFIG_IRSIZE_MASK	0x0000000c
    122  1.1  uch #define R3900_CONFIG_DRSIZE_SHIFT	0
    123  1.1  uch #define R3900_CONFIG_DRSIZE_MASK	0x00000003
    124  1.1  uch 
    125  1.1  uch /*
    126  1.1  uch  *	R3900 CACHE instruction (not MIPS3 cache op)
    127  1.1  uch  */
    128  1.1  uch #define R3900_MIN_CACHE_SIZE		1024
    129  1.1  uch #define R3900_MAX_DCACHE_SIZE		(8 * 1024)
    130  1.1  uch #ifndef OP_CACHE
    131  1.1  uch #define OP_CACHE	057
    132  1.1  uch #endif
    133  1.1  uch #define R3900_CACHE(op, offset, base) \
    134  1.1  uch 	.word (OP_CACHE << 26 | ((base) << 21) | ((op) << 16) | \
    135  1.1  uch 	((offset) & 0xffff))
    136  1.1  uch #define R3900_CACHE_I_INDEXINVALIDATE	0
    137  1.1  uch #define R3900_CACHE_D_HITINVALIDATE	0x11
    138  1.1  uch 
    139  1.1  uch #define	CPUREG_A0	4
    140  1.1  uch #define CPUREG_T0	8
    141  1.1  uch 
    142  1.1  uch 
    143