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