xref: /dpdk/drivers/bus/fslmc/mc/fsl_dpopr.h (revision 2cb2abf304fcecc0e2804b8da61760d4f2cb9a7e)
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  *
3  * Copyright 2013-2015 Freescale Semiconductor Inc.
4  * Copyright 2018-2021 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  * Assign an existing Order Point Record to a queue
27  */
28 #define OPR_OPT_ASSIGN 0x4
29 /**
30  * struct opr_cfg - Structure representing OPR configuration
31  * @oprrws: Order point record (OPR) restoration window size (0 to 5)
32  *			0 - Window size is 32 frames.
33  *			1 - Window size is 64 frames.
34  *			2 - Window size is 128 frames.
35  *			3 - Window size is 256 frames.
36  *			4 - Window size is 512 frames.
37  *			5 - Window size is 1024 frames.
38  *@oa: OPR auto advance NESN window size (0 disabled, 1 enabled)
39  *@olws: OPR acceptable late arrival window size (0 to 3)
40  *			0 - Disabled. Late arrivals are always rejected.
41  *			1 - Window size is 32 frames.
42  *			2 - Window size is the same as the OPR restoration
43  *			window size configured in the OPRRWS field.
44  *			3 - Window size is 8192 frames.
45  *			Late arrivals are always accepted.
46  *@oeane: Order restoration list (ORL) resource exhaustion
47  *			advance NESN enable (0 disabled, 1 enabled)
48  *@oloe: OPR loose ordering enable (0 disabled, 1 enabled)
49  */
50 struct opr_cfg {
51 	uint8_t oprrws;
52 	uint8_t oa;
53 	uint8_t olws;
54 	uint8_t oeane;
55 	uint8_t oloe;
56 };
57 
58 /**
59  * struct opr_qry - Structure representing OPR configuration
60  * @enable: Enabled state
61  * @rip: Retirement In Progress
62  * @ndsn: Next dispensed sequence number
63  * @nesn: Next expected sequence number
64  * @ea_hseq: Early arrival head sequence number
65  * @hseq_nlis: HSEQ not last in sequence
66  * @ea_tseq: Early arrival tail sequence number
67  * @tseq_nlis: TSEQ not last in sequence
68  * @ea_tptr: Early arrival tail pointer
69  * @ea_hptr: Early arrival head pointer
70  * @opr_id: Order Point Record ID
71  * @opr_vid: Order Point Record Virtual ID
72  */
73 struct opr_qry {
74 	char enable;
75 	char rip;
76 	uint16_t ndsn;
77 	uint16_t nesn;
78 	uint16_t ea_hseq;
79 	char hseq_nlis;
80 	uint16_t ea_tseq;
81 	char tseq_nlis;
82 	uint16_t ea_tptr;
83 	uint16_t ea_hptr;
84 	uint16_t opr_id;
85 	uint16_t opr_vid;
86 };
87 
88 #endif /* __FSL_DPOPR_H_ */
89