xref: /f-stack/dpdk/drivers/bus/fslmc/mc/fsl_dpopr.h (revision d30ea906)
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  *
3  * Copyright 2013-2015 Freescale Semiconductor Inc.
4  * Copyright 2018 NXP
5  *
6  */
7 #ifndef __FSL_DPOPR_H_
8 #define __FSL_DPOPR_H_
9 
10 /** @addtogroup dpopr Data Path Order Restoration API
11  * Contains initialization APIs and runtime APIs for the Order Restoration
12  * @{
13  */
14 
15 /** Order Restoration properties */
16 
17 /**
18  * Create a new Order Point Record option
19  */
20 #define OPR_OPT_CREATE 0x1
21 /**
22  * Retire an existing Order Point Record option
23  */
24 #define OPR_OPT_RETIRE 0x2
25 
26 /**
27  * struct opr_cfg - Structure representing OPR configuration
28  * @oprrws: Order point record (OPR) restoration window size (0 to 5)
29  *			0 - Window size is 32 frames.
30  *			1 - Window size is 64 frames.
31  *			2 - Window size is 128 frames.
32  *			3 - Window size is 256 frames.
33  *			4 - Window size is 512 frames.
34  *			5 - Window size is 1024 frames.
35  *@oa: OPR auto advance NESN window size (0 disabled, 1 enabled)
36  *@olws: OPR acceptable late arrival window size (0 to 3)
37  *			0 - Disabled. Late arrivals are always rejected.
38  *			1 - Window size is 32 frames.
39  *			2 - Window size is the same as the OPR restoration
40  *			window size configured in the OPRRWS field.
41  *			3 - Window size is 8192 frames.
42  *			Late arrivals are always accepted.
43  *@oeane: Order restoration list (ORL) resource exhaustion
44  *			advance NESN enable (0 disabled, 1 enabled)
45  *@oloe: OPR loose ordering enable (0 disabled, 1 enabled)
46  */
47 struct opr_cfg {
48 	uint8_t oprrws;
49 	uint8_t oa;
50 	uint8_t olws;
51 	uint8_t oeane;
52 	uint8_t oloe;
53 };
54 
55 /**
56  * struct opr_qry - Structure representing OPR configuration
57  * @enable: Enabled state
58  * @rip: Retirement In Progress
59  * @ndsn: Next dispensed sequence number
60  * @nesn: Next expected sequence number
61  * @ea_hseq: Early arrival head sequence number
62  * @hseq_nlis: HSEQ not last in sequence
63  * @ea_tseq: Early arrival tail sequence number
64  * @tseq_nlis: TSEQ not last in sequence
65  * @ea_tptr: Early arrival tail pointer
66  * @ea_hptr: Early arrival head pointer
67  * @opr_id: Order Point Record ID
68  * @opr_vid: Order Point Record Virtual ID
69  */
70 struct opr_qry {
71 	char enable;
72 	char rip;
73 	uint16_t ndsn;
74 	uint16_t nesn;
75 	uint16_t ea_hseq;
76 	char hseq_nlis;
77 	uint16_t ea_tseq;
78 	char tseq_nlis;
79 	uint16_t ea_tptr;
80 	uint16_t ea_hptr;
81 	uint16_t opr_id;
82 	uint16_t opr_vid;
83 };
84 
85 #endif /* __FSL_DPOPR_H_ */
86