1 ;
2 ; TEXAS INSTRUMENTS TEXT FILE LICENSE
3 ;
4 ; Copyright (c) 2018-2019 Texas Instruments Incorporated
5 ;
6 ; All rights reserved not granted herein.
7 ;
8 ; Limited License.
9 ;
10 ; Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
11 ; license under copyrights and patents it now or hereafter owns or controls to
12 ; make, have made, use, import, offer to sell and sell ("Utilize") this software
13 ; subject to the terms herein. With respect to the foregoing patent license,
14 ; such license is granted solely to the extent that any such patent is necessary
15 ; to Utilize the software alone. The patent license shall not apply to any
16 ; combinations which include this software, other than combinations with devices
17 ; manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.
18 ;
19 ; Redistributions must preserve existing copyright notices and reproduce this license
20 ; (including the above copyright notice and the disclaimer and (if applicable) source
21 ; code license limitations below) in the documentation and/or other materials provided
22 ; with the distribution.
23 ;
24 ; Redistribution and use in binary form, without modification, are permitted provided
25 ; that the following conditions are met:
26 ; No reverse engineering, decompilation, or disassembly of this software is
27 ; permitted with respect to any software provided in binary form.
28 ; Any redistribution and use are licensed by TI for use only with TI Devices.
29 ; Nothing shall obligate TI to provide you with source code for the software
30 ; licensed and provided to you in object code.
31 ;
32 ; If software source code is provided to you, modification and redistribution of the
33 ; source code are permitted provided that the following conditions are met:
34 ; Any redistribution and use of the source code, including any resulting derivative
35 ; works, are licensed by TI for use only with TI Devices.
36 ; Any redistribution and use of any object code compiled from the source code
37 ; and any resulting derivative works, are licensed by TI for use only with TI Devices.
38 ;
39 ; Neither the name of Texas Instruments Incorporated nor the names of its suppliers
40 ; may be used to endorse or promote products derived from this software without
41 ; specific prior written permission.
42 ;
43 ; DISCLAIMER.
44 ;
45 ; THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED
46 ; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
47 ; AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S
48 ; LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
49 ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
50 ; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
51 ; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
53 ; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 ;---------------------------
56 ;file: regalias.h
57 ;----------------------------
59 ;==========================================================================
60 Struct_RXTASK .struct
61 pq_cur .ushort ;
62 res1 .ubyte ;
63 res2 .ubyte ;
64 vlanc .uint ;
65 ; state aux
66 aux_flags .ubyte ;
67 priority .ubyte ;0-7
68 dcs .ubyte ;ipc contol
69 res3 .ubyte ;spare1
70 ; state info
71 def_flow .ushort ;base flow for port
72 state_flags .ubyte ;
73 port_state .ubyte ;
74 .endstruct ;Struct_RXTASK
76 RxRegs .sassign r20, Struct_RXTASK ; r20-r23
78 ; aux flags definitions
79 f_fh .set 0 ;half of rx fifo we are working in
80 f_vstrip .set 1 ;hard strip of vlan tag needed
81 f_vadd .set 2 ;hard add of vlan tag needed
82 f_untag .set 3 ;set if pkt arrived un-tagged so we are running with "virtual internal tag"
83 f_dcpp .set 4
84 f_b1_seen .set 5
85 ; info flags
87 f_vlan .set 0 ;vlan enabled
88 f_unitohost .set 1 ;ukn unicast to host (switch)
89 f_promiscuous .set 2 ;promiscuous mode (mac)
90 f_m_promiscuous .set 3 ;mcast promiscuous (mac)
91 f_preemptive .set 4 ;preemption active
92 f_prm .set 5 ;priority remap
95 ;==========================================================================
96 Struct_TXTASK .struct
97 res .ushort
98 ds_flags .ushort ;descriptor info
99 stash_ds_flags .ushort
100 stash_tx_len .ushort
101 ;
102 res2 .uint
103 .endstruct ;Struct_TXTASK
106 TxRegs .sassign r21, Struct_TXTASK
108 ;==========================================================================
109 ;---BG TASK
110 ;r0 temp
111 ;r1 temp
112 ;r2-r9 various
113 ;r10 - r19
115 Struct_BGTASK .struct
116 bg_cnt .uint ; BG loop counter
117 psi2h_active .ubyte ; 1 - active, 0 - idle
118 res9 .ubyte ;
119 len2host .ushort ;
120 res10 .ushort ;
121 len_orig .ushort ;
122 .endstruct ;Struct_BGTASK
124 BgRegs .sassign r20, Struct_BGTASK
126 ;==========================================================================
127 Struct_GLOBAL .struct
128 rx .union
129 x .uint
130 s .struct
131 fl_n_state .ushort
132 pkt_len .ushort
133 .endstruct
134 b .struct
135 flags .ubyte
136 state .ubyte
137 pkt_len .ushort
138 .endstruct
139 .endunion ;rx
141 speed_f .ubyte ; speed/duplex flags
142 ret_cnt .ubyte ; retransmission counter
143 tx_blk .ubyte ; tx 64 byte blocks counter
144 res .ubyte ;
146 tx .union
147 x .uint
148 b .struct
149 state .ubyte
150 flags .ubyte
151 len .ushort
152 .endstruct ;b
153 .endunion ;tx
155 pkt_cnt .union
156 x .uint
157 w .struct
158 rx .ushort
159 tx .ushort
160 .endstruct ;w
161 .endunion ;pkt_cnt
163 snf .union ; psi store and forward
164 x .uint
165 b .struct
166 wr_cur .ubyte ; current write slot
167 wr_orig .ubyte ; original write slot
168 rd_cur .ubyte ; current read slot
169 dbg_cnt .ubyte
170 .endstruct
171 .endunion ;snf
173 psiq .union
174 x .uint
175 b .struct
176 head .ubyte
177 tail .ubyte
178 num_elem .ubyte
179 res .ubyte
180 .endstruct ;b
181 .endunion ; psiq
182 .endstruct ;Struct_GLOBAL
184 GRegs .sassign r24, Struct_GLOBAL
186 ; 100/10Mbps/half duplex port flags. That is mirror of the correcponding bits
187 ; of the ICSSG_RGMII_CFG register
188 .if $isdefed("SLICE0")
189 f_100mbps .set 1
190 f_1gbps .set 2
191 f_half_d .set 3
192 f_mask_o .set 0xe
193 f_mask_a .set 0xf1
195 f_col_detected .set 4
196 f_stopped_due_col .set 5
197 f_wait_ipg .set 6
200 .else
201 f_100mbps .set 5
202 f_1gbps .set 6
203 f_half_d .set 7
204 f_mask_o .set 0xe0
205 f_mask_a .set 0x1f
207 f_col_detected .set 0
208 f_stopped_due_col .set 1
209 f_wait_ipg .set 2
210 .endif
212 ;RX flags
213 f_tohost .set 0
214 f_rx_sof .set 7
216 ;TX states
217 TX_S_IDLE .set 0
218 TX_S_ACTIVE .set 1
219 TX_S_ERR .set 2
220 TX_S_W_EOF .set 3
221 ;TX_S_W_CEOF .set 3
222 TX_S_W_PEOF .set 4
223 ;TX_S_DC .set 5
224 ;TX_S_CUT .set 6
225 TX_S_LOOP .set 7
227 ; TX flags
228 ;f_tx_spare0 .set 0
229 f_tx_stash .set 1 ;if set then there is a preempted packet present in stash
230 f_tx_hold .set 2 ;set if hold active
231 f_tx_efq .set 3 ;express frame is queued! (from portq)
232 f_tx_efqd .set 4 ;express frame is queued! (from DC queue)
233 f_next_dma .set 5 ;dma to check next (non PSA=ping/pong case)
236 ;==========================================================================
237 Struct_PktCtx .struct
238 ; -0-
239 ippc_flags .ubyte
240 ippc_forward .ubyte
241 ippc_totlen .ushort ;expected length of packet
242 ; -1-
243 ippc_curlen .ushort ;current length of pkt
244 ippc_res .ubyte ;resource (queue number)
245 ippc_es .ubyte ;extra state (details on what we might stall on)
246 ; -2-
247 he_flags .ubyte ;seebelow
248 ;bits 0-3: 1 => thread x uses rate limiter
249 ;bits 4: spare
250 ;bit 6: Shutting_down (clear out any ongoing/stalled transfers)
251 ;bit 7: PSI DOWN (no host egress)
252 he_dq01 .ubyte ;default port queues for threads 0 (high nibble), 1
253 he_dq23 .ubyte ; "" for threads 2 (high nibble), 3
254 he_spare .ubyte
255 ; -3 & 4 -
256 ippx_ptr0 .uint ;buffer pointer0 - this slice
257 ippx_ptr1 .uint ;buffer pointer1 - other slice
259 .endstruct
261 ;;r_pix2
262 ; .if $isdefed("HE_CS_SUPPORT") ;not in pg1.0
263 ; .asg r_pix2, ippx_cw2 ;control word2
264 ; .asg b3, cs_loc ;offset to where csum should be placed (should contain partial cs already (1 relative)
265 ; .asg b2, cs_start ;offset where to start checksum (1 relative)
266 ; .asg t15, cs_inv ;if st then 0 cs qqill eb inverted and sent as 0xffff
267 ; .asg w0, cs_bc ; bytes to checksum (>0 => do checksum so test this to see if checksum needed
268 ; .endif
270 ; Struct_RCtx is alias of the Struct_PktCtx and used
271 ; only to save or restore some of the struct registers
272 Struct_RCtx .struct
273 pix0 .uint
274 pix1 .uint
275 pix2 .uint
276 pix3 .uint
277 pix4 .uint
278 .endstruct
280 Ctx .sassign R20, Struct_PktCtx
281 RCtx .sassign R20, Struct_RCtx
283 f_rts .set 7 ;request egress timestamp
284 f_crcinpkt .set 6 ;if set, crc is already included in packet so hw shouldn't add
285 f_vadd2 .set 5 ;if set, vlan tag needs to be added
286 f_vrem2 .set 4 ;if set, vlan tag needs to be removed
287 f_cs .set 3 ;checksum needed (see ippc_cw2)
288 f_eop .set 2 ;eop seen
290 f_ippc_spare0 .set 0 ;to line up with forward macro 'res' format
291 f_port0 .set 1 ;egress port 0
292 f_port1 .set 2 ;egress port 1
293 f_is_unicast .set 3
294 f_is_broadcast .set 4
295 f_is_multicast .set 5
296 f_is_express .set 6 ;future
298 f_es_b0 .set 0 ;buffer for this slice
299 f_es_b1 .set 1 ;buffer for other slice
300 f_es_q0 .set 2 ;queue slot for this slice
301 f_es_q1 .set 3 ;queue slot for the other slice
303 HE_SPARE .set 4
304 HE_SHUT .set 6 ;
305 HE_DOWN .set 7 ;no host egress
307 ; for switch we have our and other ports
308 .if $isdefed("SLICE0")
309 our_port .set 1
310 other_port .set 2
311 .else
312 our_port .set 2
313 other_port .set 1
314 .endif
316 ;==========================================================================
318 ;--- Tasks:TASK1(block0), RX_TASK4 (eof)
319 ; --highest priority
320 .asg r14, R_PSI_FLAGS ;overlay w/scratch4
321 .asg r15, R_TS_HI
322 .asg r16, R_TS_LO
323 .asg r16, R_BASIC_F ;overlay w/ TS_LO
324 .asg r17, R_CLASSI ;overlay
325 .asg r21, R_RX_STATE_INFO
326 .asg r22, R_RX_STATE
328 ;==========================================================================
329 Struct_RTU_GLOBAL .struct
330 ;-1-
331 ret_addr .ushort
332 res .ubyte
333 speed_f .ubyte
335 ;-2-
336 StallMask .ubyte
337 ActThrdNum .ubyte
338 StallReason .ubyte
339 ResLock .ubyte
340 ;-3-
341 pqmap .ubyte ;bit i=1 => queue i has something
342 state .ubyte
343 flags .ushort
344 ;-4-
345 qmask .ubyte ;mask of queues to check
346 qmask_old .ubyte ;preserved queue mask
347 spare .ubyte
348 seq_num .ubyte ; save seq number for mgr packet
349 ;-5-
350 save1 .ubyte ;
351 save2 .ubyte ;
352 save3 .ubyte ;
353 save4 .ubyte ;
355 .endstruct ;Struct_RTU_GLOBAL
357 f_dmau .set 0 ; next dma unit
358 f_hold .set 1 ; hold set=> means only queues HOLDQ mask will be serviced (these are 'express' queues)
359 f_cut .set 2 ; cut-thru set
360 f_dma0 .set 3 ; dma1 active
361 f_dma1 .set 4 ; dma0 active
362 f_tstx_ready .set 5
363 f_pend .set 6 ;true if hold/resume transision pending
364 f_pactive .set 7 ;true if preempt active (assume this can only be changed when scheduler is in idle state..
365 f_tx0_complete .set 8
366 f_tx1_complete .set 9
367 f_tx0_preempt .set 10 ;tbd if need
369 ;scheduler state/shadow state (s_state)GRrtu
370 ;Note: only 00 and 30 used currently (with PSA feature)
371 SCHED_STATE_00 .set 0
372 SCHED_STATE_10 .set 1
373 SCHED_STATE_20 .set 2
374 SCHED_STATE_30 .set 3
375 SCHED_STATE_31 .set 4
376 SCHED_STATE_34 .set 5
378 NORM_QMASK .set 0xff
379 HOLD_QMASK .set 0x80
380 EPKT_QMASK .set (HOLD_QMASK) ; same
382 GRrtu .sassign r25, Struct_RTU_GLOBAL