2 * Copyright 2012 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
15 /* Machine-generated file; do not edit. */
18 #ifndef __ARCH_MPIPE_SHM_H__
19 #define __ARCH_MPIPE_SHM_H__
22 #include <arch/mpipe_shm_def.h>
26 * MPIPE eDMA Descriptor.
27 * The eDMA descriptor is written by software and consumed by hardware. It
28 * is used to specify the location of egress packet data to be sent out of
29 * the chip via one of the packet interfaces.
39 #ifndef __BIG_ENDIAN__
41 * Generation number. Used to indicate a valid descriptor in ring. When
42 * a new descriptor is written into the ring, software must toggle this
43 * bit. The net effect is that the GEN bit being written into new
44 * descriptors toggles each time the ring tail pointer wraps.
48 * For devices with EDMA reorder support, this field allows the
49 * descriptor to select the egress FIFO. The associated DMA ring must
50 * have ALLOW_EFIFO_SEL enabled.
52 uint_reg_t efifo_sel : 6;
53 /** Reserved. Must be zero. */
55 /** Checksum generation enabled for this transfer. */
58 * Nothing to be sent. Used, for example, when software has dropped a
59 * packet but still wishes to return all of the associated buffers.
63 * Notification interrupt will be delivered when packet has been egressed.
67 * Boundary indicator. When 1, this transfer includes the EOP for this
68 * command. Must be clear on all but the last descriptor for an egress
72 /** Reserved. Must be zero. */
75 * Number of bytes to be sent for this descriptor. When zero, no data
76 * will be moved and the buffer descriptor will be ignored. If the
77 * buffer descriptor indicates that it is chained, the low 7 bits of the
78 * VA indicate the offset within the first buffer (e.g. 127 bytes is the
79 * maximum offset into the first buffer). If the size exceeds a single
80 * buffer, subsequent buffer descriptors will be fetched prior to
81 * processing the next eDMA descriptor in the ring.
83 uint_reg_t xfer_size : 14;
84 /** Reserved. Must be zero. */
87 * Destination of checksum relative to CSUM_START relative to the first
88 * byte moved by this descriptor. Must be zero if CSUM=0 in this
89 * descriptor. Must be less than XFER_SIZE (e.g. the first byte of the
90 * CSUM_DEST must be within the span of this descriptor).
92 uint_reg_t csum_dest : 8;
94 * Start byte of checksum relative to the first byte moved by this
95 * descriptor. If this is not the first descriptor for the egress
96 * packet, CSUM_START is still relative to the first byte in this
97 * descriptor. Must be zero if CSUM=0 in this descriptor.
99 uint_reg_t csum_start : 8;
101 * Initial value for 16-bit 1's compliment checksum if enabled via CSUM.
102 * Specified in network order. That is, bits[7:0] will be added to the
103 * byte pointed to by CSUM_START and bits[15:8] will be added to the byte
104 * pointed to by CSUM_START+1 (with appropriate 1's compliment carries).
105 * Must be zero if CSUM=0 in this descriptor.
107 uint_reg_t csum_seed : 16;
108 #else /* __BIG_ENDIAN__ */
109 uint_reg_t csum_seed : 16;
110 uint_reg_t csum_start : 8;
111 uint_reg_t csum_dest : 8;
113 uint_reg_t xfer_size : 14;
115 uint_reg_t bound : 1;
116 uint_reg_t notif : 1;
120 uint_reg_t efifo_sel : 6;
126 #ifndef __BIG_ENDIAN__
127 /** Virtual address. Must be sign extended by consumer. */
130 uint_reg_t __reserved_0 : 6;
131 /** Index of the buffer stack to which this buffer belongs. */
132 uint_reg_t stack_idx : 5;
134 uint_reg_t __reserved_1 : 3;
136 * Instance ID. For devices that support automatic buffer return between
137 * mPIPE instances, this field indicates the buffer owner. If the INST
138 * field does not match the mPIPE's instance number when a packet is
139 * egressed, buffers with HWB set will be returned to the other mPIPE
140 * instance. Note that not all devices support multi-mPIPE buffer
141 * return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates
142 * whether the INST field in the buffer descriptor is populated by iDMA
147 * Always set to one by hardware in iDMA packet descriptors. For eDMA,
148 * indicates whether the buffer will be released to the buffer stack
149 * manager. When 0, software is responsible for releasing the buffer.
153 * Encoded size of buffer. Set by the ingress hardware for iDMA packet
154 * descriptors. For eDMA descriptors, indicates the buffer size if .c
155 * indicates a chained packet. If an eDMA descriptor is not chained and
156 * the .hwb bit is not set, this field is ignored and the size is
157 * specified by the .xfer_size field.
169 * Chaining configuration for the buffer. Indicates that an ingress
170 * packet or egress command is chained across multiple buffers, with each
171 * buffer's size indicated by the .size field.
174 #else /* __BIG_ENDIAN__ */
179 uint_reg_t __reserved_1 : 3;
180 uint_reg_t stack_idx : 5;
181 uint_reg_t __reserved_0 : 6;
192 * MPIPE Packet Descriptor.
193 * The packet descriptor is filled by the mPIPE's classification,
194 * load-balancing, and buffer management services. Some fields are consumed
195 * by mPIPE hardware, and others are consumed by Tile software.
205 #ifndef __BIG_ENDIAN__
207 * Notification ring into which this packet descriptor is written.
208 * Typically written by load balancer, but can be overridden by
209 * classification program if NR is asserted.
211 uint_reg_t notif_ring : 8;
212 /** Source channel for this packet. Written by mPIPE DMA hardware. */
213 uint_reg_t channel : 5;
215 uint_reg_t __reserved_0 : 1;
218 * Generated by the MAC interface. Asserted if there was an overrun of
219 * the MAC's receive FIFO. This condition generally only occurs if the
220 * mPIPE clock is running too slowly.
225 * Written by the iDMA hardware. Asserted if packet was truncated due to
226 * insufficient space in iPkt buffer
230 * Written by the iDMA hardware. Indicates the number of bytes written
231 * to Tile memory. In general, this is the actual size of the packet as
232 * received from the MAC. But if the packet is truncated due to running
233 * out of buffers or due to the iPkt buffer filling up, then the L2_SIZE
234 * will be reduced to reflect the actual number of valid bytes written to
237 uint_reg_t l2_size : 14;
240 * Generated by the MAC. Asserted if MAC indicated an L2 CRC error or
241 * other L2 error (bad length etc.) on the packet.
246 * Written by the iDMA hardware. Asserted if packet was not completely
247 * received before being sent to classifier. L2_Size will indicate
248 * number of bytes received so far.
252 * Written by the classification program. Used by the load balancer to
253 * select the ring into which this packet descriptor is written.
255 uint_reg_t bucket_id : 13;
257 uint_reg_t __reserved_1 : 3;
260 * Written by classification program. When 1, the checksum engine will
261 * perform checksum based on the CSUM_SEED, CSUM_START, and CSUM_BYTES
262 * fields. The result will be placed in CSUM_VAL.
266 * Notification Ring Select.
267 * Written by the classification program. When 1, the NotifRingIDX is
268 * set by classification program rather than being set by load balancer.
272 * Written by classification program. Indicates whether packet and
273 * descriptor should both be dropped, both be delivered, or only the
274 * descriptor should be delivered.
278 * General Purpose Sequence Number Enable.
279 * Written by the classification program. When 1, the GP_SQN_SEL field
280 * contains the sequence number selector and the GP_SQN field will be
281 * replaced with the associated sequence number. When clear, the GP_SQN
282 * field is left intact and be used as "Custom" bytes.
287 * Enable TimeStamp insertion. When clear, timestamp field may be filled
288 * with custom data by classifier. When set, hardware inserts the
289 * timestamp when the start of packet is received from the MAC.
293 * Packet Sequence Number Enable.
294 * Enable PacketSQN insertion. When clear, PacketSQN field may be filled
295 * with custom data by classifier. When set, hardware inserts the packet
296 * sequence number when the packet descriptor is written to a
302 * Written by the iDMA hardware. Asserted if iDMA ran out of buffers
303 * while writing the packet. Software must still return any buffer
304 * descriptors whose C field indicates a valid descriptor was consumed.
308 * Written by the classification program. The associated counter is
309 * incremented when the packet is sent.
313 uint_reg_t __reserved_2 : 3;
314 #else /* __BIG_ENDIAN__ */
315 uint_reg_t __reserved_2 : 3;
324 uint_reg_t __reserved_1 : 3;
325 uint_reg_t bucket_id : 13;
328 uint_reg_t l2_size : 14;
331 uint_reg_t __reserved_0 : 1;
332 uint_reg_t channel : 5;
333 uint_reg_t notif_ring : 8;
338 #ifndef __BIG_ENDIAN__
340 * Written by the classification program. The associated counter is
341 * incremented when the packet is sent.
345 uint_reg_t __reserved_3 : 3;
347 * Written by classification program. Indicates the start byte for
348 * checksum. Relative to 1st byte received from MAC.
350 uint_reg_t csum_start : 8;
352 * Checksum seed written by classification program. Overwritten with
353 * resultant checksum if CS bit is asserted. The endianness of the CSUM
354 * value bits when viewed by Tile software match the packet byte order.
355 * That is, bits[7:0] of the resulting checksum value correspond to
356 * earlier (more significant) bytes in the packet. To avoid classifier
357 * software from having to byte swap the CSUM_SEED, the iDMA checksum
358 * engine byte swaps the classifier's result before seeding the checksum
359 * calculation. Thus, the CSUM_START byte of packet data is added to
360 * bits[15:8] of the CSUM_SEED field generated by the classifier. This
361 * byte swap will be visible to Tile software if the CS bit is clear.
363 uint_reg_t csum_seed_val : 16;
365 * Written by the classification program. Not interpreted by mPIPE
368 uint_reg_t custom0 : 32;
369 #else /* __BIG_ENDIAN__ */
370 uint_reg_t custom0 : 32;
371 uint_reg_t csum_seed_val : 16;
372 uint_reg_t csum_start : 8;
373 uint_reg_t __reserved_3 : 3;
379 #ifndef __BIG_ENDIAN__
381 * Written by the classification program. Not interpreted by mPIPE
384 uint_reg_t custom1 : 64;
385 #else /* __BIG_ENDIAN__ */
386 uint_reg_t custom1 : 64;
391 #ifndef __BIG_ENDIAN__
393 * Written by the classification program. Not interpreted by mPIPE
396 uint_reg_t custom2 : 64;
397 #else /* __BIG_ENDIAN__ */
398 uint_reg_t custom2 : 64;
403 #ifndef __BIG_ENDIAN__
405 * Written by the classification program. Not interpreted by mPIPE
408 uint_reg_t custom3 : 64;
409 #else /* __BIG_ENDIAN__ */
410 uint_reg_t custom3 : 64;
415 #ifndef __BIG_ENDIAN__
417 * Sequence number applied when packet is distributed. Classifier
418 * selects which sequence number is to be applied by writing the 13-bit
419 * SQN-selector into this field. For devices that support EXT_SQN (as
420 * indicated in IDMA_INFO.EXT_SQN_SUPPORT), the GP_SQN can be extended to
421 * 32-bits via the IDMA_CTL.EXT_SQN register. In this case the
422 * PACKET_SQN will be reduced to 32 bits.
424 uint_reg_t gp_sqn : 16;
426 * Written by notification hardware. The packet sequence number is
427 * incremented for each packet that wasn't dropped.
429 uint_reg_t packet_sqn : 48;
430 #else /* __BIG_ENDIAN__ */
431 uint_reg_t packet_sqn : 48;
432 uint_reg_t gp_sqn : 16;
437 #ifndef __BIG_ENDIAN__
439 * Written by hardware when the start-of-packet is received by the mPIPE
440 * from the MAC. This is the nanoseconds part of the packet timestamp.
442 uint_reg_t time_stamp_ns : 32;
444 * Written by hardware when the start-of-packet is received by the mPIPE
445 * from the MAC. This is the seconds part of the packet timestamp.
447 uint_reg_t time_stamp_sec : 32;
448 #else /* __BIG_ENDIAN__ */
449 uint_reg_t time_stamp_sec : 32;
450 uint_reg_t time_stamp_ns : 32;
455 #ifndef __BIG_ENDIAN__
456 /** Virtual address. Must be sign extended by consumer. */
459 uint_reg_t __reserved_4 : 6;
460 /** Index of the buffer stack to which this buffer belongs. */
461 uint_reg_t stack_idx : 5;
463 uint_reg_t __reserved_5 : 3;
465 * Instance ID. For devices that support automatic buffer return between
466 * mPIPE instances, this field indicates the buffer owner. If the INST
467 * field does not match the mPIPE's instance number when a packet is
468 * egressed, buffers with HWB set will be returned to the other mPIPE
469 * instance. Note that not all devices support multi-mPIPE buffer
470 * return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates
471 * whether the INST field in the buffer descriptor is populated by iDMA
476 * Always set to one by hardware in iDMA packet descriptors. For eDMA,
477 * indicates whether the buffer will be released to the buffer stack
478 * manager. When 0, software is responsible for releasing the buffer.
482 * Encoded size of buffer. Set by the ingress hardware for iDMA packet
483 * descriptors. For eDMA descriptors, indicates the buffer size if .c
484 * indicates a chained packet. If an eDMA descriptor is not chained and
485 * the .hwb bit is not set, this field is ignored and the size is
486 * specified by the .xfer_size field.
498 * Chaining configuration for the buffer. Indicates that an ingress
499 * packet or egress command is chained across multiple buffers, with each
500 * buffer's size indicated by the .size field.
503 #else /* __BIG_ENDIAN__ */
508 uint_reg_t __reserved_5 : 3;
509 uint_reg_t stack_idx : 5;
510 uint_reg_t __reserved_4 : 6;
519 #endif /* !defined(__ASSEMBLER__) */
521 #endif /* !defined(__ARCH_MPIPE_SHM_H__) */