octeon_corereg.h revision 1.4 1 /* $NetBSD: octeon_corereg.h,v 1.4 2020/07/26 07:46:21 simonb Exp $ */
2
3 /*
4 * Copyright (c) 2007 Internet Initiative Japan, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29 #ifndef _OCTEON_COREREG_H_
30 #define _OCTEON_COREREG_H_
31
32 /* ---- register bits */
33
34 /*
35 * Cavium Networks-Specific Coprocessor 0 Registers
36 */
37
38 /* CacheErr (Icache) */
39
40 #define CP0_CACHEERRI_XXX_63_55 UINT64_C(0xff80000000000000)
41 #define CP0_CACHEERRI_BADCOLF UINT64_C(0x007f000000000000)
42 #define CP0_CACHEERRI_XXX_47 UINT64_C(0x0000800000000000)
43 #define CP0_CACHEERRI_BADCOL UINT64_C(0x00007f0000000000)
44 #define CP0_CACHEERRI_XXX_39_37 UINT64_C(0x000000e000000000)
45 #define CP0_CACHEERRI_LRUFAIL UINT64_C(0x0000001000000000)
46 #define CP0_CACHEERRI_AESFAIL UINT64_C(0x0000000800000000)
47 #define CP0_CACHEERRI_HSHFAIL UINT64_C(0x0000000400000000)
48 #define CP0_CACHEERRI_BHTBROKE UINT64_C(0x0000000200000000)
49 #define CP0_CACHEERRI_ICBROKE UINT64_C(0x0000000100000000)
50 #define CP0_CACHEERRI_XXX_31_15 UINT64_C(0x00000000ffff8000)
51 #define CP0_CACHEERRI_QW UINT64_C(0x0000000000006000)
52 #define CP0_CACHEERRI_ROW UINT64_C(0x0000000000001800)
53 #define CP0_CACHEERRI_SET UINT64_C(0x00000000000007e0)
54 #define CP0_CACHEERRI_WAY UINT64_C(0x0000000000000018)
55 #define CP0_CACHEERRI_XXX_2_1 UINT64_C(0x0000000000000006)
56 #define CP0_CACHEERRI_DPERR UINT64_C(0x0000000000000001)
57
58 /* CacheErr (Dcache) */
59
60 #define CP0_CACHEERRD_XXX_63_13 UINT64_C(0xffffffffffffe000)
61 #define CP0_CACHEERRD_SET UINT64_C(0x0000000000001f80)
62 #define CP0_CACHEERRD_VA63 UINT64_C(0x0000000000000078)
63 #define CP0_CACHEERRD_XXX_2_1 UINT64_C(0x0000000000000006)
64 #define CP0_CACHEERRD_PERR UINT64_C(0x0000000000000001)
65
66 /* TagLo Register (Icache) */
67
68 #define CP0_TAGLOI_R UINT64_C(0xc000000000000000)
69 #define CP0_TAGLOI_XXX_61_60 UINT64_C(0x3000000000000000)
70 #define CP0_TAGLOI_ASID UINT64_C(0x0f00000000000000)
71 #define CP0_TAGLOI_XXX_51_49 UINT64_C(0x00f0000000000000)
72 #define CP0_TAGLOI_TAG UINT64_C(0x000fffffffffe000)
73 #define CP0_TAGLOI_INDEX UINT64_C(0x0000000000001f80)
74 #define CP0_TAGLOI_XXX_6_2 UINT64_C(0x000000000000007c)
75 #define CP0_TAGLOI_G UINT64_C(0x0000000000000002)
76 #define CP0_TAGLOI_VALID UINT64_C(0x0000000000000001)
77
78 /* TagLo Register (Dcache) */
79
80 #define CP0_TAGLOD_R UINT64_C(0xc000000000000000)
81 #define CP0_TAGLOD_XXX_61_60 UINT64_C(0x3000000000000000)
82 #define CP0_TAGLOD_ASID UINT64_C(0x0f00000000000000)
83 #define CP0_TAGLOD_XXX_51_49 UINT64_C(0x00f0000000000000)
84 #define CP0_TAGLOD_TAG UINT64_C(0x000fffffffffff80)
85 #define CP0_TAGLOD_XXX_6_2 UINT64_C(0x000000000000007c)
86 #define CP0_TAGLOD_G UINT64_C(0x0000000000000002)
87 #define CP0_TAGLOD_VALID UINT64_C(0x0000000000000001)
88
89 /* CvmCtl Register */
90
91 #define CP0_CVMCTL_XXX_63_32 UINT64_C(0xffffffff00000000)
92 #define CP0_CVMCTL_FUSE_STARTBIT UINT64_C(0x0000000080000000)
93 #define CP0_CVMCTL_XXX_30 UINT64_C(0x0000000040000000)
94 #define CP0_CVMCTL_KASUMI UINT64_C(0x0000000020000000)
95 #define CP0_CVMCTL_NODFA_CP21 UINT64_C(0x0000000010000000)
96 #define CP0_CVMCTL_NOMUL UINT64_C(0x0000000008000000)
97 #define CP0_CVMCTL_NOCRYPTO UINT64_C(0x0000000004000000)
98 #define CP0_CVMCTL_RST_SHT UINT64_C(0x0000000002000000)
99 #define CP0_CVMCTL_BIST_DIS UINT64_C(0x0000000001000000)
100 #define CP0_CVMCTL_DISSETPRED UINT64_C(0x0000000000800000)
101 #define CP0_CVMCTL_DISJRPRED UINT64_C(0x0000000000400000)
102 #define CP0_CVMCTL_DISICACHE UINT64_C(0x0000000000200000)
103 #define CP0_CVMCTL_DISWAIT UINT64_C(0x0000000000100000)
104 #define CP0_CVMCTL_DEFET UINT64_C(0x0000000000080000)
105 #define CP0_CVMCTL_DISCO UINT64_C(0x0000000000040000)
106 #define CP0_CVMCTL_DISCE UINT64_C(0x0000000000020000)
107 #define CP0_CVMCTL_DDCLK UINT64_C(0x0000000000010000)
108 #define CP0_CVMCTL_DCICLK UINT64_C(0x0000000000008000)
109 #define CP0_CVMCTL_REPUN UINT64_C(0x0000000000004000)
110 #define CP0_CVMCTL_IPREF UINT64_C(0x0000000000002000)
111 #define CP0_CVMCTL_USEUN UINT64_C(0x0000000000001000)
112 #define CP0_CVMCTL_DISIOCACHE UINT64_C(0x0000000000000800)
113 #define CP0_CVMCTL_IRAND UINT64_C(0x0000000000000400)
114 #define CP0_CVMCTL_IPPCI UINT64_C(0x0000000000000380)
115 #define CP0_CVMCTL_IPTI UINT64_C(0x0000000000000070)
116 #define CP0_CVMCTL_XXX_3_2 UINT64_C(0x000000000000000c)
117 #define CP0_CVMCTL_LE UINT64_C(0x0000000000000002)
118 #define CP0_CVMCTL_USELY UINT64_C(0x0000000000000001)
119
120 /* CvmMemCtl Register */
121
122 #define CP0_CVMMEMCTL_TLBBIST UINT64_C(0x8000000000000000)
123 #define CP0_CVMMEMCTL_L1CBIST UINT64_C(0x4000000000000000)
124 #define CP0_CVMMEMCTL_L1DBIST UINT64_C(0x2000000000000000)
125 #define CP0_CVMMEMCTL_DCMBIST UINT64_C(0x1000000000000000)
126 #define CP0_CVMMEMCTL_PTGBIST UINT64_C(0x0800000000000000)
127 #define CP0_CVMMEMCTL_WBFBIST UINT64_C(0x0400000000000000)
128 #define CP0_CVMMEMCTL_XXX_57_36 UINT64_C(0x03fffff000000000)
129 #define CP0_CVMMEMCTL_DISMARKWBLONGTO UINT64_C(0x0000000800000000)
130 #define CP0_CVMMEMCTL_DISMRGCLRWBTO UINT64_C(0x0000000400000000)
131 #define CP0_CVMMEMCTL_IOBDMASCRMSB UINT64_C(0x0000000300000000)
132 #define CP0_CVMMEMCTL_SYNCWSMARKED UINT64_C(0x0000000080000000)
133 #define CP0_CVMMEMCTL_DISSYNCWS UINT64_C(0x0000000040000000)
134 #define CP0_CVMMEMCTL_DISWBFST UINT64_C(0x0000000020000000)
135 #define CP0_CVMMEMCTL_XKMEMENAS UINT64_C(0x0000000010000000)
136 #define CP0_CVMMEMCTL_XKMEMENAU UINT64_C(0x0000000008000000)
137 #define CP0_CVMMEMCTL_XKIOENAS UINT64_C(0x0000000004000000)
138 #define CP0_CVMMEMCTL_XKIOENAU UINT64_C(0x0000000002000000)
139 #define CP0_CVMMEMCTL_ALLSYNCW UINT64_C(0x0000000001000000)
140 #define CP0_CVMMEMCTL_NOMERGE UINT64_C(0x0000000000800000)
141 #define CP0_CVMMEMCTL_DIDTTO UINT64_C(0x0000000000600000)
142 #define CP0_CVMMEMCTL_CSRCLKALWYS UINT64_C(0x0000000000100000)
143 #define CP0_CVMMEMCTL_MCLKALWYS UINT64_C(0x0000000000080000)
144 #define CP0_CVMMEMCTL_WBFLTIME UINT64_C(0x0000000000070000)
145 #define CP0_CVMMEMCTL_ISTRNOL2 UINT64_C(0x0000000000008000)
146 #define CP0_CVMMEMCTL_WBTHRESH UINT64_C(0x0000000000007800)
147 #define CP0_CVMMEMCTL_XXX_10_9 UINT64_C(0x0000000000000600)
148 #define CP0_CVMMEMCTL_CVMSEGENAK UINT64_C(0x0000000000000100)
149 #define CP0_CVMMEMCTL_CVMSEGENAS UINT64_C(0x0000000000000080)
150 #define CP0_CVMMEMCTL_CVMSEGENAU UINT64_C(0x0000000000000040)
151 #define CP0_CVMMEMCTL_LMEMSZ UINT64_C(0x000000000000003f)
152
153 /* CvmCount Register */
154
155 /* Multi-Core Debug Register */
156
157 #define CP0_MCD_XXX_63_17 UINT64_C(0xfffffffffffe0000)
158 #define CP0_MCD_DEXCC UINT64_C(0x0000000000010000)
159 #define CP0_MCD_CGSTP UINT64_C(0x0000000000008000)
160 #define CP0_MCD_CVGSTP UINT64_C(0x0000000000004000)
161 #define CP0_MCD_CVDM UINT64_C(0x0000000000002000)
162 #define CP0_MCD_GSDB UINT64_C(0x0000000000001000)
163 #define CP0_MCD_XXX_11 UINT64_C(0x0000000000000800)
164 #define CP0_MCD_MSKM2 UINT64_C(0x0000000000000400)
165 #define CP0_MCD_MSKM1 UINT64_C(0x0000000000000200)
166 #define CP0_MCD_MMC0 UINT64_C(0x0000000000000100)
167 #define CP0_MCD_XXX_7 UINT64_C(0x0000000000000080)
168 #define CP0_MCD_PLS2 UINT64_C(0x0000000000000040)
169 #define CP0_MCD_PLS1 UINT64_C(0x0000000000000020)
170 #define CP0_MCD_PLS0 UINT64_C(0x0000000000000010)
171 #define CP0_MCD_XXX_3 UINT64_C(0x0000000000000008)
172 #define CP0_MCD_MCD2 UINT64_C(0x0000000000000004)
173 #define CP0_MCD_MCD1 UINT64_C(0x0000000000000002)
174 #define CP0_MCD_MCD0 UINT64_C(0x0000000000000001)
175
176 /* ---- operations */
177
178 /*
179 * OCTEON Configuration and Status Registers (CSRs)
180 */
181
182 #define CSR_COP0 /* Core coprosessor 0 registers */
183 #define CSR_COP2 /* Core coprosessor 2 registers */
184 #define CSR_COREEJTAG /* Core EJTAG registers */
185 #define CSR_COREEJTAGTAP /* Core EJTAG TAP registers */
186 #define CSR_NCB /* NCB registers */
187 #define CSR_RSL /* RSL registers */
188 #define CSR_PCICONFIG /* PCICONFIG registers */
189 #define CSR_PCI /* PCI registers */
190 #define CSR_PCINCB /* PCI_NCB registers */
191 #define CSR_JTAGTAP /* JTAG TAP registers */
192 #define CSR_TWSICORE /* TWSI Core registers */
193
194 /* XXX */
195
196 #endif /* _OCTEON_COREREG_H_ */
197