1 1.8 simonb /* $NetBSD: r3900regs.h,v 1.8 2020/07/26 08:08:41 simonb Exp $ */ 2 1.1 uch 3 1.4 uch /*- 4 1.4 uch * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. 5 1.1 uch * All rights reserved. 6 1.1 uch * 7 1.4 uch * This code is derived from software contributed to The NetBSD Foundation 8 1.4 uch * by UCHIYAMA Yasushi. 9 1.4 uch * 10 1.1 uch * Redistribution and use in source and binary forms, with or without 11 1.1 uch * modification, are permitted provided that the following conditions 12 1.1 uch * are met: 13 1.1 uch * 1. Redistributions of source code must retain the above copyright 14 1.1 uch * notice, this list of conditions and the following disclaimer. 15 1.4 uch * 2. Redistributions in binary form must reproduce the above copyright 16 1.4 uch * notice, this list of conditions and the following disclaimer in the 17 1.4 uch * documentation and/or other materials provided with the distribution. 18 1.1 uch * 19 1.4 uch * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.4 uch * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.4 uch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.4 uch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.4 uch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.4 uch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.4 uch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.4 uch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.4 uch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.4 uch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.4 uch * POSSIBILITY OF SUCH DAMAGE. 30 1.1 uch */ 31 1.4 uch 32 1.1 uch /* 33 1.1 uch * [address space] 34 1.1 uch * kseg2 0xc0000000 - 0xfeffffff 35 1.1 uch * reserved 0xff000000 - 0xfffeffff 36 1.1 uch * kseg2 0xffff0000 - 0xffffffff 37 1.1 uch * -> vmparam.h VM_MAX_KERNEL_ADDRESS 38 1.1 uch */ 39 1.1 uch 40 1.1 uch /* 41 1.1 uch * [cause register] 42 1.1 uch */ 43 1.1 uch #define R3900_CR_EXC_CODE MIPS3_CR_EXC_CODE /* five bits */ 44 1.1 uch #undef MIPS1_CR_EXC_CODE 45 1.8 simonb #define MIPS1_CR_EXC_CODE R3900_CR_EXC_CODE 46 1.1 uch 47 1.1 uch /* 48 1.1 uch * [status register] 49 1.1 uch * R3900 don't have PE, CM, PZ, SwC and IsC. 50 1.1 uch */ 51 1.8 simonb #define R3900_SR_NMI 0x00100000 /* r3k PE position */ 52 1.5 uch #if 0 53 1.1 uch #undef MIPS1_PARITY_ERR 54 1.1 uch #undef MIPS1_CACHE_MISS 55 1.1 uch #undef MIPS1_PARITY_ZERO 56 1.1 uch #undef MIPS1_SWAP_CACHES 57 1.1 uch #undef MIPS1_ISOL_CACHES 58 1.5 uch #endif 59 1.1 uch 60 1.1 uch /* 61 1.1 uch * [context register] 62 1.1 uch * - no changes. 63 1.1 uch */ 64 1.1 uch 65 1.1 uch 66 1.1 uch /* 67 1.1 uch * TX3900 Coprocessor 0 registers 68 1.1 uch */ 69 1.1 uch #define R3900_COP_0_CONFIG $3 70 1.1 uch #define R3900_COP_0_DEBUG $16 71 1.1 uch #define R3900_COP_0_DEPC $17 72 1.1 uch 73 1.8 simonb #define R3920_COP_0_PAGEMASK $5 74 1.8 simonb #define R3920_COP_0_WIRED $6 75 1.1 uch #define R3920_COP_0_CACHE $7 76 1.8 simonb #define R3920_COP_0_TAG_LO $20 77 1.1 uch 78 1.1 uch /* 79 1.1 uch * TLB entry 80 1.1 uch * 3912 ... TLB entry is 64bits wide and R3000A compatible 81 1.1 uch * 3922 ... TLB entry is 96bits wide 82 1.1 uch */ 83 1.1 uch 84 1.1 uch /* 85 1.1 uch * Config register (R3900 specific) 86 1.1 uch */ 87 1.8 simonb #define R3900_CONFIG_ICS_SHIFT 19 88 1.8 simonb #define R3900_CONFIG_ICS_MASK 0x00380000 89 1.8 simonb #define R3900_CONFIG_ICS_1KB 0x00000000 90 1.8 simonb #define R3900_CONFIG_ICS_2KB 0x00080000 91 1.8 simonb #define R3900_CONFIG_ICS_4KB 0x00100000 92 1.8 simonb #define R3900_CONFIG_ICS_8KB 0x00180000 93 1.8 simonb #define R3900_CONFIG_ICS_16KB 0x00200000 94 1.8 simonb 95 1.8 simonb #define R3900_CONFIG_DCS_SHIFT 16 96 1.8 simonb #define R3900_CONFIG_DCS_1KB 0x00000000 97 1.8 simonb #define R3900_CONFIG_DCS_2KB 0x00010000 98 1.8 simonb #define R3900_CONFIG_DCS_4KB 0x00020000 99 1.8 simonb #define R3900_CONFIG_DCS_8KB 0x00030000 100 1.8 simonb #define R3900_CONFIG_DCS_16KB 0x00040000 101 1.8 simonb 102 1.8 simonb #define R3900_CONFIG_DCS_MASK 0x00070000 103 1.8 simonb #define R3900_CONFIG_CWFON 0x00004000 104 1.8 simonb #define R3900_CONFIG_WBON 0x00002000 105 1.8 simonb #define R3900_CONFIG_RF_SHIFT 10 106 1.8 simonb #define R3900_CONFIG_RF_MASK 0x00000c00 107 1.8 simonb #define R3900_CONFIG_DOZE 0x00000200 108 1.8 simonb #define R3900_CONFIG_HALT 0x00000100 109 1.8 simonb #define R3900_CONFIG_LOCK 0x00000080 110 1.8 simonb #define R3900_CONFIG_ICE 0x00000020 111 1.8 simonb #define R3900_CONFIG_DCE 0x00000010 112 1.8 simonb #define R3900_CONFIG_IRSIZE_SHIFT 2 113 1.8 simonb #define R3900_CONFIG_IRSIZE_MASK 0x0000000c 114 1.8 simonb #define R3900_CONFIG_DRSIZE_SHIFT 0 115 1.8 simonb #define R3900_CONFIG_DRSIZE_MASK 0x00000003 116 1.1 uch 117 1.1 uch /* 118 1.4 uch * CACHE 119 1.1 uch */ 120 1.4 uch /* Cache size (limit) */ 121 1.4 uch /* R3900/R3920 */ 122 1.8 simonb #define R3900_C_SIZE_MIN 1024 123 1.8 simonb #define R3900_C_SIZE_MAX 8192 124 1.4 uch /* Cache line size */ 125 1.4 uch /* R3900 */ 126 1.8 simonb #define R3900_C_LSIZE_I 16 127 1.8 simonb #define R3900_C_LSIZE_D 4 128 1.4 uch /* R3920 */ 129 1.8 simonb #define R3920_C_LSIZE_I 16 130 1.8 simonb #define R3920_C_LSIZE_D 16 131 1.4 uch /* Cache operation */ 132 1.4 uch /* R3900 */ 133 1.8 simonb #define R3900_C_IINV_I 0x00 134 1.8 simonb #define R3900_C_IWBINV_D 0x01 135 1.8 simonb #define R3900_C_ILRUC_I 0x04 136 1.8 simonb #define R3900_C_ILRUC_D 0x05 137 1.8 simonb #define R3900_C_ILCKC_D 0x09 /* R3900 only */ 138 1.8 simonb #define R3900_C_HINV_D 0x11 139 1.4 uch /* R3920 */ 140 1.8 simonb #define R3920_C_IINV_I 0x00 141 1.8 simonb #define R3920_C_IWBINV_D 0x01 142 1.8 simonb #define R3920_C_ILRUC_I 0x04 143 1.8 simonb #define R3920_C_ILRUC_D 0x05 144 1.8 simonb #define R3920_C_ILDTAG_I 0x0c /* R3920 only */ 145 1.8 simonb #define R3920_C_ILDTAG_D 0x0d /* R3920 only */ 146 1.8 simonb #define R3920_C_HINV_I 0x10 /* R3920 only */ 147 1.8 simonb #define R3920_C_HINV_D 0x11 148 1.8 simonb #define R3920_C_HWBINV_D 0x14 /* R3920 only */ 149 1.8 simonb #define R3920_C_HWB_D 0x18 /* R3920 only */ 150 1.8 simonb #define R3920_C_ISTTAG_I 0x1c /* R3920 only */ 151 1.8 simonb #define R3920_C_ISTTAG_D 0x1d /* R3920 only */ 152