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