b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From a0fd93952b6f0b408d96b29a0b9beb8bb2d8a24d Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@nxp.com> |
| 3 | Date: Wed, 10 Oct 2018 15:59:55 +0300 |
| 4 | Subject: [PATCH] soc: fsl: dpio: add support for opr |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Order preservation is a feature that will be supported |
| 10 | in dpni, dpseci and dpci devices. |
| 11 | This is a preliminary patch for the changes to be |
| 12 | introduced in the corresponding drivers. |
| 13 | |
| 14 | Signed-off-by: Radu Alexe <radu.alexe@nxp.com> |
| 15 | Signed-off-by: Horia Geantă <horia.geanta@nxp.com> |
| 16 | --- |
| 17 | include/soc/fsl/dpaa2-global.h | 74 ++++++++++++++++++++++++++++++++++++++++++ |
| 18 | 1 file changed, 74 insertions(+) |
| 19 | |
| 20 | --- a/include/soc/fsl/dpaa2-global.h |
| 21 | +++ b/include/soc/fsl/dpaa2-global.h |
| 22 | @@ -189,4 +189,78 @@ static inline bool dpaa2_cscn_state_cong |
| 23 | return !!(cscn->scn.state & DPAA2_CSCN_STATE_CG); |
| 24 | } |
| 25 | |
| 26 | +/* Data Path Order Restoration API |
| 27 | + * Contains initialization APIs and runtime APIs for the Order Restoration |
| 28 | + */ |
| 29 | + |
| 30 | +/** Order Restoration properties */ |
| 31 | + |
| 32 | +/** |
| 33 | + * Create a new Order Point Record option |
| 34 | + */ |
| 35 | +#define OPR_OPT_CREATE 0x1 |
| 36 | +/** |
| 37 | + * Retire an existing Order Point Record option |
| 38 | + */ |
| 39 | +#define OPR_OPT_RETIRE 0x2 |
| 40 | + |
| 41 | +/** |
| 42 | + * struct opr_cfg - Structure representing OPR configuration |
| 43 | + * @oprrws: Order point record (OPR) restoration window size (0 to 5) |
| 44 | + * 0 - Window size is 32 frames. |
| 45 | + * 1 - Window size is 64 frames. |
| 46 | + * 2 - Window size is 128 frames. |
| 47 | + * 3 - Window size is 256 frames. |
| 48 | + * 4 - Window size is 512 frames. |
| 49 | + * 5 - Window size is 1024 frames. |
| 50 | + * @oa: OPR auto advance NESN window size (0 disabled, 1 enabled) |
| 51 | + * @olws: OPR acceptable late arrival window size (0 to 3) |
| 52 | + * 0 - Disabled. Late arrivals are always rejected. |
| 53 | + * 1 - Window size is 32 frames. |
| 54 | + * 2 - Window size is the same as the OPR restoration |
| 55 | + * window size configured in the OPRRWS field. |
| 56 | + * 3 - Window size is 8192 frames. Late arrivals are |
| 57 | + * always accepted. |
| 58 | + * @oeane: Order restoration list (ORL) resource exhaustion |
| 59 | + * advance NESN enable (0 disabled, 1 enabled) |
| 60 | + * @oloe: OPR loose ordering enable (0 disabled, 1 enabled) |
| 61 | + */ |
| 62 | +struct opr_cfg { |
| 63 | + u8 oprrws; |
| 64 | + u8 oa; |
| 65 | + u8 olws; |
| 66 | + u8 oeane; |
| 67 | + u8 oloe; |
| 68 | +}; |
| 69 | + |
| 70 | +/** |
| 71 | + * struct opr_qry - Structure representing OPR configuration |
| 72 | + * @enable: Enabled state |
| 73 | + * @rip: Retirement In Progress |
| 74 | + * @ndsn: Next dispensed sequence number |
| 75 | + * @nesn: Next expected sequence number |
| 76 | + * @ea_hseq: Early arrival head sequence number |
| 77 | + * @hseq_nlis: HSEQ not last in sequence |
| 78 | + * @ea_tseq: Early arrival tail sequence number |
| 79 | + * @tseq_nlis: TSEQ not last in sequence |
| 80 | + * @ea_tptr: Early arrival tail pointer |
| 81 | + * @ea_hptr: Early arrival head pointer |
| 82 | + * @opr_id: Order Point Record ID |
| 83 | + * @opr_vid: Order Point Record Virtual ID |
| 84 | + */ |
| 85 | +struct opr_qry { |
| 86 | + char enable; |
| 87 | + char rip; |
| 88 | + u16 ndsn; |
| 89 | + u16 nesn; |
| 90 | + u16 ea_hseq; |
| 91 | + char hseq_nlis; |
| 92 | + u16 ea_tseq; |
| 93 | + char tseq_nlis; |
| 94 | + u16 ea_tptr; |
| 95 | + u16 ea_hptr; |
| 96 | + u16 opr_id; |
| 97 | + u16 opr_vid; |
| 98 | +}; |
| 99 | + |
| 100 | #endif /* __FSL_DPAA2_GLOBAL_H */ |