Lines Matching +full:four +full:- +full:byte
1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com
16 * struct cppi5_desc_hdr_t - Descriptor header, present in all types of
31 * struct cppi5_host_desc_t - Host-mode packet and buffer descriptor definition
39 * Protocol Specific Data (optional, 0-128 bytes in
41 * Other Software Data (0-N bytes, optional)
66 * 0 - located in the descriptor,
87 /* Return Policy: 0 - Entire packet 1 - Each buffer */
119 * struct cppi5_desc_epib_t - Host Packet Descriptor Extended Packet Info Block
133 * struct cppi5_monolithic_desc_t - Monolithic-mode packet descriptor
136 * Protocol Specific Data (optional, 0-128 bytes in
138 * Other Software Data (0-N bytes, optional)
151 * 1-0x1ff = Vector to the Reload Index and resume processing
179 * cppi5_desc_is_tdcm - check if the paddr indicates Teardown Complete Message
190 * cppi5_desc_get_type - get descriptor type
200 return (desc_hdr->pkt_info0 & CPPI5_INFO0_HDESC_TYPE_MASK) >> in cppi5_desc_get_type()
205 * cppi5_desc_get_errflags - get Error Flags from Desc
212 return (desc_hdr->pkt_info1 & CPPI5_INFO1_DESC_PKTERROR_MASK) >> in cppi5_desc_get_errflags()
217 * cppi5_desc_get_pktids - get Packet and Flow ids from Desc
227 *pkt_id = (desc_hdr->pkt_info1 & CPPI5_INFO1_DESC_PKTID_MASK) >> in cppi5_desc_get_pktids()
229 *flow_id = (desc_hdr->pkt_info1 & CPPI5_INFO1_DESC_FLOWID_MASK) >> in cppi5_desc_get_pktids()
234 * cppi5_desc_set_pktids - set Packet and Flow ids in Desc
242 desc_hdr->pkt_info1 &= ~(CPPI5_INFO1_DESC_PKTID_MASK | in cppi5_desc_set_pktids()
244 desc_hdr->pkt_info1 |= (pkt_id << CPPI5_INFO1_DESC_PKTID_SHIFT) & in cppi5_desc_set_pktids()
246 desc_hdr->pkt_info1 |= (flow_id << CPPI5_INFO1_DESC_FLOWID_SHIFT) & in cppi5_desc_set_pktids()
251 * cppi5_desc_set_retpolicy - set Packet Return Policy in Desc
262 desc_hdr->pkt_info2 &= ~(CPPI5_INFO2_DESC_RETP_MASK | in cppi5_desc_set_retpolicy()
264 desc_hdr->pkt_info2 |= flags & CPPI5_INFO2_DESC_RETP_MASK; in cppi5_desc_set_retpolicy()
265 desc_hdr->pkt_info2 |= return_ring_id & CPPI5_INFO2_DESC_RETQ_MASK; in cppi5_desc_set_retpolicy()
269 * cppi5_desc_get_tags_ids - get Packet Src/Dst Tags from Desc
280 *src_tag_id = (desc_hdr->src_dst_tag & in cppi5_desc_get_tags_ids()
284 *dst_tag_id = desc_hdr->src_dst_tag & in cppi5_desc_get_tags_ids()
289 * cppi5_desc_set_tags_ids - set Packet Src/Dst Tags in HDesc
299 desc_hdr->src_dst_tag = (src_tag_id << CPPI5_INFO3_DESC_SRCTAG_SHIFT) & in cppi5_desc_set_tags_ids()
301 desc_hdr->src_dst_tag |= dst_tag_id & CPPI5_INFO3_DESC_DSTTAG_MASK; in cppi5_desc_set_tags_ids()
305 * cppi5_hdesc_calc_size - Calculate Host Packet Descriptor size
311 * 0 - if PSDATA > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE
331 * cppi5_hdesc_init - Init Host Packet Descriptor size
339 * 0 - if PSDATA > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE
344 desc->hdr.pkt_info0 = (CPPI5_INFO0_DESC_TYPE_VAL_HOST << in cppi5_hdesc_init()
346 desc->hdr.pkt_info0 |= ((psdata_size >> 2) << in cppi5_hdesc_init()
349 desc->next_desc = 0; in cppi5_hdesc_init()
353 * cppi5_hdesc_update_flags - Replace descriptor flags
362 desc->hdr.pkt_info0 &= ~(CPPI5_INFO0_HDESC_EPIB_PRESENT | in cppi5_hdesc_update_flags()
364 desc->hdr.pkt_info0 |= flags; in cppi5_hdesc_update_flags()
368 * cppi5_hdesc_update_psdata_size - Replace PSdata size
375 desc->hdr.pkt_info0 &= ~CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK; in cppi5_hdesc_update_psdata_size()
376 desc->hdr.pkt_info0 |= ((psdata_size >> 2) << in cppi5_hdesc_update_psdata_size()
382 * cppi5_hdesc_get_psdata_size - get PSdata size in bytes
389 if (!(desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION)) in cppi5_hdesc_get_psdata_size()
390 psdata_size = (desc->hdr.pkt_info0 & in cppi5_hdesc_get_psdata_size()
398 * cppi5_hdesc_get_pktlen - get Packet Length from HDesc
405 return (desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PKTLEN_MASK); in cppi5_hdesc_get_pktlen()
409 * cppi5_hdesc_set_pktlen - set Packet Length in HDesc
415 desc->hdr.pkt_info0 &= ~CPPI5_INFO0_HDESC_PKTLEN_MASK; in cppi5_hdesc_set_pktlen()
416 desc->hdr.pkt_info0 |= (pkt_len & CPPI5_INFO0_HDESC_PKTLEN_MASK); in cppi5_hdesc_set_pktlen()
420 * cppi5_hdesc_get_psflags - get Protocol Specific Flags from HDesc
427 return (desc->hdr.pkt_info1 & CPPI5_INFO1_HDESC_PSFLGS_MASK) >> in cppi5_hdesc_get_psflags()
432 * cppi5_hdesc_set_psflags - set Protocol Specific Flags in HDesc
438 desc->hdr.pkt_info1 &= ~CPPI5_INFO1_HDESC_PSFLGS_MASK; in cppi5_hdesc_set_psflags()
439 desc->hdr.pkt_info1 |= (ps_flags << in cppi5_hdesc_set_psflags()
445 * cppi5_hdesc_get_errflags - get Packet Type from HDesc
450 return (desc->hdr.pkt_info2 & CPPI5_INFO2_HDESC_PKTTYPE_MASK) >> in cppi5_hdesc_get_pkttype()
455 * cppi5_hdesc_get_errflags - set Packet Type in HDesc
462 desc->hdr.pkt_info2 &= ~CPPI5_INFO2_HDESC_PKTTYPE_MASK; in cppi5_hdesc_set_pkttype()
463 desc->hdr.pkt_info2 |= in cppi5_hdesc_set_pkttype()
469 * cppi5_hdesc_attach_buf - attach buffer to HDesc
482 desc->buf_ptr = buf; in cppi5_hdesc_attach_buf()
483 desc->buf_info1 = buf_data_len & CPPI5_BUFINFO1_HDESC_DATA_LEN_MASK; in cppi5_hdesc_attach_buf()
484 desc->org_buf_ptr = obuf; in cppi5_hdesc_attach_buf()
485 desc->org_buf_len = obuf_len & CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK; in cppi5_hdesc_attach_buf()
491 *obuf = desc->org_buf_ptr; in cppi5_hdesc_get_obuf()
492 *obuf_len = desc->org_buf_len & CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK; in cppi5_hdesc_get_obuf()
497 desc->buf_ptr = desc->org_buf_ptr; in cppi5_hdesc_reset_to_original()
498 desc->buf_info1 = desc->org_buf_len; in cppi5_hdesc_reset_to_original()
502 * cppi5_hdesc_link_hbdesc - link Host Buffer Descriptor to HDesc
511 desc->next_desc = hbuf_desc; in cppi5_hdesc_link_hbdesc()
517 return (dma_addr_t)desc->next_desc; in cppi5_hdesc_get_next_hbdesc()
522 desc->hdr = (struct cppi5_desc_hdr_t) { 0 }; in cppi5_hdesc_reset_hbdesc()
523 desc->next_desc = 0; in cppi5_hdesc_reset_hbdesc()
527 * cppi5_hdesc_epib_present - check if EPIB present
534 return !!(desc_hdr->pkt_info0 & CPPI5_INFO0_HDESC_EPIB_PRESENT); in cppi5_hdesc_epib_present()
538 * cppi5_hdesc_get_psdata - Get pointer on PSDATA
542 * NULL - if ps_data placed at the start of data buffer.
549 if (desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION) in cppi5_hdesc_get_psdata()
552 psdata_size = (desc->hdr.pkt_info0 & in cppi5_hdesc_get_psdata()
559 psdata = &desc->epib; in cppi5_hdesc_get_psdata()
561 if (cppi5_hdesc_epib_present(&desc->hdr)) in cppi5_hdesc_get_psdata()
568 * cppi5_hdesc_get_swdata - Get pointer on swdata
579 if (!(desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION)) in cppi5_hdesc_get_swdata()
580 psdata_size = (desc->hdr.pkt_info0 & in cppi5_hdesc_get_swdata()
584 swdata = &desc->epib; in cppi5_hdesc_get_swdata()
586 if (cppi5_hdesc_epib_present(&desc->hdr)) in cppi5_hdesc_get_swdata()
623 * enum cppi5_tr_types - TR types
627 * @CPPI5_TR_TYPE3: Four dimensional data move
628 * @CPPI5_TR_TYPE4: Four dimensional data move with data formatting
629 * @CPPI5_TR_TYPE5: Four dimensional Cache Warm
630 * @CPPI5_TR_TYPE8: Four Dimensional Block Move
631 * @CPPI5_TR_TYPE9: Four Dimensional Block Move with Repacking
634 * @CPPI5_TR_TYPE15: Four Dimensional Block Move with Repacking and
644 /* type6-7: Reserved */
649 /* type12-14: Reserved */
655 * enum cppi5_tr_event_size - TR Flags EVENT_SIZE field specifies when an event
661 * Type 1-11: when ICNT1 is decremented
662 * @CPPI5_TR_EVENT_SIZE_ICNT2_DEC: Type 0-1,10-11: when the last data
666 * @CPPI5_TR_EVENT_SIZE_ICNT3_DEC: Type 0-2,10-11: when the last data
680 * enum cppi5_tr_trigger - TR Flags TRIGGERx field specifies the type of trigger
697 * enum cppi5_tr_trigger_type - TR Flags TRIGGERx_TYPE field specifies the type
720 * struct cppi5_tr_type0_t - Type 0 (One dimensional data move) TR (16 byte)
734 * struct cppi5_tr_type1_t - Type 1 (Two dimensional data move) TR (32 byte)
750 * struct cppi5_tr_type2_t - Type 2 (Three dimensional data move) TR (32 byte)
772 * struct cppi5_tr_type3_t - Type 3 (Four dimensional data move) TR (32 byte)
796 * struct cppi5_tr_type15_t - Type 15 (Four Dimensional Block Copy with
797 * Repacking and Indirection Support) TR (64 byte)
843 * struct cppi5_tr_resp_t - TR response record
866 * enum cppi5_tr_resp_status_type - TR Response Status Type field is used to
894 * enum cppi5_tr_resp_status_submission - TR Response Status field values which
910 * enum cppi5_tr_resp_status_unsupported - TR Response Status field values which
938 * cppi5_trdesc_calc_size - Calculate TR Descriptor size
957 * cppi5_trdesc_init - Init TR Descriptor
972 desc_hdr->pkt_info0 = CPPI5_INFO0_DESC_TYPE_VAL_TR << in cppi5_trdesc_init()
974 desc_hdr->pkt_info0 |= in cppi5_trdesc_init()
977 desc_hdr->pkt_info0 |= in cppi5_trdesc_init()
980 desc_hdr->pkt_info0 |= (tr_count - 1) & CPPI5_INFO0_TRDESC_LASTIDX_MASK; in cppi5_trdesc_init()
982 desc_hdr->pkt_info1 |= ((ffs(tr_size >> 4) - 1) << in cppi5_trdesc_init()
988 * cppi5_tr_init - Init TR record
1018 * cppi5_tr_set_trigger - Configure trigger0/1 and trigger0/1_type
1047 * cppi5_tr_cflag_set - Update the Configuration specific flags