1 /*
2  * cps.h
3  *
4  *  Created on: May 1, 2012
5  *      Author: MIPS TECHNOLOGIES, INC
6 */
7 /*
8 Unpublished work (c) MIPS Technologies, Inc.  All rights reserved.  Unpublished rights reserved
9 under the copyright laws of the United States of America and other countries.
10 
11 This code is confidential and proprietary to MIPS Technologies, Inc. ("MIPS Technologies") and
12 may be disclosed only as permitted in writing by MIPS Technologies or an authorized third party.
13 Any copying, reproducing, modifying, use or disclosure of this code (in whole or in part) that is
14 not expressly permitted in writing by MIPS Technologies or an authorized third party is strictly
15 prohibited. At a minimum, this code is protected under trade secret, unfair competition, and
16 copyright laws. Violations thereof may result in criminal penalties and fines.
17 
18 MIPS Technologies reserves the right to change this code to improve function, design or
19 otherwise. MIPS Technologies does not assume any liability arising out of the application or use
20 of this code, or of any error or omission in such code.  Any warranties, whether express, statutory,
21 implied or otherwise, including but not limited to the implied warranties of merchantability or
22 fitness for a particular purpose, are excluded.  Except as expressly provided in any written license
23 agreement from MIPS Technologies or an authorized third party, the furnishing of this code does
24 not give recipient any license to any intellectual property rights, including any patent rights, that
25 cover this code.
26 
27 This code shall not be exported, reexported, transferred, or released, directly or indirectly, in
28 violation of the law of any country or international law, regulation, treaty, Executive Order,
29 statute, amendments or supplements thereto.  Should a conflict arise regarding the export,
30 reexport, transfer, or release of this code, the laws of the United States of America shall be
31 the governing law.
32 
33 This code may only be disclosed to the United States government ("Government"), or to
34 Government users, with prior written consent from MIPS Technologies or an authorized third
35 party.  This code constitutes one or more of the following: commercial computer software,
36 commercial computer software documentation or other commercial items.  If the user of this
37 code, or any related documentation of any kind, including related technical data or manuals, is an
38 agency, department, or other entity of the Government, the use, duplication, reproduction, release,
39 modification, disclosure, or transfer of this code, or any related documentation of any kind, is
40 restricted in accordance with Federal Acquisition Regulation 12.212 for civilian agencies and
41 Defense Federal Acquisition Regulation Supplement 227.7202 for military agencies.  The use of
42 this code by the Government is further restricted in accordance with the terms of the license
43 agreement(s) and/or applicable contract terms and conditions covering this code from MIPS
44 Technologies or an authorized third party.
45 */
46 
47 /*
48  * This include file contains #defines for the memory mapped registers in a coherent Processing system
49  * of both single cores and multi threaded cores. It contains registers offset for all the registers,
50  * defines for the fields with in the registers and encodings for some of the fields.
51  *
52  * The fields in the registers are defined by a pair of #defines, one define is the starting bit position of
53  * the field and another, (with a "_S" appended to the name), is the size of the field. Here is an example of
54  * how you would use these #defines in the the extraction of a filed:
55  *
56  *   li      $5, GIC_BASE_ADDR			         # load GIC KSEG0 Address
57  *   lw      $4, GIC_SH_CONFIG($5)               # Read the GIC_SH_CONFIG Register
58  *   ext     $4, NUMINTERRUPTS, NUMINTERRUPTS_S  # Extract NUMINTERRUPTS
59  *
60  *   The names for the registers and fields are usually the same as used in the Software Users Manual
61  *   (SUM). The exceptions occur when the names would conflict with each other in that case the name
62  *   is appended with something to make it unique.
63  */
64 
65 #ifndef CPS_H_
66 #define CPS_H_
67 
68 // GCR Offset for GCR_CONFIG, field positions and field size
69 #define GCR_CONFIG 0x0000
70 #define NUM_ADDR_REGIONS 16
71 #define NUM_ADDR_REGIONS_S 4
72 #define NUMIOCU 8
73 #define NUMIOCU_S 4
74 #define PCORES 0
75 #define PCORES_S 8
76 
77 // GCR Offset for GCR_BASE, field positions and field size
78 #define GCR_BASE 0x0008
79 #define GCR_BASE_ADDR 15
80 #define GCR_BASE_ADDR_S 17
81 #define CCA_DEFAULT_OVERRIDE_VALUE 5
82 #define CCA_DEFAULT_OVERRIDE_VALUE_S 3
83 #define CCA_DEFAULT_OVERRIDE_ENABLE 4
84 #define CCA_DEFAULT_OVERRIDE_ENABLE_S 1
85 #define CM_DEFAULT_TARGET 0
86 #define CM_DEFAULT_TARGET_S 2
87 
88 // GCR Offset for GCR_CONTROL, field positions and field size
89 #define GCR_CONTROL 0x0010
90 #define SYNCCTL 16
91 #define SYNCCTL_S 1
92 #define CM_SYNC_TX_DISABLE 5
93 #define CM_SYNC_TX_DISABLE_S 1
94 #define CM_AUTO_CLR_IVU_EN 4
95 #define CM_AUTO_CLR_IVU_EN_S 1
96 #define CM_COHST_SH_ALWAYS_EN 3
97 #define CM_COHST_SH_ALWAYS_EN_S 1
98 #define CM_PARK_EN 2
99 #define CM_PARK_EN_S 1
100 #define CM_DISABLE_MMIO_LIMIT 1
101 #define CM_DISABLE_MMIO_LIMIT_S 1
102 #define CM_SPEC_READ_EN 0
103 #define CM_SPEC_READ_EN_S 1
104 
105 // GCR Offset for GCR_CONTROL_2, field positions and field size
106 #define GCR_CONTROL2 0x0018
107 #define L2_CACHEOP_LIMIT 16
108 #define L2_CACHEOP_LIMIT_S 4
109 #define L1_CACHEOP_LIMIT 3
110 #define L1_CACHEOP_LIMIT_S 4
111 
112 // GCR Offset for GCR_ACCESS, field positions and field size
113 #define GCR_ACCESS 0x0020
114 #define CM_ACCESS_EN 0
115 #define CM_ACCESS_EN_S 8
116 
117 // GCR Offset for GCR_REV, field positions and field size
118 #define GCR_REV 0x0030
119 #define MAJOR_REV_GCR 8
120 #define MAJOR_REV_GCR_S 8
121 #define MINOR_REV_GCR 7
122 #define MINOR_REV_GCR_S 8
123 
124 // GCR Offset for GCR_ERROR_MASK
125 #define GCR_ERROR_MASK 0x0040
126 
127 // error type encoding
128 #define GC_WR_ERR 1
129 #define GC_RD_ERR 2
130 #define COH_WR_ERR 3
131 #define COH_RD_ERR 4
132 #define MMIO_WR_ERR 5
133 #define MMIO_RD_ERR 6
134 #define INTVN_WR_ERR 17
135 #define INTVN_RD_ERR 18
136 
137 // GCR Offset for GCR_ERROR_CAUSE, field positions and field size
138 #define GCR_ERROR_CAUSE 0x0048
139 #define CM_ERROR_TYPE 27
140 #define CM_ERROR_TYPE_S 5
141 #define CM_ERROR_INFO 0
142 #define CM_ERROR_INFO_S 27
143 
144 // Fields and sizes for Error Types 1 - 5
145 #define CCA 15
146 #define CCA_S 3
147 #define TARGET_REGION 12
148 #define TARGET_REGION_S 3
149 #define OCP_MCMD_ERROR 7
150 #define OCP MCMD_ERROR_S 5
151 #define SOURCE_TAGID 3
152 #define SOURCE_TAGID_S 4
153 #define SOURCE_PORT 0
154 #define SOURCE_PORT_S 3
155 
156 // Fields for Error Types 16 - 17
157 #define COHERENT_STATE_CORE_3 19
158 #define COHERENT_STATE_CORE_3_S 2
159 #define INTERVENTION_SRESP_CORE3 18
160 #define INTERVENTION_SRESP_CORE3_S 1
161 
162 #define COHERENT_STATE_CORE_2 16
163 #define COHERENT_STATE_CORE_2_S 2
164 #define INTERVENTION_SRESP_CORE2 15
165 #define INTERVENTION_SRESP_CORE2_S 1
166 
167 #define COHERENT_STATE_CORE_1 13
168 #define COHERENT_STATE_CORE_1_S 2
169 #define INTERVENTION_SRESP_CORE1 12
170 #define INTERVENTION_SRESP_CORE1_S 1
171 
172 #define COHERENT_STATE_CORE_0 10
173 #define COHERENT_STATE_CORE_0_S 2
174 #define INTERVENTION_SRESP_CORE0 9
175 #define INTERVENTION_SRESP_CORE0_S 1
176 
177 #define FROM_STORE_CONDITIONAL 8
178 #define FROM_STORE_CONDITIONAL_S 1
179 #define OCP_MCMD 3
180 #define OCP_MCMD_S 5
181 #define SOURCE_PORT 0
182 #define SOURCE_PORT_S 3
183 
184 // Coherent state encoding
185 #define CS_INVALID 0
186 #define CS_SHARED 1
187 #define CS_MODIFID 2
188 #define CS_EXCLUSIVE
189 
190 // Intervention Response encoding
191 #define IR_OK 0
192 #define IR_DATA 1
193 
194 // MCmd Encodings for CM_ERROR_INFO
195 #define LEGACY_WRITE 0x01
196 #define LEGACY_READ 0x02
197 #define COHERENT_READ_OWN 0x08
198 #define COHERENT_READ_SHARE 0x09
199 #define COHERENT_READ_DISCARD 0x0A
200 #define COHERENT_READ_SHARE_ALWAYS 0x0B
201 #define COHERENT_UPGRADE 0x0C
202 #define COHERENT_WRITEBACK 0x0D
203 #define COHERENT_COPYBACK 0x10
204 #define COHERENT_COPYBACK_INVALIADATE 0x11
205 #define COHERENT_INVALIADATE 0x12
206 #define COHERENT_WRITE_INVALIADATE 0x13
207 #define COHERENT_COMPLETION_SYNC 0x14
208 
209 // GCR Offset for GCR_ERROR_ADDR
210 #define GCR_ERROR_ADDR 0x0050
211 
212 // GCR Offset for GCR_ERROR_MULT
213 #define GCR_ERROR_MULT 0x0058
214 #define CM_ERROR_2ND 0
215 #define CM_ERROR_2ND_S 5
216 
217 // GCR Offset for GCR_GIC_BASE, fields and sizes
218 #define GCR_GIC_BASE 0x0080
219 #define GIC_BASEADDRESS 17
220 #define GIC_BASEADDRESS_S 15
221 #define GIC_EN 0
222 #define GIC_EN_S 1
223 
224 // GCR Offset for GCR_CPC_BAS, fields and sizes
225 #define GCR_CPC_BASE 0x0088
226 #define CPC_BASEADDRESS 15
227 #define CPC_BASEADDRESS_S 17
228 #define CPC_EN 0
229 #define CPC_EN_S 1
230 
231 // GCR Offset for GCR_REGn_BASE, fields and sizes
232 #define GCR_REG0_BASE 0x0090
233 #define GCR_REG1_BASE 0x00A0
234 #define GCR_REG2_BASE 0x00B0
235 #define GCR_REG3_BASE 0x00C0
236 #define GCR_REG4_BASE 0x0190
237 #define GCR_REG5_BASE 0x01A0
238 
239 #define CM_REGION_BASEADDRESS 16
240 #define CM_REGION_BASEADDRESS_S 16
241 
242 // GCR Offset for GCR_REGn_MASK, fields, sizes and encodings
243 #define GCR_REG0_MASK 0x0098
244 #define GCR_REG1_MASK 0x00A8
245 #define GCR_REG2_MASK 0x00B8
246 #define GCR_REG3_MASK 0x00C8
247 #define GCR_REG4_MASK 0x0198
248 #define GCR_REG5_MASK 0x01A8
249 #define CM_REGION_ADDRESS_MASK 16
250 #define CM_REGION_ADDRESS_MASK_S 16
251 #define CCA_OVERRIDE_VALUE 5
252 #define CCA_OVERRIDE_VALUE_S 3
253 #define CCA_OVERRIDE_ENABLE 4
254 #define CCA_OVERRIDE_ENABLE_S 1
255 #define CM_REGION_TARGET 0
256 #define CM_REGION_TARGET_S 2
257 // CM_REGION_TARGET encoding
258 #define CM_REGION_TARGET_DISABLE 0x0
259 #define CM_REGION_TARGET_MEMORY 0x1
260 #define CM_REGION_TARGET_IOCU 0x2
261 
262 // GCR Offset for GCR_GIC_STATUS, fields and sizes
263 #define GCR_GIC_STATUS 0x00D0
264 #define GIC_EX 0
265 #define GIC_EX_S 1
266 
267 // GCR Offset for GCR_CACHE_REV, fields and sizes
268 #define GCR_CACHE_REV 0x00E0
269 #define MAJOR_REV_CACHE 8
270 #define MAJOR_REV_CACHE_S 8
271 #define MINOR_REV_CACHE 7
272 #define MINOR_REV_CACHE_S 8
273 
274 // GCR Offset for GCR_CPC_STATUS, fields and sizes
275 #define GCR_CPC_STATUS 0x00F0
276 #define CPC_EX 0
277 #define CPC_EX_S 1
278 
279 // GCR Offset for GCR_IOCU1_REV, fields and sizes
280 #define GCR_IOCU1_REV 0x0200
281 #define MAJOR_REV_IOCU 8
282 #define MAJOR_REV_IOCU_S 8
283 #define MINOR_REV_IOCU 7
284 #define MINOR_REV_IOCU_S 8
285 
286 // GCR Core Local and Core other offsets
287 #define CORE_LOCAL_CONTROL_BLOCK 0x2000
288 #define CORE_OTHER_CONTROL_BLOCK 0x4000
289 
290 // GCR Core Local and Other COHERENCE, fields and sizes
291 #define GCR_CL_COHERENCE 0x0008
292 #define GCR_CO_COHERENCE 0x0008
293 #define COH_DOMAIN_EN 0
294 #define COH_DOMAIN_EN_S 8
295 
296 // GCR Core Local and Other CONFIG , fields and sizes
297 #define GCR_CL_CONFIG 0x0010
298 #define GCR_CO_CONFIG 0x0010
299 #define IOCU_TYPE 10
300 #define IOCU_TYPE_S 2
301 #define PVPE 0
302 #define PVPE_S 10
303 
304 // GCR Core Local and Other OTHER, fields and sizes
305 #define GCR_CL_OTHER 0x0018
306 #define GCR_CO_OTHER 0x0018
307 #define OTHER_CORE_NUM 16
308 #define OTHER_CORE_NUM_S 16
309 
310 // GCR Core Local and Other RESET_BASE, fields and sizes
311 #define GCR_CL_RESET_BASE 0x0020
312 #define GCR_CO_RESET_BASE 0x0020
313 #define BEV_EXCEPTION_BASE 12
314 #define BEV_EXCEPTION_BASE_S 20
315 
316 // GCR Core Local and Other ID
317 #define GCR_CL_ID 0x0028
318 #define GCR_CO_ID 0x0028
319 
320 // GCR Global Debug Block Offsets
321 #define Global_Debug_Block 0x6000
322 
323 // GCR Global Debug GCR_DB_TCBCONTROLB, fields and sizes
324 #define GCR_DB_TCBCONTROLB 0x0008
325 #define WE_DB_TCBCONTROLB 31
326 #define WE_DB_TCBCONTROLB_S 1
327 #define TWSRC_WIDTH 26
328 #define TWSRC_WIDTH_S 2
329 #define TRPAD 18
330 #define TRPAD_S 1
331 #define RM 16
332 #define RM_S 1
333 #define TR 15
334 #define TR_S 1
335 #define BF 14
336 #define BF_S 1
337 #define TM 12
338 #define TM_S 2
339 #define CR 8
340 #define CR_S 3
341 #define CAL 7
342 #define CAL_S 1
343 #define OFC 1
344 #define OFC_S 1
345 #define FUNNEL_TRACE_ENABLE 0
346 #define FUNNEL_TRACE_ENABLE_S 1
347 
348 // GCR Global Debug GCR_DB_TCBCONTROLD, fields and sizes
349 #define GCR_DB_TCBCONTROLD 0x0010
350 #define P4_CTL 24
351 #define P4_CTL_S 2
352 #define P3_CTL 22
353 #define P3_CTL_S 2
354 #define P2_CTL 20
355 #define P2_CTL_S 2
356 #define P1_CTL 18
357 #define P1_CTL_S 2
358 #define P0_CTL 16
359 #define P0_CTL_S 2
360 #define TW_SRC_VAL 8
361 #define TW_SRC_VAL_S 3
362 #define TRACE_WB 7
363 #define TRACE_WB_S 1
364 #define CM_INHIBIT_OVERFLOW 5
365 #define CM_INHIBIT_OVERFLOW_S 1
366 #define TLEV 3
367 #define TLEV_S 2
368 #define AE_PER_PORT 2
369 #define AE_PER_PORT_S 1
370 #define GLOBAL_CM_EN 1
371 #define GLOBAL_CM_EN_S 1
372 #define CM_EN 0
373 #define CM_EN_S 1
374 
375 // GCR Global Debug GCR_DB_TCBCONTROLE, fields and sizes
376 #define GCR_DB_TCBCONTROLE 0x0020
377 #define TrIdle 8
378 #define TrIdle_S 1
379 #define PeC 0
380 #define PeC_S 1
381 
382 // GCR Global Debug GCR_DB_TCBConfig, fields and sizes
383 #define GCR_DB_TCBCONFIG 0x0028
384 #define CF1 31
385 #define CF1_S 1
386 #define SZ 17
387 #define SZ_S 4
388 #define CRMAX 14
389 #define CRMAX_S 3
390 #define CRMIN 11
391 #define CRMIN_S 3
392 #define PW 9
393 #define PW_S 2
394 #define ONT 5
395 #define ONT_S 1
396 #define OFT 4
397 #define OFT_S 1
398 #define TCB_REV 0
399 #define TCB_REV_S 4
400 
401 // GCR Global Debug GCR_DB_PC_CTL, fields and sizes
402 #define GCR_DB_PC_CTL 0x0100
403 #define PERF_INT_EN 30
404 #define PERF_INT_EN_S 1
405 #define PERF_OVF_STOP 29
406 #define PERF_OVF_STOP_S 1
407 #define P1_RESET 9
408 #define P1_RESET_S 1
409 #define P1_COUNT_ON 8
410 #define P1_COUNT_ON_S 1
411 #define P0_RESET 7
412 #define P0_RESET_S 1
413 #define P0_COUNT_ON 6
414 #define P0_COUNT_ON_S 1
415 #define CYCL_CNT_RESET 5
416 #define CYCL_CNT_RESET_S 1
417 #define CYCL_CNT__ON 4
418 #define CYCL_CNT__ON_S 1
419 #define PERF_NUM_CNT 0
420 #define PERF_NUM_CNT_S 4
421 
422 // GCR Global Debug Read Pointer GCR_DB_TCBRDP
423 #define GCR_DB_TCBRDP 0x0108
424 
425 // GCR Global Debug Write Pointer GCR_DB_TCBWDP
426 #define GCR_DB_TCBWRP 0x0110
427 
428 // GCR Global Debug Start Pointer GCR_DB_TCBSTP
429 #define GCR_DB_TCBSTP 0x0118
430 
431 // GCR_DB_PC_OV, fields and sizes
432 #define GCR_DB_PC_OV 0x0120
433 #define P1_OVERFLOW 2
434 #define P1_OVERFLOW_S 1
435 #define P0_OVERFLOW 1
436 #define P0_OVERFLOW_S 1_S 1
437 #define CYCL_CNT_OVERFLOW 0
438 #define CYCL_CNT_OVERFLOW_S 1
439 
440 // GCR Global Debug GCR_DB_PC_EVENT, fields and sizes
441 #define GCR_DB_PC_EVENT 0x0130
442 #define P1_EVENT 8
443 #define P1_EVENT_S 8
444 #define P0_EVENT 0
445 #define P0_EVENT_S 8
446 
447 // GCR Global Debug GCR_DB_PC_CYCLE
448 #define GCR_DB_PC_CYCLE 0x0180
449 
450 
451 // GCR Global Debug Qualifier and count registers
452 #define GCR_DB_PC_QUAL0 0x0190
453 #define GCR_DB_PC_CNT0 0x0198
454 #define GCR_DB_PC_QUAL1 0x01a0
455 #define GCR_DB_PC_CNT1 0x01a8
456 
457 // GCR Global Debug Trace word access registers
458 #define GCR_DB_TCBTW_LO 0x0200
459 #define GCR_DB_TCBTW_HI 0x0208
460 
461 // GIC Offsets within the Global interrupt controller
462 
463 #define GIC_SH_CONFIG 0x0000
464 #define COUNTSTOP 28
465 #define COUNTSTOP_S 1
466 #define COUNTBITS 24
467 #define COUNTBITS_S 4
468 #define NUMINTERRUPTS 16
469 #define NUMINTERRUPTS_S 8
470 #define PVPES 0
471 #define PVPES_S 9
472 
473 #define GIC_SH_CounterLo 0x0010
474 #define GIC_SH_CounterHi 0x0014
475 
476 #define GIC_RevisionID 0x0020
477 
478 #define GIC_SH_POL31_0 0x0100
479 #define GIC_SH_POL63_32 0x0104
480 #define GIC_SH_POL95_64 0x0108
481 #define GIC_SH_POL127_96 0x010c
482 #define GIC_SH_POL159_128 0x0110
483 #define GIC_SH_POL191_160 0x0114
484 #define GIC_SH_POL223_192 0x0118
485 #define GIC_SH_POL255_224 0x011c
486 
487 #define GIC_SH_TRIG31_0 0x0180
488 #define GIC_SH_TRIG63_32 0x0184
489 #define GIC_SH_TRIG95_64 0x0188
490 #define GIC_SH_TRIG127_96 0x018c
491 #define GIC_SH_TRIG159_128 0x0190
492 #define GIC_SH_TRIG191_160 0x0194
493 #define GIC_SH_TRIG223_192 0x0198
494 #define GIC_SH_TRIG255_224 0x019c
495 
496 #define GIC_SH_DUAL31_0 0x0200
497 #define GIC_SH_DUAL63_32 0x0204
498 #define GIC_SH_DUAL95_64 0x0208
499 #define GIC_SH_DUAL127_96 0x020c
500 #define GIC_SH_DUAL159_128 0x0210
501 #define GIC_SH_DUAL159_128 0x0210
502 #define GIC_SH_DUAL191_160 0x0214
503 #define GIC_SH_DUAL223_192 0x0218
504 #define GIC_SH_DUAL255_224 0x021c
505 
506 #define GIC_SH_WEDGE 0x0280
507 
508 #define GIC_SH_RMASK31_0 0x0300
509 #define GIC_SH_RMASK63_32 0x0304
510 #define GIC_SH_RMASK95_64 0x0308
511 #define GIC_SH_RMASK127_96 0x030c
512 #define GIC_SH_RMASK159_128 0x0310
513 #define GIC_SH_RMASK191_160 0x0314
514 #define GIC_SH_RMASK223_192 0x0318
515 #define GIC_SH_RMASK255_224 0x031c
516 
517 #define GIC_SH_SMASK31_00 0x0380
518 #define GIC_SH_SMASK63_32 0x0384
519 #define GIC_SH_SMASK95_64 0x0388
520 #define GIC_SH_SMASK127_96 0x038c
521 #define GIC_SH_SMASK159_128 0x0390
522 #define GIC_SH_SMASK191_160 0x0394
523 #define GIC_SH_SMASK223_192 0x0398
524 #define GIC_SH_SMASK255_224 0x039c
525 
526 #define GIC_SH_MASK31_00 0x0400
527 #define GIC_SH_MASK63_32 0x0404
528 #define GIC_SH_MASK95_64 0x0408
529 #define GIC_SH_MASK127_96 0x040c
530 #define GIC_SH_MASK159_128 0x0410
531 #define GIC_SH_MASK191_160 0x0414
532 #define GIC_SH_MASK223_192 0x0418
533 #define GIC_SH_MASK255_224 0x041c
534 
535 #define GIC_SH_PEND31_00 0x0480
536 #define GIC_SH_PEND63_32 0x0484
537 #define GIC_SH_PEND95_64 0x0488
538 #define GIC_SH_PEND127_96 0x048c
539 #define GIC_SH_PEND159_128 0x0490
540 #define GIC_SH_PEND191_160 0x0494
541 #define GIC_SH_PEND223_192 0x0498
542 #define GIC_SH_PEND255_224 0x049c
543 
544 // Global MAP to Pin GIC_SH_MAP_PIN + (4 x interrupt_source)
545 #define GIC_SH_MAP_PIN 0x0500
546 
547 #define GIC_SH_MAP_SPACER 0x20
548 // Map source to VPEs 31 - 0 GIC_SH_MAP0_VPE31_0 + (0x20 x interrupt source)
549 #define GIC_SH_MAP0_VPE31_0 0x2000
550 // Map source to VPEs 63 - 32 GIC_SH_MAP0_VPE63_32 + (0x20 x interrupt source)
551 #define GIC_SH_MAP0_VPE63_32  0x2004
552 
553 // Map source to core 31 - 0 GIC_SH_MAP0_CORE31_0 + (0x20 x interrupt source)
554 #define GIC_SH_MAP0_CORE31_0 0x2000
555 // Map source to core 63 - 32 GIC_SH_MAP0_CORE63_32 + (0x20 x interrupt source)
556 #define GIC_SH_MAP0_CORE63_32 0x2004
557 
558 #define GIC_VB_DINT_SEND 0x6000
559 
560 // GIC VPE Local offsets (note the VPEL)
561 #define GIC_VPE_LOCAL_SECTION_OFFSET 0x8000
562 
563 #define GIC_VPEL_CTL 0x0000
564 #define GIC_VPEL_PEND 0x0004
565 #define GIC_VPEL_MASK 0x0008
566 #define GIC_VPEL_RMASK 0x000c
567 #define GIC_VPEL_SMASK 0x0010
568 #define GIC_VPEL_WD_MAP 0x0040
569 #define GIC_VPEL_COMPARE_MAP 0x0044
570 #define GIC_VPEL_TIMER_MAP (0x0048 )
571 #define GIC_VPEL_FDC_MAP 0x004c
572 #define GIC_VPEL_PERFCTR_MAP 0x0050
573 #define GIC_VPEL_SWInt0_MAP 0x0054
574 #define GIC_VPEL_SWInt1_MAP 0x0058
575 #define GIC_VPEL_OTHER_ADDR 0x0080
576 #define GIC_VPEL_IDENT 0x0088
577 #define GIC_VPEL_WD_CONFIG0 0x0090
578 #define GIC_VPEL_WD_COUNT0 0x0094
579 #define GIC_VPEL_WD_INITIAL0 0x0098
580 #define GIC_VPEL_CompareLo 0x00A0
581 #define GIC_VPEL_CompareHi 0x00A4
582 
583 // NOTE: EIC Shadow set GIC_VPEL_EICSS + (4 x interrupt number)
584 #define GIC_VPEL_EICSS 0x0100
585 #define GIC_VL_DINT_PART 0x3000
586 #define GIC_VL_BRK_GROUP 0x3080
587 
588 // GIC VPE Other offsets (note the VPEO)
589 #define GIC_VPE_OTHER_SECTION_OFFSET 0xc000
590 
591 #define GIC_VPEO_CTL 0x0000
592 #define GIC_VPEO_PEND 0x0004
593 #define GIC_VPEO_MASK 0x0008
594 #define GIC_VPEO_RMASK 0x000c
595 #define GIC_VPEO_SMASK 0x0010
596 #define GIC_VPEO_WD_MAP 0x0040
597 #define GIC_VPEO_COMPARE_MAP 0x0044
598 #define GIC_VPEO_TIMER_MAP 0x0048
599 #define GIC_VPEO_FDC_MAP 0x004c
600 #define GIC_VPEO_PERFCTR_MAP 0x0050
601 #define GIC_VPEO_SWInt0_MAP 0x0054
602 #define GIC_VPEO_SWInt1_MAP 0x0058
603 #define GIC_VPEO_OTHER_ADDR 0x0080
604 #define GIC_VPEO_IDENT 0x0088
605 #define GIC_VPEO_WD_CONFIG0 0x0090
606 #define GIC_VPEO_WD_COUNT0 0x0094
607 #define GIC_VPEO_WD_INITIAL0 0x0098
608 #define GIC_VPEO_CompareLo 0x00A0
609 #define GIC_VPEO_CompareHi 0x00A4
610 
611 // NOTE: EIC Shadow set GIC_VPEO_EICSS + (4 x interrupt number)
612 #define GIC_VPEO_EICSS 0x0100
613 #define GIC_VO_DINT_PART 0x3000
614 #define GIC_VO_BRK_GROUP 0x3080
615 
616 // GIC CORE Local offsets (note the COREL)
617 #define GIC_CORE_LOCAL_SECTION_OFFSET 0x8000
618 
619 #define GIC_COREL_CTL 0x0000
620 #define GIC_COREL_PEND 0x0004
621 #define GIC_COREL_MASK 0x0008
622 #define GIC_COREL_RMASK 0x000c
623 #define GIC_COREL_SMASK 0x0010
624 #define GIC_COREL_WD_MAP 0x0040
625 #define GIC_COREL_COMPARE_MAP 0x0044
626 #define GIC_COREL_TIMER_MAP 0x0048
627 #define GIC_COREL_FDC_MAP 0x004c
628 #define GIC_COREL_PERFCTR_MAP 0x0050
629 #define GIC_COREL_SWInt0_MAP 0x0054
630 #define GIC_COREL_SWInt1_MAP 0x0058
631 #define GIC_COREL_OTHER_ADDR 0x0080
632 #define GIC_COREL_IDENT 0x0088
633 #define GIC_COREL_WD_CONFIG0 0x0090
634 #define GIC_COREL_WD_COUNT0 0x0094
635 #define GIC_COREL_WD_INITIAL0 0x0098
636 #define GIC_COREL_CompareLo 0x00A0
637 #define GIC_COREL_CompareHi 0x00A4
638 // NOTE: EIC Shadow set GIC_COREL_EICSS + (4 x interrupt number)
639 #define GIC_COREL_EICSS 0x0100
640 #define GIC_COREL_DINT_PART 0x3000
641 #define GIC_COREL_BRK_GROUP 0x3080
642 
643 // GIC CORE Other offsets (note the COREO)
644 #define GIC_CORE_OTHER_SECTION_OFFSET 0xc000
645 #define GIC_COREO_CTL 0x0000
646 #define GIC_COREO_PEND 0x0004
647 #define GIC_COREO_MASK 0x0008
648 #define GIC_COREO_RMASK 0x000c
649 #define GIC_COREO_SMASK 0x0010
650 #define GIC_COREO_WD_MAP 0x0040
651 #define GIC_COREO_COMPARE_MAP 0x0044
652 #define GIC_COREO_TIMER_MAP 0x0048
653 #define GIC_COREO_FDC_MAP 0x004c
654 #define GIC_COREO_PERFCTR_MAP 0x0050
655 #define GIC_COREO_SWInt0_MAP 0x0054
656 #define GIC_COREO_SWInt1_MAP 0x0058
657 #define GIC_COREO_OTHER_ADDR 0x0080
658 #define GIC_COREO_IDENT 0x0088
659 #define GIC_COREO_WD_CONFIG0 0x0090
660 #define GIC_COREO_WD_COUNT0 0x0094
661 #define GIC_COREO_WD_INITIAL0 0x0098
662 #define GIC_COREO_CompareLo 0x00A0
663 #define GIC_COREO_CompareHi 0x00A4
664 // NOTE: EIC Shadow set GIC_COREO_EICSS + (4 x interrupt number)
665 #define GIC_COREO_EICSS 0x0100
666 #define GIC_COREO_DINT_PART 0x3000
667 #define GIC_COREO_BRK_GROUP 0x3080
668 
669 
670 // Bit fields for Local Interrupt Control Register (GIC_COREi_CTL) or for MT (GIC_VPEi_CTL) or
671 #define FDC_ROUTABLE 4
672 #define FDC_ROUTABLE_S 1
673 #define SWINT_ROUTABLE 3
674 #define SWINT_ROUTABLE_S 1
675 #define PERFCOUNT_ROUTABLE 2
676 #define PERFCOUNT_ROUTABLE_S 1
677 #define TIMER_ROUTABLE 1
678 #define TIMER_ROUTABLE_S 1
679 #define EIC_MODE 0
680 #define EIC_MODE_S 1
681 
682 // Bit  fields for Local Interrupt Pending Registers (GIC_COREi_PEND) or for MT (GIC_VPEi_PEND)
683 #define FDC_PEND 6
684 #define FDC_PEND_S 1
685 #define SWINT1_PEND 5
686 #define SWINT1_PEND_S 1
687 #define SWINT0_PEND 4
688 #define SWINT0_PEND_S 1
689 #define PERFCOUNT_PEND 3
690 #define PERFCOUNT_PEND_S 1
691 #define TIMER_PEND 2
692 #define TIMER_PEND_S 1
693 #define COMPARE_PEND 1
694 #define COMPARE_PEND_S 1
695 #define WD_PEND 0
696 #define WD_PEND_S 1
697 
698 // Bit fields for Local Interrupt Mask Registers (GIC_COREi_MASK) or for MT (GIC_VPEi_MASK)
699 #define FDC_MASK 6
700 #define FDC_MASK_S 1
701 #define SWINT1_MASK 5
702 #define SWINT1_MASK_S 1
703 #define SWINT0_MASK 4
704 #define SWINT0_MASK_S 1
705 #define PERFCOUNT_MASK 3
706 #define PERFCOUNT_MASK_S 1
707 #define TIMER_MASK 2
708 #define TIMER_MASK_S 1
709 #define COMPARE_MASK 1
710 #define COMPARE_MASK_S 1
711 #define WD_MASK 0
712 #define WD_MASK_S 1
713 
714 // Bit fields for Local Interrupt Reset Mask Registers (GIC_COREi_RMASK) or for MT (GIC_VPEi_RMASK)
715 #define FDC_MASK_RESET 6
716 #define FDC_MASK_RESET_S 1
717 #define SWINT1_MASK_RESET 5
718 #define SWINT1_MASK_RESET_S 1
719 #define SWINT0_MASK_RESET 4
720 #define SWINT0_MASK_RESET_S 1
721 #define PERFCOUNT_MASK_RESET 3
722 #define PERFCOUNT_MASK_RESET_S 1
723 #define TIMER_MASK_RESET 2
724 #define TIMER_MASK_RESET_S 1
725 #define COMPARE_MASK_RESET 1
726 #define COMPARE_MASK_RESET_S 1
727 #define WD_MASK_RESET 0
728 #define WD_MASK_RESET_S 1
729 
730 // Bit fields for Local Interrupt Set Mask Registers (GIC_COREi_SMASK) or for MT (GIC_VPEi_SMASK)
731 #define FDC_MASK_SET 6
732 #define FDC_MASK_SET_S 1
733 #define SWINT1_MASK_SET 5
734 #define SWINT1_MASK_SET_S 1
735 #define SWINT0_MASK_SET 4
736 #define SWINT0_MASK_SET_S 1
737 #define PERFCOUNT_MASK_SET 3
738 #define PERFCOUNT_MASK_SET_S 1
739 #define TIMER_MASK_SET 2
740 #define TIMER_MASK_SET_S 1
741 #define COMPARE_MASK_SET 1
742 #define COMPARE_MASK_SET_S 1
743 #define WD_MASK_SET 0
744 #define WD_MASK_SET_S 1
745 
746 // Bit fields for CORE-Other or for MT VPE-Other Addressing Register
747 #define VPENum 0
748 #define VPENum_S 16
749 #define CORENum 0
750 #define CORENum_S 16
751 
752 // Bit fields for Core-Local Identification Register (GIC_COREi_IDENT) or for MT (GIC_VPEi_IDENT)
753 #define VPENumIDENT 0
754 #define VPENumIDENT_S 32
755 #define CORENumIDENT 0
756 #define CORENumIDENT_S 32
757 
758 // Bit fields for Local EIC Shadow Set Registers (GIC_COREi_EICSSj) or for MT (GIC_VPEi_EICSSj)
759 #define EIC_SS 0
760 #define EIC_SS_S 4
761 
762 // Bit fields for Local WatchDog/Compare/PerfCount/SWIntx Map to Pin Registers
763 #define MAP_TO_PIN 31
764 #define MAP_TO_PIN_S 1
765 #define MAP_TO_NMI 30
766 #define MAP_TO_NMI_S 1
767 #define MAP_TO_YQ 29
768 #define MAP_TO_YQ_S 1
769 #define MAP 0
770 #define MAP_S 6
771 
772 // Bit fields for Watchdog Timer Config Register (GIC_COREi_WD_CONFIGk) or for MT (GIC_VPEi_WD_CONFIGk)
773 #define WDRESET 7
774 #define WDRESET_S 1
775 #define WDINTR 6
776 #define WDINTR_S 1
777 #define WAITMODE_CNTRL 5
778 #define WAITMODE_CNTRL_S 1
779 #define DEBUGMODE_CNTRL 5
780 #define DEBUGMODE_CNTRL_S 1
781 #define TYPE 1
782 #define TYPE_S 3
783 // TYPE Filed encoding:
784 #define WD_One_Trip_Mode 0
785 #define WD_Second_Countdown_Mode 1
786 #define PIT_Mode 2
787 
788 // Bit fields for Local DINT Group Participate Register (GIC_Cx_DINT_PART) or for MT (GIC_Vx_DINT_PART)
789 #define DINT_Group_Particpate 0
790 #define DINT_Group_Particpate_S 1
791 
792 // GIC, GIC User Mode Visible Section Offsets
793 #define USER_MODE_VISIBLE_SECTION_OFFSET 0x10000
794 #define GIC_SH_COUNTERLO 0x0000
795 #define GIC_SH_COUNTERHI 0x0004
796 
797 // Cluster Power Controller Global Section
798 // CPC Block CPC_ACCESS_REG, fields and sizes
799 #define CPC_ACCESS_REG 0x000
800 #define CM_ACCESS_EN 0
801 #define CM_ACCESS_EN_S 8
802 
803 // CPC Block CPC_SEQDEL_REG, fields and sizes
804 #define CPC_SEQDEL_REG 0x008
805 #define MICROSTEP 0
806 #define MICROSTEP_S 10
807 
808 // CPC Block CPC_RAIL_REG, fields and sizes
809 #define CPC_RAIL_REG 0x010
810 #define RAILDELAY 0
811 #define RAILDELAY_S 10
812 
813 // CPC Block CPC_RESETLEN_REG, fields and sizes
814 #define CPC_RESETLEN_REG 0x018
815 #define RESETLEN 0
816 #define RESETLEN_S 10
817 
818 // CPC Block CPC_REVISION_REG, fields and sizes
819 #define CPC_REVISION_REG 0x020
820 #define MAJOR_REV_CPC 8
821 #define MAJOR_REV_CPC_S 8
822 #define MINOR_REV_CPC 0
823 #define MINOR_REV_CPC_S 8
824 
825 // Cluster Power Controller Local and Other section
826 #define CPS_CORE_LOCAL_CONTROL_BLOCK 0x2000
827 #define CPS_CORE_OTHER_CONTROL_BLOCK 0x4000
828 
829 // CPC Local and Other CPC_CMD_REG, command encoding
830 #define CPC_CMDL_REG 0x000
831 #define CPC_CMDO_REG 0x000
832 #define CLOCK_OFF 1
833 #define PWR_DOWN 2
834 #define PWR_UP 3
835 #define CPC_RESET 4
836 
837 // CPC Local and Other CPC_STAT_CONF, fields, sizes and encodings
838 #define CPC_STATL_CONF_REG 0x008
839 #define CPC_STATO_CONF_REG 0x008
840 #define PWRUP_EVENT 23
841 #define PWRUP_EVENT_S 1
842 #define SEQ_STATE 19
843 #define SEQ_STATE_S 4
844 
845 // sequencer state encodings
846 #define PWR_DOWN_STATE 0x0
847 #define VDD_OK_STATE 0x1
848 #define UP_DELAY_STATE 0x2
849 #define UCLK_OFF_STATE 0x3
850 #define CPC_RESET_STATE 0x4
851 #define CPC_RESET_DLY_STATE 0x5
852 #define NON_COHERENT_EXECUTION_STATE 0x6
853 #define COHERENT_EXECUTION_STATE 0x7
854 #define ISOLATE_STATE 0x8
855 #define CLR_BUS_STATE 0x8
856 #define DCLK_OFF_STATE 0xA
857 
858 #define CLKGAT_IMPL 17
859 #define CLKGAT_IMPL_S 1
860 #define PWRDN_IMPL 16
861 #define PWRDN_IMPL_S 1
862 #define EJTAG_PROBE 15
863 #define EJTAG_PROBE_S 1
864 #define PWUP_POLICY 8
865 #define PWUP_POLICY_S 2
866 // Power up state encodings
867 #define POLICY_PWR_DOWN 0
868 #define POLICY_GO_CLOCK_OFF 1
869 #define PLOICY_PWR_UP 2
870 
871 #define IO_TRFFC_EN 4
872 #define IO_TRFFC_EN_S 1
873 #define CPC_CMD_STATE 0
874 #define CPC_CMD_STATE_S 4
875 
876 // CPC Local and Other Addressing Register CPC_OTHER_REG, field and size
877 #define CPC_OTHERL_REG 0x010
878 #define CPC_OTHERO_REG 0x010
879 #define CPC_CORENUM 16
880 #define CPC_CORENUM_S 8
881 
882 
883 #endif /* CPS_H_ */
884