hw_cpu_tpiu.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * 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  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef __HW_CPU_TPIU_H__
34 #define __HW_CPU_TPIU_H__
35 
36 //*****************************************************************************
37 //
38 // This section defines the register offsets of
39 // CPU_TPIU component
40 //
41 //*****************************************************************************
42 // Supported Sync Port Sizes
43 #define CPU_TPIU_O_SSPSR 0x00000000
44 
45 // Current Sync Port Size
46 #define CPU_TPIU_O_CSPSR 0x00000004
47 
48 // Async Clock Prescaler
49 #define CPU_TPIU_O_ACPR 0x00000010
50 
51 // Selected Pin Protocol
52 #define CPU_TPIU_O_SPPR 0x000000F0
53 
54 // Formatter and Flush Status
55 #define CPU_TPIU_O_FFSR 0x00000300
56 
57 // Formatter and Flush Control
58 #define CPU_TPIU_O_FFCR 0x00000304
59 
60 // Formatter Synchronization Counter
61 #define CPU_TPIU_O_FSCR 0x00000308
62 
63 // Claim Tag Mask
64 #define CPU_TPIU_O_CLAIMMASK 0x00000FA0
65 
66 // Claim Tag Set
67 #define CPU_TPIU_O_CLAIMSET 0x00000FA0
68 
69 // Current Claim Tag
70 #define CPU_TPIU_O_CLAIMTAG 0x00000FA4
71 
72 // Claim Tag Clear
73 #define CPU_TPIU_O_CLAIMCLR 0x00000FA4
74 
75 // Lock Access Register
76 #define CPU_TPIU_O_LAR 0x00000FB0
77 
78 // Device ID
79 #define CPU_TPIU_O_DEVID 0x00000FC8
80 
81 //*****************************************************************************
82 //
83 // Register: CPU_TPIU_O_SSPSR
84 //
85 //*****************************************************************************
86 // Field: [3] FOUR
87 //
88 // 4-bit port size support
89 //
90 // 0x0: Not supported
91 // 0x1: Supported
92 #define CPU_TPIU_SSPSR_FOUR 0x00000008
93 #define CPU_TPIU_SSPSR_FOUR_BITN 3
94 #define CPU_TPIU_SSPSR_FOUR_M 0x00000008
95 #define CPU_TPIU_SSPSR_FOUR_S 3
96 
97 // Field: [2] THREE
98 //
99 // 3-bit port size support
100 //
101 // 0x0: Not supported
102 // 0x1: Supported
103 #define CPU_TPIU_SSPSR_THREE 0x00000004
104 #define CPU_TPIU_SSPSR_THREE_BITN 2
105 #define CPU_TPIU_SSPSR_THREE_M 0x00000004
106 #define CPU_TPIU_SSPSR_THREE_S 2
107 
108 // Field: [1] TWO
109 //
110 // 2-bit port size support
111 //
112 // 0x0: Not supported
113 // 0x1: Supported
114 #define CPU_TPIU_SSPSR_TWO 0x00000002
115 #define CPU_TPIU_SSPSR_TWO_BITN 1
116 #define CPU_TPIU_SSPSR_TWO_M 0x00000002
117 #define CPU_TPIU_SSPSR_TWO_S 1
118 
119 // Field: [0] ONE
120 //
121 // 1-bit port size support
122 //
123 // 0x0: Not supported
124 // 0x1: Supported
125 #define CPU_TPIU_SSPSR_ONE 0x00000001
126 #define CPU_TPIU_SSPSR_ONE_BITN 0
127 #define CPU_TPIU_SSPSR_ONE_M 0x00000001
128 #define CPU_TPIU_SSPSR_ONE_S 0
129 
130 //*****************************************************************************
131 //
132 // Register: CPU_TPIU_O_CSPSR
133 //
134 //*****************************************************************************
135 // Field: [3] FOUR
136 //
137 // 4-bit port enable
138 // Writing values with more than one bit set in CSPSR, or setting a bit that is
139 // not indicated as supported in SSPSR can cause Unpredictable behavior.
140 #define CPU_TPIU_CSPSR_FOUR 0x00000008
141 #define CPU_TPIU_CSPSR_FOUR_BITN 3
142 #define CPU_TPIU_CSPSR_FOUR_M 0x00000008
143 #define CPU_TPIU_CSPSR_FOUR_S 3
144 
145 // Field: [2] THREE
146 //
147 // 3-bit port enable
148 // Writing values with more than one bit set in CSPSR, or setting a bit that is
149 // not indicated as supported in SSPSR can cause Unpredictable behavior.
150 #define CPU_TPIU_CSPSR_THREE 0x00000004
151 #define CPU_TPIU_CSPSR_THREE_BITN 2
152 #define CPU_TPIU_CSPSR_THREE_M 0x00000004
153 #define CPU_TPIU_CSPSR_THREE_S 2
154 
155 // Field: [1] TWO
156 //
157 // 2-bit port enable
158 // Writing values with more than one bit set in CSPSR, or setting a bit that is
159 // not indicated as supported in SSPSR can cause Unpredictable behavior.
160 #define CPU_TPIU_CSPSR_TWO 0x00000002
161 #define CPU_TPIU_CSPSR_TWO_BITN 1
162 #define CPU_TPIU_CSPSR_TWO_M 0x00000002
163 #define CPU_TPIU_CSPSR_TWO_S 1
164 
165 // Field: [0] ONE
166 //
167 // 1-bit port enable
168 // Writing values with more than one bit set in CSPSR, or setting a bit that is
169 // not indicated as supported in SSPSR can cause Unpredictable behavior.
170 #define CPU_TPIU_CSPSR_ONE 0x00000001
171 #define CPU_TPIU_CSPSR_ONE_BITN 0
172 #define CPU_TPIU_CSPSR_ONE_M 0x00000001
173 #define CPU_TPIU_CSPSR_ONE_S 0
174 
175 //*****************************************************************************
176 //
177 // Register: CPU_TPIU_O_ACPR
178 //
179 //*****************************************************************************
180 // Field: [12:0] PRESCALER
181 //
182 // Divisor for input trace clock is (PRESCALER + 1).
183 #define CPU_TPIU_ACPR_PRESCALER_W 13
184 #define CPU_TPIU_ACPR_PRESCALER_M 0x00001FFF
185 #define CPU_TPIU_ACPR_PRESCALER_S 0
186 
187 //*****************************************************************************
188 //
189 // Register: CPU_TPIU_O_SPPR
190 //
191 //*****************************************************************************
192 // Field: [1:0] PROTOCOL
193 //
194 // Trace output protocol
195 // ENUMs:
196 // SWO_NRZ SerialWire Output (NRZ)
197 // SWO_MANCHESTER SerialWire Output (Manchester). This is the reset
198 // value.
199 // TRACEPORT TracePort mode
200 #define CPU_TPIU_SPPR_PROTOCOL_W 2
201 #define CPU_TPIU_SPPR_PROTOCOL_M 0x00000003
202 #define CPU_TPIU_SPPR_PROTOCOL_S 0
203 #define CPU_TPIU_SPPR_PROTOCOL_SWO_NRZ 0x00000002
204 #define CPU_TPIU_SPPR_PROTOCOL_SWO_MANCHESTER 0x00000001
205 #define CPU_TPIU_SPPR_PROTOCOL_TRACEPORT 0x00000000
206 
207 //*****************************************************************************
208 //
209 // Register: CPU_TPIU_O_FFSR
210 //
211 //*****************************************************************************
212 // Field: [3] FTNONSTOP
213 //
214 // 0: Formatter can be stopped
215 // 1: Formatter cannot be stopped
216 #define CPU_TPIU_FFSR_FTNONSTOP 0x00000008
217 #define CPU_TPIU_FFSR_FTNONSTOP_BITN 3
218 #define CPU_TPIU_FFSR_FTNONSTOP_M 0x00000008
219 #define CPU_TPIU_FFSR_FTNONSTOP_S 3
220 
221 //*****************************************************************************
222 //
223 // Register: CPU_TPIU_O_FFCR
224 //
225 //*****************************************************************************
226 // Field: [8] TRIGIN
227 //
228 // Indicates that triggers are inserted when a trigger pin is asserted.
229 #define CPU_TPIU_FFCR_TRIGIN 0x00000100
230 #define CPU_TPIU_FFCR_TRIGIN_BITN 8
231 #define CPU_TPIU_FFCR_TRIGIN_M 0x00000100
232 #define CPU_TPIU_FFCR_TRIGIN_S 8
233 
234 // Field: [1] ENFCONT
235 //
236 // Enable continuous formatting:
237 //
238 // 0: Continuous formatting disabled
239 // 1: Continuous formatting enabled
240 #define CPU_TPIU_FFCR_ENFCONT 0x00000002
241 #define CPU_TPIU_FFCR_ENFCONT_BITN 1
242 #define CPU_TPIU_FFCR_ENFCONT_M 0x00000002
243 #define CPU_TPIU_FFCR_ENFCONT_S 1
244 
245 //*****************************************************************************
246 //
247 // Register: CPU_TPIU_O_FSCR
248 //
249 //*****************************************************************************
250 // Field: [31:0] FSCR
251 //
252 // The global synchronization trigger is generated by the Program Counter (PC)
253 // Sampler block. This means that there is no synchronization counter in the
254 // TPIU.
255 #define CPU_TPIU_FSCR_FSCR_W 32
256 #define CPU_TPIU_FSCR_FSCR_M 0xFFFFFFFF
257 #define CPU_TPIU_FSCR_FSCR_S 0
258 
259 //*****************************************************************************
260 //
261 // Register: CPU_TPIU_O_CLAIMMASK
262 //
263 //*****************************************************************************
264 // Field: [31:0] CLAIMMASK
265 //
266 // This register forms one half of the Claim Tag value. When reading this
267 // register returns the number of bits that can be set (each bit is considered
268 // separately):
269 //
270 // 0: This claim tag bit is not implemented
271 // 1: This claim tag bit is not implemented
272 //
273 // The behavior when writing to this register is described in CLAIMSET.
274 #define CPU_TPIU_CLAIMMASK_CLAIMMASK_W 32
275 #define CPU_TPIU_CLAIMMASK_CLAIMMASK_M 0xFFFFFFFF
276 #define CPU_TPIU_CLAIMMASK_CLAIMMASK_S 0
277 
278 //*****************************************************************************
279 //
280 // Register: CPU_TPIU_O_CLAIMSET
281 //
282 //*****************************************************************************
283 // Field: [31:0] CLAIMSET
284 //
285 // This register forms one half of the Claim Tag value. Writing to this
286 // location allows individual bits to be set (each bit is considered
287 // separately):
288 //
289 // 0: No effect
290 // 1: Set this bit in the claim tag
291 //
292 // The behavior when reading from this location is described in CLAIMMASK.
293 #define CPU_TPIU_CLAIMSET_CLAIMSET_W 32
294 #define CPU_TPIU_CLAIMSET_CLAIMSET_M 0xFFFFFFFF
295 #define CPU_TPIU_CLAIMSET_CLAIMSET_S 0
296 
297 //*****************************************************************************
298 //
299 // Register: CPU_TPIU_O_CLAIMTAG
300 //
301 //*****************************************************************************
302 // Field: [31:0] CLAIMTAG
303 //
304 // This register forms one half of the Claim Tag value. Reading this register
305 // returns the current Claim Tag value.
306 // Reading CLAIMMASK determines how many bits from this register must be used.
307 //
308 // The behavior when writing to this register is described in CLAIMCLR.
309 #define CPU_TPIU_CLAIMTAG_CLAIMTAG_W 32
310 #define CPU_TPIU_CLAIMTAG_CLAIMTAG_M 0xFFFFFFFF
311 #define CPU_TPIU_CLAIMTAG_CLAIMTAG_S 0
312 
313 //*****************************************************************************
314 //
315 // Register: CPU_TPIU_O_CLAIMCLR
316 //
317 //*****************************************************************************
318 // Field: [31:0] CLAIMCLR
319 //
320 // This register forms one half of the Claim Tag value. Writing to this
321 // location enables individual bits to be cleared (each bit is considered
322 // separately):
323 //
324 // 0: No effect
325 // 1: Clear this bit in the claim tag.
326 //
327 // The behavior when reading from this location is described in CLAIMTAG.
328 #define CPU_TPIU_CLAIMCLR_CLAIMCLR_W 32
329 #define CPU_TPIU_CLAIMCLR_CLAIMCLR_M 0xFFFFFFFF
330 #define CPU_TPIU_CLAIMCLR_CLAIMCLR_S 0
331 
332 //*****************************************************************************
333 //
334 // Register: CPU_TPIU_O_DEVID
335 //
336 //*****************************************************************************
337 // The definition of this register's fields can be found here:
338 // https://developer.arm.com/docs/100165/0201/trace-port-interface-unit/tpiu-programmers-model/tpiu_devid
339 // Field: [11] NRZ_SWO
340 //
341 // This bit Reads-As-One (RAO), indicating that the output is supported.
342 #define CPU_TPIU_DEVID_NRZ_SWO 0x00000400
343 #define CPU_TPIU_DEVID_NRZ_SWO_BITN 11
344 #define CPU_TPIU_DEVID_NRZ_SWO_M 0x00000400
345 #define CPU_TPIU_DEVID_NRZ_SWO_S 11
346 
347 // Field: [10] MANCHESTER_SWO
348 //
349 // This bit Reads-As-One (RAO), indicating that the output is supported.
350 #define CPU_TPIU_DEVID_MANCHESTER_SWO 0x00000200
351 #define CPU_TPIU_DEVID_MANCHESTER_SWO_BITN 10
352 #define CPU_TPIU_DEVID_MANCHESTER_SWO_M 0x00000200
353 #define CPU_TPIU_DEVID_MANCHESTER_SWO_S 10
354 
355 // Field: [9] PARALLEL_TRACE
356 //
357 // This bit Reads-As-Zero (RAZ), indicating that parallel trace port mode is
358 // not supported.
359 #define CPU_TPIU_DEVID_PARALLEL_TRACE 0x00000100
360 #define CPU_TPIU_DEVID_PARALLEL_TRACE_BITN 9
361 #define CPU_TPIU_DEVID_PARALLEL_TRACE_M 0x00000100
362 #define CPU_TPIU_DEVID_PARALLEL_TRACE_S 9
363 
364 // Field: [8:6] FIFO_SIZE
365 //
366 // Specifies the minimum TPIU buffer size
367 #define CPU_TPIU_DEVID_FIFO_SIZE_W 2
368 #define CPU_TPIU_DEVID_FIFO_SIZE_M 0x000001C0
369 #define CPU_TPIU_DEVID_FIFO_SIZE_S 6
370 
371 // Field: [5] ASYNC_TRACECLKIN
372 //
373 // Specifies whether TRACECLKIN can be asynchronous to CLK:
374 // 0b1 = TRACECLKIN can be asynchronous to CLK.
375 #define CPU_TPIU_DEVID_ASYNC_TRACECLKIN 0x00000020
376 #define CPU_TPIU_DEVID_ASYNC_TRACECLKIN_BITN 5
377 #define CPU_TPIU_DEVID_ASYNC_TRACECLKIN_M 0x00000020
378 #define CPU_TPIU_DEVID_ASYNC_TRACECLKIN_S 5
379 
380 // Field: [4:0] NUM_INPUTS
381 //
382 // Numer of trace inputs
383 // Specifies the number of trace inputs:
384 // 0b00000 = 1 input
385 // 0b00001 = 2 inputs
386 // If the implementation includes an ETM, the value of this field is 0b00001.
387 #define CPU_TPIU_DEVID_NUM_INPUTS_W 5
388 #define CPU_TPIU_DEVID_NUM_INPUTS_M 0x0000001F
389 #define CPU_TPIU_DEVID_NUM_INPUTS_S 0
390 #define CPU_TPIU_DEVID_NUM_INPUTS_ONE 0x00000000
391 #define CPU_TPIU_DEVID_NUM_INPUTS_TWO 0x00000001
392 
393 #endif // __CPU_TPIU__
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale