Commit 53e353fc3e52ae8161d3977aac655f551a56a3a1
Committed by
York Sun
1 parent
9a696f56fc
Exists in
v2017.01-smarct4x
and in
30 other branches
driver: net: fsl-mc: flib changes for MC FW 9.0.0
MC firmware version 9.0.0 contains - Support of new APIs - Update in existing APIs - Change in Major and minor version of DPAA2 objects This patch contains modifications in FLIB files to support new MC firmware version. Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com> Reviewed-by: York Sun <york.sun@nxp.com>
Showing 9 changed files with 565 additions and 169 deletions Side-by-side Diff
drivers/net/fsl-mc/dpni.c
... | ... | @@ -8,6 +8,26 @@ |
8 | 8 | #include <fsl-mc/fsl_mc_cmd.h> |
9 | 9 | #include <fsl-mc/fsl_dpni.h> |
10 | 10 | |
11 | +int dpni_prepare_extended_cfg(const struct dpni_extended_cfg *cfg, | |
12 | + uint8_t *ext_cfg_buf) | |
13 | +{ | |
14 | + uint64_t *ext_params = (uint64_t *)ext_cfg_buf; | |
15 | + | |
16 | + DPNI_PREP_EXTENDED_CFG(ext_params, cfg); | |
17 | + | |
18 | + return 0; | |
19 | +} | |
20 | + | |
21 | +int dpni_extract_extended_cfg(struct dpni_extended_cfg *cfg, | |
22 | + const uint8_t *ext_cfg_buf) | |
23 | +{ | |
24 | + uint64_t *ext_params = (uint64_t *)ext_cfg_buf; | |
25 | + | |
26 | + DPNI_EXT_EXTENDED_CFG(ext_params, cfg); | |
27 | + | |
28 | + return 0; | |
29 | +} | |
30 | + | |
11 | 31 | int dpni_open(struct fsl_mc_io *mc_io, |
12 | 32 | uint32_t cmd_flags, |
13 | 33 | int dpni_id, |
... | ... | @@ -162,6 +182,7 @@ |
162 | 182 | cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_ATTR, |
163 | 183 | cmd_flags, |
164 | 184 | token); |
185 | + DPNI_CMD_GET_ATTR(cmd, attr); | |
165 | 186 | |
166 | 187 | /* send command to mc*/ |
167 | 188 | err = mc_send_command(mc_io, &cmd); |
... | ... | @@ -174,6 +195,23 @@ |
174 | 195 | return 0; |
175 | 196 | } |
176 | 197 | |
198 | +int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, | |
199 | + uint32_t cmd_flags, | |
200 | + uint16_t token, | |
201 | + struct dpni_error_cfg *cfg) | |
202 | +{ | |
203 | + struct mc_command cmd = { 0 }; | |
204 | + | |
205 | + /* prepare command */ | |
206 | + cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_ERRORS_BEHAVIOR, | |
207 | + cmd_flags, | |
208 | + token); | |
209 | + DPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg); | |
210 | + | |
211 | + /* send command to mc*/ | |
212 | + return mc_send_command(mc_io, &cmd); | |
213 | +} | |
214 | + | |
177 | 215 | int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io, |
178 | 216 | uint32_t cmd_flags, |
179 | 217 | uint16_t token, |
... | ... | @@ -599,6 +637,49 @@ |
599 | 637 | |
600 | 638 | /* retrieve response parameters */ |
601 | 639 | DPNI_RSP_GET_RX_FLOW(cmd, attr); |
640 | + | |
641 | + return 0; | |
642 | +} | |
643 | + | |
644 | +int dpni_set_tx_conf(struct fsl_mc_io *mc_io, | |
645 | + uint32_t cmd_flags, | |
646 | + uint16_t token, | |
647 | + uint16_t flow_id, | |
648 | + const struct dpni_tx_conf_cfg *cfg) | |
649 | +{ | |
650 | + struct mc_command cmd = { 0 }; | |
651 | + | |
652 | + /* prepare command */ | |
653 | + cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_CONF, | |
654 | + cmd_flags, | |
655 | + token); | |
656 | + DPNI_CMD_SET_TX_CONF(cmd, flow_id, cfg); | |
657 | + | |
658 | + /* send command to mc*/ | |
659 | + return mc_send_command(mc_io, &cmd); | |
660 | +} | |
661 | + | |
662 | +int dpni_get_tx_conf(struct fsl_mc_io *mc_io, | |
663 | + uint32_t cmd_flags, | |
664 | + uint16_t token, | |
665 | + uint16_t flow_id, | |
666 | + struct dpni_tx_conf_attr *attr) | |
667 | +{ | |
668 | + struct mc_command cmd = { 0 }; | |
669 | + int err; | |
670 | + | |
671 | + /* prepare command */ | |
672 | + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_CONF, | |
673 | + cmd_flags, | |
674 | + token); | |
675 | + DPNI_CMD_GET_TX_CONF(cmd, flow_id); | |
676 | + | |
677 | + /* send command to mc*/ | |
678 | + err = mc_send_command(mc_io, &cmd); | |
679 | + if (err) | |
680 | + return err; | |
681 | + | |
682 | + DPNI_RSP_GET_TX_CONF(cmd, attr); | |
602 | 683 | |
603 | 684 | return 0; |
604 | 685 | } |
drivers/net/ldpaa_eth/ldpaa_eth.c
... | ... | @@ -798,9 +798,7 @@ |
798 | 798 | priv->tx_flow_id = DPNI_NEW_FLOW_ID; |
799 | 799 | memset(&dflt_tx_flow, 0, sizeof(dflt_tx_flow)); |
800 | 800 | |
801 | - dflt_tx_flow.options = DPNI_TX_FLOW_OPT_ONLY_TX_ERROR; | |
802 | - dflt_tx_flow.conf_err_cfg.use_default_queue = 0; | |
803 | - dflt_tx_flow.conf_err_cfg.errors_only = 1; | |
801 | + dflt_tx_flow.use_common_tx_conf_queue = 0; | |
804 | 802 | err = dpni_set_tx_flow(dflt_mc_io, MC_CMD_NO_FLAGS, |
805 | 803 | dflt_dpni->dpni_handle, &priv->tx_flow_id, |
806 | 804 | &dflt_tx_flow); |
include/fsl-mc/fsl_dpbp.h
include/fsl-mc/fsl_dpio.h
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | |
10 | 10 | /* DPIO Version */ |
11 | 11 | #define DPIO_VER_MAJOR 3 |
12 | -#define DPIO_VER_MINOR 1 | |
12 | +#define DPIO_VER_MINOR 2 | |
13 | 13 | |
14 | 14 | /* Command IDs */ |
15 | 15 | #define DPIO_CMDID_CLOSE 0x800 |
... | ... | @@ -45,6 +45,7 @@ |
45 | 45 | MC_RSP_OP(cmd, 2, 0, 64, uint64_t, attr->qbman_portal_ci_offset);\ |
46 | 46 | MC_RSP_OP(cmd, 3, 0, 16, uint16_t, attr->version.major);\ |
47 | 47 | MC_RSP_OP(cmd, 3, 16, 16, uint16_t, attr->version.minor);\ |
48 | + MC_RSP_OP(cmd, 3, 32, 32, uint32_t, attr->qbman_version);\ | |
48 | 49 | } while (0) |
49 | 50 | |
50 | 51 | /* Data Path I/O Portal API |
... | ... | @@ -195,6 +196,7 @@ |
195 | 196 | * @channel_mode: Notification channel mode |
196 | 197 | * @num_priorities: Number of priorities for the notification channel (1-8); |
197 | 198 | * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL' |
199 | + * @qbman_version: QBMAN version | |
198 | 200 | */ |
199 | 201 | struct dpio_attr { |
200 | 202 | int id; |
... | ... | @@ -212,6 +214,7 @@ |
212 | 214 | uint16_t qbman_portal_id; |
213 | 215 | enum dpio_channel_mode channel_mode; |
214 | 216 | uint8_t num_priorities; |
217 | + uint32_t qbman_version; | |
215 | 218 | }; |
216 | 219 | |
217 | 220 | /** |
include/fsl-mc/fsl_dpmac.h
include/fsl-mc/fsl_dpmng.h
include/fsl-mc/fsl_dpni.h
... | ... | @@ -7,8 +7,8 @@ |
7 | 7 | #define _FSL_DPNI_H |
8 | 8 | |
9 | 9 | /* DPNI Version */ |
10 | -#define DPNI_VER_MAJOR 5 | |
11 | -#define DPNI_VER_MINOR 1 | |
10 | +#define DPNI_VER_MAJOR 6 | |
11 | +#define DPNI_VER_MINOR 0 | |
12 | 12 | |
13 | 13 | /* Command IDs */ |
14 | 14 | #define DPNI_CMDID_OPEN 0x801 |
... | ... | @@ -28,6 +28,7 @@ |
28 | 28 | #define DPNI_CMDID_SET_TX_BUFFER_LAYOUT 0x204 |
29 | 29 | #define DPNI_CMDID_SET_TX_CONF_BUFFER_LAYOUT 0x205 |
30 | 30 | #define DPNI_CMDID_GET_TX_CONF_BUFFER_LAYOUT 0x206 |
31 | +#define DPNI_CMDID_SET_ERRORS_BEHAVIOR 0x20B | |
31 | 32 | |
32 | 33 | #define DPNI_CMDID_GET_QDID 0x210 |
33 | 34 | #define DPNI_CMDID_GET_TX_DATA_OFFSET 0x212 |
34 | 35 | |
... | ... | @@ -45,11 +46,73 @@ |
45 | 46 | #define DPNI_CMDID_GET_TX_FLOW 0x237 |
46 | 47 | #define DPNI_CMDID_SET_RX_FLOW 0x238 |
47 | 48 | #define DPNI_CMDID_GET_RX_FLOW 0x239 |
49 | +#define DPNI_CMDID_SET_TX_CONF 0x257 | |
50 | +#define DPNI_CMDID_GET_TX_CONF 0x258 | |
48 | 51 | |
49 | 52 | /* cmd, param, offset, width, type, arg_name */ |
50 | 53 | #define DPNI_CMD_OPEN(cmd, dpni_id) \ |
51 | 54 | MC_CMD_OP(cmd, 0, 0, 32, int, dpni_id) |
52 | 55 | |
56 | +#define DPNI_PREP_EXTENDED_CFG(ext, cfg) \ | |
57 | +do { \ | |
58 | + MC_PREP_OP(ext, 0, 0, 16, uint16_t, cfg->tc_cfg[0].max_dist); \ | |
59 | + MC_PREP_OP(ext, 0, 16, 16, uint16_t, cfg->tc_cfg[0].max_fs_entries); \ | |
60 | + MC_PREP_OP(ext, 0, 32, 16, uint16_t, cfg->tc_cfg[1].max_dist); \ | |
61 | + MC_PREP_OP(ext, 0, 48, 16, uint16_t, cfg->tc_cfg[1].max_fs_entries); \ | |
62 | + MC_PREP_OP(ext, 1, 0, 16, uint16_t, cfg->tc_cfg[2].max_dist); \ | |
63 | + MC_PREP_OP(ext, 1, 16, 16, uint16_t, cfg->tc_cfg[2].max_fs_entries); \ | |
64 | + MC_PREP_OP(ext, 1, 32, 16, uint16_t, cfg->tc_cfg[3].max_dist); \ | |
65 | + MC_PREP_OP(ext, 1, 48, 16, uint16_t, cfg->tc_cfg[3].max_fs_entries); \ | |
66 | + MC_PREP_OP(ext, 2, 0, 16, uint16_t, cfg->tc_cfg[4].max_dist); \ | |
67 | + MC_PREP_OP(ext, 2, 16, 16, uint16_t, cfg->tc_cfg[4].max_fs_entries); \ | |
68 | + MC_PREP_OP(ext, 2, 32, 16, uint16_t, cfg->tc_cfg[5].max_dist); \ | |
69 | + MC_PREP_OP(ext, 2, 48, 16, uint16_t, cfg->tc_cfg[5].max_fs_entries); \ | |
70 | + MC_PREP_OP(ext, 3, 0, 16, uint16_t, cfg->tc_cfg[6].max_dist); \ | |
71 | + MC_PREP_OP(ext, 3, 16, 16, uint16_t, cfg->tc_cfg[6].max_fs_entries); \ | |
72 | + MC_PREP_OP(ext, 3, 32, 16, uint16_t, cfg->tc_cfg[7].max_dist); \ | |
73 | + MC_PREP_OP(ext, 3, 48, 16, uint16_t, cfg->tc_cfg[7].max_fs_entries); \ | |
74 | + MC_PREP_OP(ext, 4, 0, 16, uint16_t, \ | |
75 | + cfg->ipr_cfg.max_open_frames_ipv4); \ | |
76 | + MC_PREP_OP(ext, 4, 16, 16, uint16_t, \ | |
77 | + cfg->ipr_cfg.max_open_frames_ipv6); \ | |
78 | + MC_PREP_OP(ext, 4, 32, 16, uint16_t, \ | |
79 | + cfg->ipr_cfg.max_reass_frm_size); \ | |
80 | + MC_PREP_OP(ext, 5, 0, 16, uint16_t, \ | |
81 | + cfg->ipr_cfg.min_frag_size_ipv4); \ | |
82 | + MC_PREP_OP(ext, 5, 16, 16, uint16_t, \ | |
83 | + cfg->ipr_cfg.min_frag_size_ipv6); \ | |
84 | +} while (0) | |
85 | + | |
86 | +#define DPNI_EXT_EXTENDED_CFG(ext, cfg) \ | |
87 | +do { \ | |
88 | + MC_EXT_OP(ext, 0, 0, 16, uint16_t, cfg->tc_cfg[0].max_dist); \ | |
89 | + MC_EXT_OP(ext, 0, 16, 16, uint16_t, cfg->tc_cfg[0].max_fs_entries); \ | |
90 | + MC_EXT_OP(ext, 0, 32, 16, uint16_t, cfg->tc_cfg[1].max_dist); \ | |
91 | + MC_EXT_OP(ext, 0, 48, 16, uint16_t, cfg->tc_cfg[1].max_fs_entries); \ | |
92 | + MC_EXT_OP(ext, 1, 0, 16, uint16_t, cfg->tc_cfg[2].max_dist); \ | |
93 | + MC_EXT_OP(ext, 1, 16, 16, uint16_t, cfg->tc_cfg[2].max_fs_entries); \ | |
94 | + MC_EXT_OP(ext, 1, 32, 16, uint16_t, cfg->tc_cfg[3].max_dist); \ | |
95 | + MC_EXT_OP(ext, 1, 48, 16, uint16_t, cfg->tc_cfg[3].max_fs_entries); \ | |
96 | + MC_EXT_OP(ext, 2, 0, 16, uint16_t, cfg->tc_cfg[4].max_dist); \ | |
97 | + MC_EXT_OP(ext, 2, 16, 16, uint16_t, cfg->tc_cfg[4].max_fs_entries); \ | |
98 | + MC_EXT_OP(ext, 2, 32, 16, uint16_t, cfg->tc_cfg[5].max_dist); \ | |
99 | + MC_EXT_OP(ext, 2, 48, 16, uint16_t, cfg->tc_cfg[5].max_fs_entries); \ | |
100 | + MC_EXT_OP(ext, 3, 0, 16, uint16_t, cfg->tc_cfg[6].max_dist); \ | |
101 | + MC_EXT_OP(ext, 3, 16, 16, uint16_t, cfg->tc_cfg[6].max_fs_entries); \ | |
102 | + MC_EXT_OP(ext, 3, 32, 16, uint16_t, cfg->tc_cfg[7].max_dist); \ | |
103 | + MC_EXT_OP(ext, 3, 48, 16, uint16_t, cfg->tc_cfg[7].max_fs_entries); \ | |
104 | + MC_EXT_OP(ext, 4, 0, 16, uint16_t, \ | |
105 | + cfg->ipr_cfg.max_open_frames_ipv4); \ | |
106 | + MC_EXT_OP(ext, 4, 16, 16, uint16_t, \ | |
107 | + cfg->ipr_cfg.max_open_frames_ipv6); \ | |
108 | + MC_EXT_OP(ext, 4, 32, 16, uint16_t, \ | |
109 | + cfg->ipr_cfg.max_reass_frm_size); \ | |
110 | + MC_EXT_OP(ext, 5, 0, 16, uint16_t, \ | |
111 | + cfg->ipr_cfg.min_frag_size_ipv4); \ | |
112 | + MC_EXT_OP(ext, 5, 16, 16, uint16_t, \ | |
113 | + cfg->ipr_cfg.min_frag_size_ipv6); \ | |
114 | +} while (0) | |
115 | + | |
53 | 116 | /* cmd, param, offset, width, type, arg_name */ |
54 | 117 | #define DPNI_CMD_CREATE(cmd, cfg) \ |
55 | 118 | do { \ |
56 | 119 | |
57 | 120 | |
... | ... | @@ -69,32 +132,23 @@ |
69 | 132 | MC_CMD_OP(cmd, 2, 32, 8, uint8_t, cfg->adv.max_qos_key_size); \ |
70 | 133 | MC_CMD_OP(cmd, 2, 48, 8, uint8_t, cfg->adv.max_dist_key_size); \ |
71 | 134 | MC_CMD_OP(cmd, 2, 56, 8, enum net_prot, cfg->adv.start_hdr); \ |
72 | - MC_CMD_OP(cmd, 3, 0, 8, uint8_t, cfg->adv.max_dist_per_tc[0]); \ | |
73 | - MC_CMD_OP(cmd, 3, 8, 8, uint8_t, cfg->adv.max_dist_per_tc[1]); \ | |
74 | - MC_CMD_OP(cmd, 3, 16, 8, uint8_t, cfg->adv.max_dist_per_tc[2]); \ | |
75 | - MC_CMD_OP(cmd, 3, 24, 8, uint8_t, cfg->adv.max_dist_per_tc[3]); \ | |
76 | - MC_CMD_OP(cmd, 3, 32, 8, uint8_t, cfg->adv.max_dist_per_tc[4]); \ | |
77 | - MC_CMD_OP(cmd, 3, 40, 8, uint8_t, cfg->adv.max_dist_per_tc[5]); \ | |
78 | - MC_CMD_OP(cmd, 3, 48, 8, uint8_t, cfg->adv.max_dist_per_tc[6]); \ | |
79 | - MC_CMD_OP(cmd, 3, 56, 8, uint8_t, cfg->adv.max_dist_per_tc[7]); \ | |
80 | - MC_CMD_OP(cmd, 4, 0, 16, uint16_t, \ | |
81 | - cfg->adv.ipr_cfg.max_reass_frm_size); \ | |
82 | - MC_CMD_OP(cmd, 4, 16, 16, uint16_t, \ | |
83 | - cfg->adv.ipr_cfg.min_frag_size_ipv4); \ | |
84 | - MC_CMD_OP(cmd, 4, 32, 16, uint16_t, \ | |
85 | - cfg->adv.ipr_cfg.min_frag_size_ipv6); \ | |
86 | 135 | MC_CMD_OP(cmd, 4, 48, 8, uint8_t, cfg->adv.max_policers); \ |
87 | 136 | MC_CMD_OP(cmd, 4, 56, 8, uint8_t, cfg->adv.max_congestion_ctrl); \ |
88 | - MC_CMD_OP(cmd, 5, 0, 16, uint16_t, \ | |
89 | - cfg->adv.ipr_cfg.max_open_frames_ipv4); \ | |
90 | - MC_CMD_OP(cmd, 5, 16, 16, uint16_t, \ | |
91 | - cfg->adv.ipr_cfg.max_open_frames_ipv6); \ | |
137 | + MC_CMD_OP(cmd, 5, 0, 64, uint64_t, cfg->adv.ext_cfg_iova); \ | |
92 | 138 | } while (0) |
93 | 139 | |
94 | 140 | /* cmd, param, offset, width, type, arg_name */ |
95 | 141 | #define DPNI_CMD_SET_POOLS(cmd, cfg) \ |
96 | 142 | do { \ |
97 | 143 | MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->num_dpbp); \ |
144 | + MC_CMD_OP(cmd, 0, 8, 1, int, cfg->pools[0].backup_pool); \ | |
145 | + MC_CMD_OP(cmd, 0, 9, 1, int, cfg->pools[1].backup_pool); \ | |
146 | + MC_CMD_OP(cmd, 0, 10, 1, int, cfg->pools[2].backup_pool); \ | |
147 | + MC_CMD_OP(cmd, 0, 11, 1, int, cfg->pools[3].backup_pool); \ | |
148 | + MC_CMD_OP(cmd, 0, 12, 1, int, cfg->pools[4].backup_pool); \ | |
149 | + MC_CMD_OP(cmd, 0, 13, 1, int, cfg->pools[5].backup_pool); \ | |
150 | + MC_CMD_OP(cmd, 0, 14, 1, int, cfg->pools[6].backup_pool); \ | |
151 | + MC_CMD_OP(cmd, 0, 15, 1, int, cfg->pools[7].backup_pool); \ | |
98 | 152 | MC_CMD_OP(cmd, 0, 32, 32, int, cfg->pools[0].dpbp_id); \ |
99 | 153 | MC_CMD_OP(cmd, 4, 32, 16, uint16_t, cfg->pools[0].buffer_size);\ |
100 | 154 | MC_CMD_OP(cmd, 1, 0, 32, int, cfg->pools[1].dpbp_id); \ |
... | ... | @@ -114,6 +168,10 @@ |
114 | 168 | } while (0) |
115 | 169 | |
116 | 170 | /* cmd, param, offset, width, type, arg_name */ |
171 | +#define DPNI_CMD_GET_ATTR(cmd, attr) \ | |
172 | + MC_CMD_OP(cmd, 6, 0, 64, uint64_t, attr->ext_cfg_iova) | |
173 | + | |
174 | +/* cmd, param, offset, width, type, arg_name */ | |
117 | 175 | #define DPNI_RSP_GET_ATTR(cmd, attr) \ |
118 | 176 | do { \ |
119 | 177 | MC_RSP_OP(cmd, 0, 0, 32, int, attr->id);\ |
120 | 178 | |
... | ... | @@ -127,31 +185,21 @@ |
127 | 185 | MC_RSP_OP(cmd, 2, 24, 8, uint8_t, attr->max_qos_entries); \ |
128 | 186 | MC_RSP_OP(cmd, 2, 32, 8, uint8_t, attr->max_qos_key_size); \ |
129 | 187 | MC_RSP_OP(cmd, 2, 40, 8, uint8_t, attr->max_dist_key_size); \ |
130 | - MC_RSP_OP(cmd, 3, 0, 8, uint8_t, attr->max_dist_per_tc[0]); \ | |
131 | - MC_RSP_OP(cmd, 3, 8, 8, uint8_t, attr->max_dist_per_tc[1]); \ | |
132 | - MC_RSP_OP(cmd, 3, 16, 8, uint8_t, attr->max_dist_per_tc[2]); \ | |
133 | - MC_RSP_OP(cmd, 3, 24, 8, uint8_t, attr->max_dist_per_tc[3]); \ | |
134 | - MC_RSP_OP(cmd, 3, 32, 8, uint8_t, attr->max_dist_per_tc[4]); \ | |
135 | - MC_RSP_OP(cmd, 3, 40, 8, uint8_t, attr->max_dist_per_tc[5]); \ | |
136 | - MC_RSP_OP(cmd, 3, 48, 8, uint8_t, attr->max_dist_per_tc[6]); \ | |
137 | - MC_RSP_OP(cmd, 3, 56, 8, uint8_t, attr->max_dist_per_tc[7]); \ | |
138 | - MC_RSP_OP(cmd, 4, 0, 16, uint16_t, \ | |
139 | - attr->ipr_cfg.max_reass_frm_size); \ | |
140 | - MC_RSP_OP(cmd, 4, 16, 16, uint16_t, \ | |
141 | - attr->ipr_cfg.min_frag_size_ipv4); \ | |
142 | - MC_RSP_OP(cmd, 4, 32, 16, uint16_t, \ | |
143 | - attr->ipr_cfg.min_frag_size_ipv6);\ | |
144 | - MC_RSP_OP(cmd, 4, 48, 8, uint8_t, attr->max_policers); \ | |
145 | - MC_RSP_OP(cmd, 4, 56, 8, uint8_t, attr->max_congestion_ctrl); \ | |
146 | - MC_RSP_OP(cmd, 5, 0, 16, uint16_t, \ | |
147 | - attr->ipr_cfg.max_open_frames_ipv4); \ | |
148 | - MC_RSP_OP(cmd, 5, 16, 16, uint16_t, \ | |
149 | - attr->ipr_cfg.max_open_frames_ipv6); \ | |
188 | + MC_RSP_OP(cmd, 4, 48, 8, uint8_t, attr->max_policers); \ | |
189 | + MC_RSP_OP(cmd, 4, 56, 8, uint8_t, attr->max_congestion_ctrl); \ | |
150 | 190 | MC_RSP_OP(cmd, 5, 32, 16, uint16_t, attr->version.major);\ |
151 | 191 | MC_RSP_OP(cmd, 5, 48, 16, uint16_t, attr->version.minor);\ |
152 | 192 | } while (0) |
153 | 193 | |
154 | 194 | /* cmd, param, offset, width, type, arg_name */ |
195 | +#define DPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg) \ | |
196 | +do { \ | |
197 | + MC_CMD_OP(cmd, 0, 0, 32, uint32_t, cfg->errors); \ | |
198 | + MC_CMD_OP(cmd, 0, 32, 4, enum dpni_error_action, cfg->error_action); \ | |
199 | + MC_CMD_OP(cmd, 0, 36, 1, int, cfg->set_frame_annotation); \ | |
200 | +} while (0) | |
201 | + | |
202 | +/* cmd, param, offset, width, type, arg_name */ | |
155 | 203 | #define DPNI_RSP_GET_RX_BUFFER_LAYOUT(cmd, layout) \ |
156 | 204 | do { \ |
157 | 205 | MC_RSP_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \ |
158 | 206 | |
159 | 207 | |
160 | 208 | |
... | ... | @@ -313,23 +361,11 @@ |
313 | 361 | /* cmd, param, offset, width, type, arg_name */ |
314 | 362 | #define DPNI_CMD_SET_TX_FLOW(cmd, flow_id, cfg) \ |
315 | 363 | do { \ |
316 | - MC_CMD_OP(cmd, 0, 0, 32, int, \ | |
317 | - cfg->conf_err_cfg.queue_cfg.dest_cfg.dest_id);\ | |
318 | - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, \ | |
319 | - cfg->conf_err_cfg.queue_cfg.dest_cfg.priority);\ | |
320 | - MC_CMD_OP(cmd, 0, 40, 2, enum dpni_dest, \ | |
321 | - cfg->conf_err_cfg.queue_cfg.dest_cfg.dest_type);\ | |
322 | - MC_CMD_OP(cmd, 0, 42, 1, int, cfg->conf_err_cfg.errors_only);\ | |
323 | 364 | MC_CMD_OP(cmd, 0, 43, 1, int, cfg->l3_chksum_gen);\ |
324 | 365 | MC_CMD_OP(cmd, 0, 44, 1, int, cfg->l4_chksum_gen);\ |
325 | - MC_CMD_OP(cmd, 0, 45, 1, int, \ | |
326 | - cfg->conf_err_cfg.use_default_queue);\ | |
366 | + MC_CMD_OP(cmd, 0, 45, 1, int, cfg->use_common_tx_conf_queue);\ | |
327 | 367 | MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id);\ |
328 | - MC_CMD_OP(cmd, 1, 0, 64, uint64_t, \ | |
329 | - cfg->conf_err_cfg.queue_cfg.user_ctx);\ | |
330 | 368 | MC_CMD_OP(cmd, 2, 0, 32, uint32_t, cfg->options);\ |
331 | - MC_CMD_OP(cmd, 2, 32, 32, uint32_t, \ | |
332 | - cfg->conf_err_cfg.queue_cfg.options);\ | |
333 | 369 | } while (0) |
334 | 370 | |
335 | 371 | /* cmd, param, offset, width, type, arg_name */ |
336 | 372 | |
... | ... | @@ -343,21 +379,9 @@ |
343 | 379 | /* cmd, param, offset, width, type, arg_name */ |
344 | 380 | #define DPNI_RSP_GET_TX_FLOW(cmd, attr) \ |
345 | 381 | do { \ |
346 | - MC_RSP_OP(cmd, 0, 0, 32, int, \ | |
347 | - attr->conf_err_attr.queue_attr.dest_cfg.dest_id);\ | |
348 | - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, \ | |
349 | - attr->conf_err_attr.queue_attr.dest_cfg.priority);\ | |
350 | - MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, \ | |
351 | - attr->conf_err_attr.queue_attr.dest_cfg.dest_type);\ | |
352 | - MC_RSP_OP(cmd, 0, 42, 1, int, attr->conf_err_attr.errors_only);\ | |
353 | 382 | MC_RSP_OP(cmd, 0, 43, 1, int, attr->l3_chksum_gen);\ |
354 | 383 | MC_RSP_OP(cmd, 0, 44, 1, int, attr->l4_chksum_gen);\ |
355 | - MC_RSP_OP(cmd, 0, 45, 1, int, \ | |
356 | - attr->conf_err_attr.use_default_queue);\ | |
357 | - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, \ | |
358 | - attr->conf_err_attr.queue_attr.user_ctx);\ | |
359 | - MC_RSP_OP(cmd, 2, 32, 32, uint32_t, \ | |
360 | - attr->conf_err_attr.queue_attr.fqid);\ | |
384 | + MC_RSP_OP(cmd, 0, 45, 1, int, attr->use_common_tx_conf_queue);\ | |
361 | 385 | } while (0) |
362 | 386 | |
363 | 387 | /* cmd, param, offset, width, type, arg_name */ |
... | ... | @@ -370,7 +394,7 @@ |
370 | 394 | MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id); \ |
371 | 395 | MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx); \ |
372 | 396 | MC_CMD_OP(cmd, 2, 16, 8, uint8_t, tc_id); \ |
373 | - MC_CMD_OP(cmd, 2, 32, 32, uint32_t, cfg->options); \ | |
397 | + MC_CMD_OP(cmd, 2, 32, 32, uint32_t, cfg->options); \ | |
374 | 398 | MC_CMD_OP(cmd, 3, 0, 4, enum dpni_flc_type, cfg->flc_cfg.flc_type); \ |
375 | 399 | MC_CMD_OP(cmd, 3, 4, 4, enum dpni_stash_size, \ |
376 | 400 | cfg->flc_cfg.frame_data_size);\ |
... | ... | @@ -378,6 +402,7 @@ |
378 | 402 | cfg->flc_cfg.flow_context_size);\ |
379 | 403 | MC_CMD_OP(cmd, 3, 32, 32, uint32_t, cfg->flc_cfg.options);\ |
380 | 404 | MC_CMD_OP(cmd, 4, 0, 64, uint64_t, cfg->flc_cfg.flow_context);\ |
405 | + MC_CMD_OP(cmd, 5, 0, 32, uint32_t, cfg->tail_drop_threshold); \ | |
381 | 406 | } while (0) |
382 | 407 | |
383 | 408 | /* cmd, param, offset, width, type, arg_name */ |
384 | 409 | |
... | ... | @@ -393,8 +418,9 @@ |
393 | 418 | MC_RSP_OP(cmd, 0, 0, 32, int, attr->dest_cfg.dest_id); \ |
394 | 419 | MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->dest_cfg.priority);\ |
395 | 420 | MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, attr->dest_cfg.dest_type); \ |
396 | - MC_CMD_OP(cmd, 0, 42, 1, int, attr->order_preservation_en);\ | |
421 | + MC_RSP_OP(cmd, 0, 42, 1, int, attr->order_preservation_en);\ | |
397 | 422 | MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->user_ctx); \ |
423 | + MC_RSP_OP(cmd, 2, 0, 32, uint32_t, attr->tail_drop_threshold); \ | |
398 | 424 | MC_RSP_OP(cmd, 2, 32, 32, uint32_t, attr->fqid); \ |
399 | 425 | MC_RSP_OP(cmd, 3, 0, 4, enum dpni_flc_type, attr->flc_cfg.flc_type); \ |
400 | 426 | MC_RSP_OP(cmd, 3, 4, 4, enum dpni_stash_size, \ |
... | ... | @@ -405,6 +431,58 @@ |
405 | 431 | MC_RSP_OP(cmd, 4, 0, 64, uint64_t, attr->flc_cfg.flow_context);\ |
406 | 432 | } while (0) |
407 | 433 | |
434 | +#define DPNI_CMD_SET_TX_CONF(cmd, flow_id, cfg) \ | |
435 | +do { \ | |
436 | + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->queue_cfg.dest_cfg.priority); \ | |
437 | + MC_CMD_OP(cmd, 0, 40, 2, enum dpni_dest, \ | |
438 | + cfg->queue_cfg.dest_cfg.dest_type); \ | |
439 | + MC_CMD_OP(cmd, 0, 42, 1, int, cfg->errors_only); \ | |
440 | + MC_CMD_OP(cmd, 0, 46, 1, int, cfg->queue_cfg.order_preservation_en); \ | |
441 | + MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id); \ | |
442 | + MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->queue_cfg.user_ctx); \ | |
443 | + MC_CMD_OP(cmd, 2, 0, 32, uint32_t, cfg->queue_cfg.options); \ | |
444 | + MC_CMD_OP(cmd, 2, 32, 32, int, cfg->queue_cfg.dest_cfg.dest_id); \ | |
445 | + MC_CMD_OP(cmd, 3, 0, 32, uint32_t, \ | |
446 | + cfg->queue_cfg.tail_drop_threshold); \ | |
447 | + MC_CMD_OP(cmd, 4, 0, 4, enum dpni_flc_type, \ | |
448 | + cfg->queue_cfg.flc_cfg.flc_type); \ | |
449 | + MC_CMD_OP(cmd, 4, 4, 4, enum dpni_stash_size, \ | |
450 | + cfg->queue_cfg.flc_cfg.frame_data_size); \ | |
451 | + MC_CMD_OP(cmd, 4, 8, 4, enum dpni_stash_size, \ | |
452 | + cfg->queue_cfg.flc_cfg.flow_context_size); \ | |
453 | + MC_CMD_OP(cmd, 4, 32, 32, uint32_t, cfg->queue_cfg.flc_cfg.options); \ | |
454 | + MC_CMD_OP(cmd, 5, 0, 64, uint64_t, \ | |
455 | + cfg->queue_cfg.flc_cfg.flow_context); \ | |
456 | +} while (0) | |
457 | + | |
458 | +#define DPNI_CMD_GET_TX_CONF(cmd, flow_id) \ | |
459 | + MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id) | |
460 | + | |
461 | +#define DPNI_RSP_GET_TX_CONF(cmd, attr) \ | |
462 | +do { \ | |
463 | + MC_RSP_OP(cmd, 0, 32, 8, uint8_t, \ | |
464 | + attr->queue_attr.dest_cfg.priority); \ | |
465 | + MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, \ | |
466 | + attr->queue_attr.dest_cfg.dest_type); \ | |
467 | + MC_RSP_OP(cmd, 0, 42, 1, int, attr->errors_only); \ | |
468 | + MC_RSP_OP(cmd, 0, 46, 1, int, \ | |
469 | + attr->queue_attr.order_preservation_en); \ | |
470 | + MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->queue_attr.user_ctx); \ | |
471 | + MC_RSP_OP(cmd, 2, 32, 32, int, attr->queue_attr.dest_cfg.dest_id); \ | |
472 | + MC_RSP_OP(cmd, 3, 0, 32, uint32_t, \ | |
473 | + attr->queue_attr.tail_drop_threshold); \ | |
474 | + MC_RSP_OP(cmd, 3, 32, 32, uint32_t, attr->queue_attr.fqid); \ | |
475 | + MC_RSP_OP(cmd, 4, 0, 4, enum dpni_flc_type, \ | |
476 | + attr->queue_attr.flc_cfg.flc_type); \ | |
477 | + MC_RSP_OP(cmd, 4, 4, 4, enum dpni_stash_size, \ | |
478 | + attr->queue_attr.flc_cfg.frame_data_size); \ | |
479 | + MC_RSP_OP(cmd, 4, 8, 4, enum dpni_stash_size, \ | |
480 | + attr->queue_attr.flc_cfg.flow_context_size); \ | |
481 | + MC_RSP_OP(cmd, 4, 32, 32, uint32_t, attr->queue_attr.flc_cfg.options); \ | |
482 | + MC_RSP_OP(cmd, 5, 0, 64, uint64_t, \ | |
483 | + attr->queue_attr.flc_cfg.flow_context); \ | |
484 | +} while (0) | |
485 | + | |
408 | 486 | enum net_prot { |
409 | 487 | NET_PROT_NONE = 0, |
410 | 488 | NET_PROT_PAYLOAD, |
... | ... | @@ -479,6 +557,8 @@ |
479 | 557 | #define DPNI_ALL_TC_FLOWS (uint16_t)(-1) |
480 | 558 | /* Generate new flow ID; see dpni_set_tx_flow() */ |
481 | 559 | #define DPNI_NEW_FLOW_ID (uint16_t)(-1) |
560 | +/* use for common tx-conf queue; see dpni_set_tx_conf_<x>() */ | |
561 | +#define DPNI_COMMON_TX_CONF (uint16_t)(-1) | |
482 | 562 | |
483 | 563 | /** |
484 | 564 | * dpni_open() - Open a control session for the specified object |
485 | 565 | |
486 | 566 | |
... | ... | @@ -565,22 +645,56 @@ |
565 | 645 | #define DPNI_OPT_FS_MASK_SUPPORT 0x00040000 |
566 | 646 | |
567 | 647 | /** |
568 | - * struct dpni_ipr_cfg - Structure representing IP reassembly configuration | |
569 | - * @max_reass_frm_size: Maximum size of the reassembled frame | |
570 | - * @min_frag_size_ipv4: Minimum fragment size of IPv4 fragments | |
571 | - * @min_frag_size_ipv6: Minimum fragment size of IPv6 fragments | |
572 | - * @max_open_frames_ipv4: Maximum concurrent IPv4 packets in reassembly process | |
573 | - * @max_open_frames_ipv6: Maximum concurrent IPv6 packets in reassembly process | |
648 | + * struct dpni_extended_cfg - Structure representing extended DPNI configuration | |
649 | + * @tc_cfg: TCs configuration | |
650 | + * @ipr_cfg: IP reassembly configuration | |
574 | 651 | */ |
575 | -struct dpni_ipr_cfg { | |
576 | - uint16_t max_reass_frm_size; | |
577 | - uint16_t min_frag_size_ipv4; | |
578 | - uint16_t min_frag_size_ipv6; | |
579 | - uint16_t max_open_frames_ipv4; | |
580 | - uint16_t max_open_frames_ipv6; | |
652 | +struct dpni_extended_cfg { | |
653 | + /** | |
654 | + * struct tc_cfg - TC configuration | |
655 | + * @max_dist: Maximum distribution size for Rx traffic class; | |
656 | + * supported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96, | |
657 | + * 112,128,192,224,256,384,448,512,768,896,1024; | |
658 | + * value '0' will be treated as '1'. | |
659 | + * other unsupported values will be round down to the nearest | |
660 | + * supported value. | |
661 | + * @max_fs_entries: Maximum FS entries for Rx traffic class; | |
662 | + * '0' means no support for this TC; | |
663 | + */ | |
664 | + struct { | |
665 | + uint16_t max_dist; | |
666 | + uint16_t max_fs_entries; | |
667 | + } tc_cfg[DPNI_MAX_TC]; | |
668 | + /** | |
669 | + * struct ipr_cfg - Structure representing IP reassembly configuration | |
670 | + * @max_reass_frm_size: Maximum size of the reassembled frame | |
671 | + * @min_frag_size_ipv4: Minimum fragment size of IPv4 fragments | |
672 | + * @min_frag_size_ipv6: Minimum fragment size of IPv6 fragments | |
673 | + * @max_open_frames_ipv4: Maximum concurrent IPv4 packets in reassembly | |
674 | + * process | |
675 | + * @max_open_frames_ipv6: Maximum concurrent IPv6 packets in reassembly | |
676 | + * process | |
677 | + */ | |
678 | + struct { | |
679 | + uint16_t max_reass_frm_size; | |
680 | + uint16_t min_frag_size_ipv4; | |
681 | + uint16_t min_frag_size_ipv6; | |
682 | + uint16_t max_open_frames_ipv4; | |
683 | + uint16_t max_open_frames_ipv6; | |
684 | + } ipr_cfg; | |
581 | 685 | }; |
582 | 686 | |
583 | 687 | /** |
688 | + * dpni_prepare_extended_cfg() - function prepare extended parameters | |
689 | + * @cfg: extended structure | |
690 | + * @ext_cfg_buf: Zeroed 256 bytes of memory before mapping it to DMA | |
691 | + * | |
692 | + * This function has to be called before dpni_create() | |
693 | + */ | |
694 | +int dpni_prepare_extended_cfg(const struct dpni_extended_cfg *cfg, | |
695 | + uint8_t *ext_cfg_buf); | |
696 | + | |
697 | +/** | |
584 | 698 | * struct dpni_cfg - Structure representing DPNI configuration |
585 | 699 | * @mac_addr: Primary MAC address |
586 | 700 | * @adv: Advanced parameters; default is all zeros; |
... | ... | @@ -599,11 +713,6 @@ |
599 | 713 | * '0' will be treated as '1' |
600 | 714 | * @max_tcs: Maximum number of traffic classes (for both Tx and Rx); |
601 | 715 | * '0' will e treated as '1' |
602 | - * @max_dist_per_tc: Maximum distribution size per Rx traffic class; | |
603 | - * Must be set to the required value minus 1; | |
604 | - * i.e. 0->1, 1->2, ... ,255->256; | |
605 | - * Non-power-of-2 values are rounded up to the next | |
606 | - * power-of-2 value as hardware demands it | |
607 | 716 | * @max_unicast_filters: Maximum number of unicast filters; |
608 | 717 | * '0' is treated as '16' |
609 | 718 | * @max_multicast_filters: Maximum number of multicast filters; |
610 | 719 | |
... | ... | @@ -619,16 +728,17 @@ |
619 | 728 | * should be between '0' and max_tcs |
620 | 729 | * @max_congestion_ctrl: Maximum number of congestion control groups |
621 | 730 | * (CGs); covers early drop and congestion notification |
622 | - * requirements for traffic classes; | |
623 | - * should be between '0' and max_tcs | |
624 | - * @ipr_cfg: IP reassembly configuration | |
731 | + * requirements; | |
732 | + * should be between '0' and ('max_tcs' + 'max_senders') | |
733 | + * @ext_cfg_iova: I/O virtual address of 256 bytes DMA-able memory | |
734 | + * filled with the extended configuration by calling | |
735 | + * dpni_prepare_extended_cfg() | |
625 | 736 | */ |
626 | 737 | struct { |
627 | 738 | uint32_t options; |
628 | 739 | enum net_prot start_hdr; |
629 | 740 | uint8_t max_senders; |
630 | 741 | uint8_t max_tcs; |
631 | - uint8_t max_dist_per_tc[DPNI_MAX_TC]; | |
632 | 742 | uint8_t max_unicast_filters; |
633 | 743 | uint8_t max_multicast_filters; |
634 | 744 | uint8_t max_vlan_filters; |
... | ... | @@ -637,7 +747,7 @@ |
637 | 747 | uint8_t max_dist_key_size; |
638 | 748 | uint8_t max_policers; |
639 | 749 | uint8_t max_congestion_ctrl; |
640 | - struct dpni_ipr_cfg ipr_cfg; | |
750 | + uint64_t ext_cfg_iova; | |
641 | 751 | } adv; |
642 | 752 | }; |
643 | 753 | |
... | ... | @@ -765,8 +875,6 @@ |
765 | 875 | * @max_senders: Maximum number of different senders; used as the number |
766 | 876 | * of dedicated Tx flows; |
767 | 877 | * @max_tcs: Maximum number of traffic classes (for both Tx and Rx) |
768 | - * @max_dist_per_tc: Maximum distribution size per Rx traffic class; | |
769 | - * Set to the required value minus 1 | |
770 | 878 | * @max_unicast_filters: Maximum number of unicast filters |
771 | 879 | * @max_multicast_filters: Maximum number of multicast filters |
772 | 880 | * @max_vlan_filters: Maximum number of VLAN filters |
... | ... | @@ -775,7 +883,8 @@ |
775 | 883 | * @max_dist_key_size: Maximum key size for the distribution look-up |
776 | 884 | * @max_policers: Maximum number of policers; |
777 | 885 | * @max_congestion_ctrl: Maximum number of congestion control groups (CGs); |
778 | - * @ipr_cfg: IP reassembly configuration | |
886 | + * @ext_cfg_iova: I/O virtual address of 256 bytes DMA-able memory; | |
887 | + * call dpni_extract_extended_cfg() to extract the extended configuration | |
779 | 888 | */ |
780 | 889 | struct dpni_attr { |
781 | 890 | int id; |
... | ... | @@ -792,7 +901,6 @@ |
792 | 901 | uint32_t options; |
793 | 902 | uint8_t max_senders; |
794 | 903 | uint8_t max_tcs; |
795 | - uint8_t max_dist_per_tc[DPNI_MAX_TC]; | |
796 | 904 | uint8_t max_unicast_filters; |
797 | 905 | uint8_t max_multicast_filters; |
798 | 906 | uint8_t max_vlan_filters; |
... | ... | @@ -801,7 +909,7 @@ |
801 | 909 | uint8_t max_dist_key_size; |
802 | 910 | uint8_t max_policers; |
803 | 911 | uint8_t max_congestion_ctrl; |
804 | - struct dpni_ipr_cfg ipr_cfg; | |
912 | + uint64_t ext_cfg_iova; | |
805 | 913 | }; |
806 | 914 | |
807 | 915 | /** |
... | ... | @@ -809,7 +917,7 @@ |
809 | 917 | * @mc_io: Pointer to MC portal's I/O object |
810 | 918 | * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' |
811 | 919 | * @token: Token of DPNI object |
812 | - * @attr: Returned object's attributes | |
920 | + * @attr: Object's attributes | |
813 | 921 | * |
814 | 922 | * Return: '0' on Success; Error code otherwise. |
815 | 923 | */ |
... | ... | @@ -818,6 +926,87 @@ |
818 | 926 | uint16_t token, |
819 | 927 | struct dpni_attr *attr); |
820 | 928 | |
929 | +/** | |
930 | + * dpni_extract_extended_cfg() - extract the extended parameters | |
931 | + * @cfg: extended structure | |
932 | + * @ext_cfg_buf: 256 bytes of DMA-able memory | |
933 | + * | |
934 | + * This function has to be called after dpni_get_attributes() | |
935 | + */ | |
936 | +int dpni_extract_extended_cfg(struct dpni_extended_cfg *cfg, | |
937 | + const uint8_t *ext_cfg_buf); | |
938 | + | |
939 | +/** | |
940 | + * DPNI errors | |
941 | + */ | |
942 | + | |
943 | +/** | |
944 | + * Extract out of frame header error | |
945 | + */ | |
946 | +#define DPNI_ERROR_EOFHE 0x00020000 | |
947 | +/** | |
948 | + * Frame length error | |
949 | + */ | |
950 | +#define DPNI_ERROR_FLE 0x00002000 | |
951 | +/** | |
952 | + * Frame physical error | |
953 | + */ | |
954 | +#define DPNI_ERROR_FPE 0x00001000 | |
955 | +/** | |
956 | + * Parsing header error | |
957 | + */ | |
958 | +#define DPNI_ERROR_PHE 0x00000020 | |
959 | +/** | |
960 | + * Parser L3 checksum error | |
961 | + */ | |
962 | +#define DPNI_ERROR_L3CE 0x00000004 | |
963 | +/** | |
964 | + * Parser L3 checksum error | |
965 | + */ | |
966 | +#define DPNI_ERROR_L4CE 0x00000001 | |
967 | + | |
968 | +/** | |
969 | + * enum dpni_error_action - Defines DPNI behavior for errors | |
970 | + * @DPNI_ERROR_ACTION_DISCARD: Discard the frame | |
971 | + * @DPNI_ERROR_ACTION_CONTINUE: Continue with the normal flow | |
972 | + * @DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE: Send the frame to the error queue | |
973 | + */ | |
974 | +enum dpni_error_action { | |
975 | + DPNI_ERROR_ACTION_DISCARD = 0, | |
976 | + DPNI_ERROR_ACTION_CONTINUE = 1, | |
977 | + DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE = 2 | |
978 | +}; | |
979 | + | |
980 | +/** | |
981 | + * struct dpni_error_cfg - Structure representing DPNI errors treatment | |
982 | + * @errors: Errors mask; use 'DPNI_ERROR__<X> | |
983 | + * @error_action: The desired action for the errors mask | |
984 | + * @set_frame_annotation: Set to '1' to mark the errors in frame annotation | |
985 | + * status (FAS); relevant only for the non-discard action | |
986 | + */ | |
987 | +struct dpni_error_cfg { | |
988 | + uint32_t errors; | |
989 | + enum dpni_error_action error_action; | |
990 | + int set_frame_annotation; | |
991 | +}; | |
992 | + | |
993 | +/** | |
994 | + * dpni_set_errors_behavior() - Set errors behavior | |
995 | + * @mc_io: Pointer to MC portal's I/O object | |
996 | + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' | |
997 | + * @token: Token of DPNI object | |
998 | + * @cfg: Errors configuration | |
999 | + * | |
1000 | + * this function may be called numerous times with different | |
1001 | + * error masks | |
1002 | + * | |
1003 | + * Return: '0' on Success; Error code otherwise. | |
1004 | + */ | |
1005 | +int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, | |
1006 | + uint32_t cmd_flags, | |
1007 | + uint16_t token, | |
1008 | + struct dpni_error_cfg *cfg); | |
1009 | + | |
821 | 1010 | /* DPNI buffer layout modification options */ |
822 | 1011 | |
823 | 1012 | /* Select to modify the time-stamp setting */ |
... | ... | @@ -1254,6 +1443,8 @@ |
1254 | 1443 | #define DPNI_QUEUE_OPT_FLC 0x00000004 |
1255 | 1444 | /* Select to modify the queue's order preservation */ |
1256 | 1445 | #define DPNI_QUEUE_OPT_ORDER_PRESERVATION 0x00000008 |
1446 | +/* Select to modify the queue's tail-drop threshold */ | |
1447 | +#define DPNI_QUEUE_OPT_TAILDROP_THRESHOLD 0x00000010 | |
1257 | 1448 | |
1258 | 1449 | /** |
1259 | 1450 | * struct dpni_queue_cfg - Structure representing queue configuration |
... | ... | @@ -1272,6 +1463,10 @@ |
1272 | 1463 | * @order_preservation_en: enable/disable order preservation; |
1273 | 1464 | * valid only if 'DPNI_QUEUE_OPT_ORDER_PRESERVATION' is contained |
1274 | 1465 | * in 'options' |
1466 | + * @tail_drop_threshold: set the queue's tail drop threshold in bytes; | |
1467 | + * '0' value disable the threshold; maximum value is 0xE000000; | |
1468 | + * valid only if 'DPNI_QUEUE_OPT_TAILDROP_THRESHOLD' is contained | |
1469 | + * in 'options' | |
1275 | 1470 | */ |
1276 | 1471 | struct dpni_queue_cfg { |
1277 | 1472 | uint32_t options; |
... | ... | @@ -1279,6 +1474,7 @@ |
1279 | 1474 | struct dpni_dest_cfg dest_cfg; |
1280 | 1475 | struct dpni_flc_cfg flc_cfg; |
1281 | 1476 | int order_preservation_en; |
1477 | + uint32_t tail_drop_threshold; | |
1282 | 1478 | }; |
1283 | 1479 | |
1284 | 1480 | /** |
... | ... | @@ -1288,6 +1484,7 @@ |
1288 | 1484 | * @dest_cfg: Queue destination configuration |
1289 | 1485 | * @flc_cfg: Flow context configuration |
1290 | 1486 | * @order_preservation_en: enable/disable order preservation |
1487 | + * @tail_drop_threshold: queue's tail drop threshold in bytes; | |
1291 | 1488 | * @fqid: Virtual fqid value to be used for dequeue operations |
1292 | 1489 | */ |
1293 | 1490 | struct dpni_queue_attr { |
... | ... | @@ -1295,6 +1492,7 @@ |
1295 | 1492 | struct dpni_dest_cfg dest_cfg; |
1296 | 1493 | struct dpni_flc_cfg flc_cfg; |
1297 | 1494 | int order_preservation_en; |
1495 | + uint32_t tail_drop_threshold; | |
1298 | 1496 | uint32_t fqid; |
1299 | 1497 | }; |
1300 | 1498 | |
... | ... | @@ -1302,10 +1500,6 @@ |
1302 | 1500 | |
1303 | 1501 | /* Select to modify the settings for dedicate Tx confirmation/error */ |
1304 | 1502 | #define DPNI_TX_FLOW_OPT_TX_CONF_ERROR 0x00000001 |
1305 | -/*!< Select to modify the Tx confirmation and/or error setting */ | |
1306 | -#define DPNI_TX_FLOW_OPT_ONLY_TX_ERROR 0x00000002 | |
1307 | -/*!< Select to modify the queue configuration */ | |
1308 | -#define DPNI_TX_FLOW_OPT_QUEUE 0x00000004 | |
1309 | 1503 | /*!< Select to modify the L3 checksum generation setting */ |
1310 | 1504 | #define DPNI_TX_FLOW_OPT_L3_CHKSUM_GEN 0x00000010 |
1311 | 1505 | /*!< Select to modify the L4 checksum generation setting */ |
1312 | 1506 | |
1313 | 1507 | |
1314 | 1508 | |
... | ... | @@ -1314,41 +1508,22 @@ |
1314 | 1508 | /** |
1315 | 1509 | * struct dpni_tx_flow_cfg - Structure representing Tx flow configuration |
1316 | 1510 | * @options: Flags representing the suggested modifications to the Tx flow; |
1317 | - * Use any combination 'DPNI_TX_FLOW_OPT_<X>' flags | |
1318 | - * @conf_err_cfg: Tx confirmation and error configuration; these settings are | |
1319 | - * ignored if 'DPNI_OPT_PRIVATE_TX_CONF_ERROR_DISABLED' was set at | |
1320 | - * DPNI creation | |
1511 | + * Use any combination 'DPNI_TX_FLOW_OPT_<X>' flags | |
1512 | + * @use_common_tx_conf_queue: Set to '1' to use the common (default) Tx | |
1513 | + * confirmation and error queue; Set to '0' to use the private | |
1514 | + * Tx confirmation and error queue; valid only if | |
1515 | + * 'DPNI_OPT_PRIVATE_TX_CONF_ERROR_DISABLED' wasn't set at DPNI creation | |
1516 | + * and 'DPNI_TX_FLOW_OPT_TX_CONF_ERROR' is contained in 'options' | |
1321 | 1517 | * @l3_chksum_gen: Set to '1' to enable L3 checksum generation; '0' to disable; |
1322 | - * valid only if 'DPNI_TX_FLOW_OPT_L3_CHKSUM_GEN' is contained in | |
1323 | - * 'options' | |
1518 | + * valid only if 'DPNI_TX_FLOW_OPT_L3_CHKSUM_GEN' is contained in 'options' | |
1324 | 1519 | * @l4_chksum_gen: Set to '1' to enable L4 checksum generation; '0' to disable; |
1325 | - * valid only if 'DPNI_TX_FLOW_OPT_L4_CHKSUM_GEN' is contained in | |
1326 | - * 'options' | |
1520 | + * valid only if 'DPNI_TX_FLOW_OPT_L4_CHKSUM_GEN' is contained in 'options' | |
1327 | 1521 | */ |
1328 | 1522 | struct dpni_tx_flow_cfg { |
1329 | - uint32_t options; | |
1330 | - /** | |
1331 | - * struct cnf_err_cfg - Tx confirmation and error configuration | |
1332 | - * @use_default_queue: Set to '1' to use the common (default) Tx | |
1333 | - * confirmation and error queue; Set to '0' to use the | |
1334 | - * private Tx confirmation and error queue; valid only if | |
1335 | - * 'DPNI_TX_FLOW_OPT_TX_CONF_ERROR' is contained in | |
1336 | - * 'options' | |
1337 | - * @errors_only: Set to '1' to report back only error frames; | |
1338 | - * Set to '0' to confirm transmission/error for all | |
1339 | - * transmitted frames; | |
1340 | - * valid only if 'DPNI_TX_FLOW_OPT_ONLY_TX_ERROR' is | |
1341 | - * contained in 'options' and 'use_default_queue = 0'; | |
1342 | - * @queue_cfg: Queue configuration; valid only if | |
1343 | - * 'DPNI_TX_FLOW_OPT_QUEUE' is contained in 'options' | |
1344 | - */ | |
1345 | - struct { | |
1346 | - int use_default_queue; | |
1347 | - int errors_only; | |
1348 | - struct dpni_queue_cfg queue_cfg; | |
1349 | - } conf_err_cfg; | |
1350 | - int l3_chksum_gen; | |
1351 | - int l4_chksum_gen; | |
1523 | + uint32_t options; | |
1524 | + int use_common_tx_conf_queue; | |
1525 | + int l3_chksum_gen; | |
1526 | + int l4_chksum_gen; | |
1352 | 1527 | }; |
1353 | 1528 | |
1354 | 1529 | /** |
... | ... | @@ -1357,10 +1532,9 @@ |
1357 | 1532 | * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' |
1358 | 1533 | * @token: Token of DPNI object |
1359 | 1534 | * @flow_id: Provides (or returns) the sender's flow ID; |
1360 | - * for each new sender set (*flow_id) to | |
1361 | - * 'DPNI_NEW_FLOW_ID' to generate a new flow_id; | |
1362 | - * this ID should be used as the QDBIN argument | |
1363 | - * in enqueue operations | |
1535 | + * for each new sender set (*flow_id) to 'DPNI_NEW_FLOW_ID' to generate | |
1536 | + * a new flow_id; this ID should be used as the QDBIN argument | |
1537 | + * in enqueue operations | |
1364 | 1538 | * @cfg: Tx flow configuration |
1365 | 1539 | * |
1366 | 1540 | * Return: '0' on Success; Error code otherwise. |
1367 | 1541 | |
... | ... | @@ -1373,28 +1547,15 @@ |
1373 | 1547 | |
1374 | 1548 | /** |
1375 | 1549 | * struct dpni_tx_flow_attr - Structure representing Tx flow attributes |
1376 | - * @conf_err_attr: Tx confirmation and error attributes | |
1550 | + * @use_common_tx_conf_queue: '1' if using common (default) Tx confirmation and | |
1551 | + * error queue; '0' if using private Tx confirmation and error queue | |
1377 | 1552 | * @l3_chksum_gen: '1' if L3 checksum generation is enabled; '0' if disabled |
1378 | 1553 | * @l4_chksum_gen: '1' if L4 checksum generation is enabled; '0' if disabled |
1379 | 1554 | */ |
1380 | 1555 | struct dpni_tx_flow_attr { |
1381 | - /** | |
1382 | - * struct conf_err_attr - Tx confirmation and error attributes | |
1383 | - * @use_default_queue: '1' if using common (default) Tx confirmation and | |
1384 | - * error queue; | |
1385 | - * '0' if using private Tx confirmation and error | |
1386 | - * queue | |
1387 | - * @errors_only: '1' if only error frames are reported back; '0' if all | |
1388 | - * transmitted frames are confirmed | |
1389 | - * @queue_attr: Queue attributes | |
1390 | - */ | |
1391 | - struct { | |
1392 | - int use_default_queue; | |
1393 | - int errors_only; | |
1394 | - struct dpni_queue_attr queue_attr; | |
1395 | - } conf_err_attr; | |
1396 | - int l3_chksum_gen; | |
1397 | - int l4_chksum_gen; | |
1556 | + int use_common_tx_conf_queue; | |
1557 | + int l3_chksum_gen; | |
1558 | + int l4_chksum_gen; | |
1398 | 1559 | }; |
1399 | 1560 | |
1400 | 1561 | /** |
... | ... | @@ -1403,7 +1564,7 @@ |
1403 | 1564 | * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' |
1404 | 1565 | * @token: Token of DPNI object |
1405 | 1566 | * @flow_id: The sender's flow ID, as returned by the |
1406 | - * dpni_set_tx_flow() function | |
1567 | + * dpni_set_tx_flow() function | |
1407 | 1568 | * @attr: Returned Tx flow attributes |
1408 | 1569 | * |
1409 | 1570 | * Return: '0' on Success; Error code otherwise. |
... | ... | @@ -1414,6 +1575,76 @@ |
1414 | 1575 | uint16_t flow_id, |
1415 | 1576 | struct dpni_tx_flow_attr *attr); |
1416 | 1577 | |
1578 | +/** | |
1579 | + * struct dpni_tx_conf_cfg - Structure representing Tx conf configuration | |
1580 | + * @errors_only: Set to '1' to report back only error frames; | |
1581 | + * Set to '0' to confirm transmission/error for all transmitted frames; | |
1582 | + * @queue_cfg: Queue configuration | |
1583 | + */ | |
1584 | +struct dpni_tx_conf_cfg { | |
1585 | + int errors_only; | |
1586 | + struct dpni_queue_cfg queue_cfg; | |
1587 | +}; | |
1588 | + | |
1589 | +/** | |
1590 | + * dpni_set_tx_conf() - Set Tx confirmation and error queue configuration | |
1591 | + * @mc_io: Pointer to MC portal's I/O object | |
1592 | + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' | |
1593 | + * @token: Token of DPNI object | |
1594 | + * @flow_id: The sender's flow ID, as returned by the | |
1595 | + * dpni_set_tx_flow() function; | |
1596 | + * use 'DPNI_COMMON_TX_CONF' for common tx-conf | |
1597 | + * @cfg: Queue configuration | |
1598 | + * | |
1599 | + * If either 'DPNI_OPT_TX_CONF_DISABLED' or | |
1600 | + * 'DPNI_OPT_PRIVATE_TX_CONF_ERROR_DISABLED' were selected at DPNI creation, | |
1601 | + * this function can ONLY be used with 'flow_id == DPNI_COMMON_TX_CONF'; | |
1602 | + * i.e. only serve the common tx-conf-err queue; | |
1603 | + * if 'DPNI_OPT_TX_CONF_DISABLED' was selected, only error frames are reported | |
1604 | + * back - successfully transmitted frames are not confirmed. Otherwise, all | |
1605 | + * transmitted frames are sent for confirmation. | |
1606 | + * | |
1607 | + * Return: '0' on Success; Error code otherwise. | |
1608 | + */ | |
1609 | +int dpni_set_tx_conf(struct fsl_mc_io *mc_io, | |
1610 | + uint32_t cmd_flags, | |
1611 | + uint16_t token, | |
1612 | + uint16_t flow_id, | |
1613 | + const struct dpni_tx_conf_cfg *cfg); | |
1614 | + | |
1615 | +/** | |
1616 | + * struct dpni_tx_conf_attr - Structure representing Tx conf attributes | |
1617 | + * @errors_only: '1' if only error frames are reported back; '0' if all | |
1618 | + * transmitted frames are confirmed | |
1619 | + * @queue_attr: Queue attributes | |
1620 | + */ | |
1621 | +struct dpni_tx_conf_attr { | |
1622 | + int errors_only; | |
1623 | + struct dpni_queue_attr queue_attr; | |
1624 | +}; | |
1625 | + | |
1626 | +/** | |
1627 | + * dpni_get_tx_conf() - Get Tx confirmation and error queue attributes | |
1628 | + * @mc_io: Pointer to MC portal's I/O object | |
1629 | + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' | |
1630 | + * @token: Token of DPNI object | |
1631 | + * @flow_id: The sender's flow ID, as returned by the | |
1632 | + * dpni_set_tx_flow() function; | |
1633 | + * use 'DPNI_COMMON_TX_CONF' for common tx-conf | |
1634 | + * @attr: Returned tx-conf attributes | |
1635 | + * | |
1636 | + * If either 'DPNI_OPT_TX_CONF_DISABLED' or | |
1637 | + * 'DPNI_OPT_PRIVATE_TX_CONF_ERROR_DISABLED' were selected at DPNI creation, | |
1638 | + * this function can ONLY be used with 'flow_id == DPNI_COMMON_TX_CONF'; | |
1639 | + * i.e. only serve the common tx-conf-err queue; | |
1640 | + * | |
1641 | + * Return: '0' on Success; Error code otherwise. | |
1642 | + */ | |
1643 | +int dpni_get_tx_conf(struct fsl_mc_io *mc_io, | |
1644 | + uint32_t cmd_flags, | |
1645 | + uint16_t token, | |
1646 | + uint16_t flow_id, | |
1647 | + struct dpni_tx_conf_attr *attr); | |
1417 | 1648 | /** |
1418 | 1649 | * dpni_set_rx_flow() - Set Rx flow configuration |
1419 | 1650 | * @mc_io: Pointer to MC portal's I/O object |
include/fsl-mc/fsl_dprc.h
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | |
12 | 12 | /* DPRC Version */ |
13 | 13 | #define DPRC_VER_MAJOR 5 |
14 | -#define DPRC_VER_MINOR 0 | |
14 | +#define DPRC_VER_MINOR 1 | |
15 | 15 | |
16 | 16 | /* Command IDs */ |
17 | 17 | #define DPRC_CMDID_CLOSE 0x800 |
... | ... | @@ -110,6 +110,7 @@ |
110 | 110 | MC_RSP_OP(cmd, 1, 32, 32, uint32_t, obj_desc->state);\ |
111 | 111 | MC_RSP_OP(cmd, 2, 0, 16, uint16_t, obj_desc->ver_major);\ |
112 | 112 | MC_RSP_OP(cmd, 2, 16, 16, uint16_t, obj_desc->ver_minor);\ |
113 | + MC_RSP_OP(cmd, 2, 32, 16, uint16_t, obj_desc->flags); \ | |
113 | 114 | MC_RSP_OP(cmd, 3, 0, 8, char, obj_desc->type[0]);\ |
114 | 115 | MC_RSP_OP(cmd, 3, 8, 8, char, obj_desc->type[1]);\ |
115 | 116 | MC_RSP_OP(cmd, 3, 16, 8, char, obj_desc->type[2]);\ |
... | ... | @@ -145,6 +146,73 @@ |
145 | 146 | } while (0) |
146 | 147 | |
147 | 148 | /* cmd, param, offset, width, type, arg_name */ |
149 | +#define DPRC_CMD_GET_OBJ_DESC(cmd, obj_type, obj_id) \ | |
150 | +do { \ | |
151 | + MC_CMD_OP(cmd, 0, 0, 32, int, obj_id);\ | |
152 | + MC_CMD_OP(cmd, 1, 0, 8, char, obj_type[0]);\ | |
153 | + MC_CMD_OP(cmd, 1, 8, 8, char, obj_type[1]);\ | |
154 | + MC_CMD_OP(cmd, 1, 16, 8, char, obj_type[2]);\ | |
155 | + MC_CMD_OP(cmd, 1, 24, 8, char, obj_type[3]);\ | |
156 | + MC_CMD_OP(cmd, 1, 32, 8, char, obj_type[4]);\ | |
157 | + MC_CMD_OP(cmd, 1, 40, 8, char, obj_type[5]);\ | |
158 | + MC_CMD_OP(cmd, 1, 48, 8, char, obj_type[6]);\ | |
159 | + MC_CMD_OP(cmd, 1, 56, 8, char, obj_type[7]);\ | |
160 | + MC_CMD_OP(cmd, 2, 0, 8, char, obj_type[8]);\ | |
161 | + MC_CMD_OP(cmd, 2, 8, 8, char, obj_type[9]);\ | |
162 | + MC_CMD_OP(cmd, 2, 16, 8, char, obj_type[10]);\ | |
163 | + MC_CMD_OP(cmd, 2, 24, 8, char, obj_type[11]);\ | |
164 | + MC_CMD_OP(cmd, 2, 32, 8, char, obj_type[12]);\ | |
165 | + MC_CMD_OP(cmd, 2, 40, 8, char, obj_type[13]);\ | |
166 | + MC_CMD_OP(cmd, 2, 48, 8, char, obj_type[14]);\ | |
167 | + MC_CMD_OP(cmd, 2, 56, 8, char, obj_type[15]);\ | |
168 | +} while (0) | |
169 | + | |
170 | +/* cmd, param, offset, width, type, arg_name */ | |
171 | +#define DPRC_RSP_GET_OBJ_DESC(cmd, obj_desc) \ | |
172 | +do { \ | |
173 | + MC_RSP_OP(cmd, 0, 32, 32, int, obj_desc->id); \ | |
174 | + MC_RSP_OP(cmd, 1, 0, 16, uint16_t, obj_desc->vendor); \ | |
175 | + MC_RSP_OP(cmd, 1, 16, 8, uint8_t, obj_desc->irq_count); \ | |
176 | + MC_RSP_OP(cmd, 1, 24, 8, uint8_t, obj_desc->region_count); \ | |
177 | + MC_RSP_OP(cmd, 1, 32, 32, uint32_t, obj_desc->state);\ | |
178 | + MC_RSP_OP(cmd, 2, 0, 16, uint16_t, obj_desc->ver_major);\ | |
179 | + MC_RSP_OP(cmd, 2, 16, 16, uint16_t, obj_desc->ver_minor);\ | |
180 | + MC_RSP_OP(cmd, 2, 32, 16, uint16_t, obj_desc->flags); \ | |
181 | + MC_RSP_OP(cmd, 3, 0, 8, char, obj_desc->type[0]);\ | |
182 | + MC_RSP_OP(cmd, 3, 8, 8, char, obj_desc->type[1]);\ | |
183 | + MC_RSP_OP(cmd, 3, 16, 8, char, obj_desc->type[2]);\ | |
184 | + MC_RSP_OP(cmd, 3, 24, 8, char, obj_desc->type[3]);\ | |
185 | + MC_RSP_OP(cmd, 3, 32, 8, char, obj_desc->type[4]);\ | |
186 | + MC_RSP_OP(cmd, 3, 40, 8, char, obj_desc->type[5]);\ | |
187 | + MC_RSP_OP(cmd, 3, 48, 8, char, obj_desc->type[6]);\ | |
188 | + MC_RSP_OP(cmd, 3, 56, 8, char, obj_desc->type[7]);\ | |
189 | + MC_RSP_OP(cmd, 4, 0, 8, char, obj_desc->type[8]);\ | |
190 | + MC_RSP_OP(cmd, 4, 8, 8, char, obj_desc->type[9]);\ | |
191 | + MC_RSP_OP(cmd, 4, 16, 8, char, obj_desc->type[10]);\ | |
192 | + MC_RSP_OP(cmd, 4, 24, 8, char, obj_desc->type[11]);\ | |
193 | + MC_RSP_OP(cmd, 4, 32, 8, char, obj_desc->type[12]);\ | |
194 | + MC_RSP_OP(cmd, 4, 40, 8, char, obj_desc->type[13]);\ | |
195 | + MC_RSP_OP(cmd, 4, 48, 8, char, obj_desc->type[14]);\ | |
196 | + MC_RSP_OP(cmd, 4, 56, 8, char, obj_desc->type[15]);\ | |
197 | + MC_RSP_OP(cmd, 5, 0, 8, char, obj_desc->label[0]);\ | |
198 | + MC_RSP_OP(cmd, 5, 8, 8, char, obj_desc->label[1]);\ | |
199 | + MC_RSP_OP(cmd, 5, 16, 8, char, obj_desc->label[2]);\ | |
200 | + MC_RSP_OP(cmd, 5, 24, 8, char, obj_desc->label[3]);\ | |
201 | + MC_RSP_OP(cmd, 5, 32, 8, char, obj_desc->label[4]);\ | |
202 | + MC_RSP_OP(cmd, 5, 40, 8, char, obj_desc->label[5]);\ | |
203 | + MC_RSP_OP(cmd, 5, 48, 8, char, obj_desc->label[6]);\ | |
204 | + MC_RSP_OP(cmd, 5, 56, 8, char, obj_desc->label[7]);\ | |
205 | + MC_RSP_OP(cmd, 6, 0, 8, char, obj_desc->label[8]);\ | |
206 | + MC_RSP_OP(cmd, 6, 8, 8, char, obj_desc->label[9]);\ | |
207 | + MC_RSP_OP(cmd, 6, 16, 8, char, obj_desc->label[10]);\ | |
208 | + MC_RSP_OP(cmd, 6, 24, 8, char, obj_desc->label[11]);\ | |
209 | + MC_RSP_OP(cmd, 6, 32, 8, char, obj_desc->label[12]);\ | |
210 | + MC_RSP_OP(cmd, 6, 40, 8, char, obj_desc->label[13]);\ | |
211 | + MC_RSP_OP(cmd, 6, 48, 8, char, obj_desc->label[14]);\ | |
212 | + MC_RSP_OP(cmd, 6, 56, 8, char, obj_desc->label[15]);\ | |
213 | +} while (0) | |
214 | + | |
215 | +/* cmd, param, offset, width, type, arg_name */ | |
148 | 216 | #define DPRC_CMD_GET_RES_COUNT(cmd, type) \ |
149 | 217 | do { \ |
150 | 218 | MC_CMD_OP(cmd, 1, 0, 8, char, type[0]);\ |
151 | 219 | |
152 | 220 | |
... | ... | @@ -480,14 +548,13 @@ |
480 | 548 | */ |
481 | 549 | #define DPRC_CFG_OPT_TOPOLOGY_CHANGES_ALLOWED 0x00000008 |
482 | 550 | |
483 | -/* IOMMU bypass - indicates whether objects of this container are permitted | |
484 | - * to bypass the IOMMU. | |
485 | - */ | |
486 | -#define DPRC_CFG_OPT_IOMMU_BYPASS 0x00000010 | |
487 | 551 | |
488 | -/* AIOP - Indicates that container belongs to AIOP. */ | |
552 | +/* AIOP - Indicates that container belongs to AIOP. */ | |
489 | 553 | #define DPRC_CFG_OPT_AIOP 0x00000020 |
490 | 554 | |
555 | +/* IRQ Config - Indicates that the container allowed to configure its IRQs.*/ | |
556 | +#define DPRC_CFG_OPT_IRQ_CFG_ALLOWED 0x00000040 | |
557 | + | |
491 | 558 | /** |
492 | 559 | * struct dprc_cfg - Container configuration options |
493 | 560 | * @icid: Container's ICID; if set to 'DPRC_GET_ICID_FROM_POOL', a free |
... | ... | @@ -637,6 +704,14 @@ |
637 | 704 | #define DPRC_OBJ_STATE_PLUGGED 0x00000002 |
638 | 705 | |
639 | 706 | /** |
707 | + * Shareability flag - Object flag indicating no memory shareability. | |
708 | + * the object generates memory accesses that are non coherent with other | |
709 | + * masters; | |
710 | + * user is responsible for proper memory handling through IOMMU configuration. | |
711 | + */ | |
712 | +#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001 | |
713 | + | |
714 | +/** | |
640 | 715 | * struct dprc_obj_desc - Object descriptor, returned from dprc_get_obj() |
641 | 716 | * @type: Type of object: NULL terminated string |
642 | 717 | * @id: ID of logical object resource |
... | ... | @@ -647,6 +722,7 @@ |
647 | 722 | * @region_count: Number of mappable regions supported by the object |
648 | 723 | * @state: Object state: combination of DPRC_OBJ_STATE_ states |
649 | 724 | * @label: Object label |
725 | + * @flags: Object's flags | |
650 | 726 | */ |
651 | 727 | struct dprc_obj_desc { |
652 | 728 | char type[16]; |
... | ... | @@ -658,6 +734,7 @@ |
658 | 734 | uint8_t region_count; |
659 | 735 | uint32_t state; |
660 | 736 | char label[16]; |
737 | + uint16_t flags; | |
661 | 738 | }; |
662 | 739 | |
663 | 740 | /** |
... | ... | @@ -859,7 +936,10 @@ |
859 | 936 | * @token: Token of DPRC object |
860 | 937 | * @endpoint1: Endpoint 1 configuration parameters |
861 | 938 | * @endpoint2: Returned endpoint 2 configuration parameters |
862 | -* @state: Returned link state: 1 - link is up, 0 - link is down | |
939 | +* @state: Returned link state: | |
940 | +* 1 - link is up; | |
941 | +* 0 - link is down; | |
942 | +* -1 - no connection (endpoint2 information is irrelevant) | |
863 | 943 | * |
864 | 944 | * Return: '0' on Success; -ENAVAIL if connection does not exist. |
865 | 945 | */ |
include/fsl-mc/fsl_mc_cmd.h
... | ... | @@ -68,8 +68,11 @@ |
68 | 68 | #define MC_CMD_HDR_READ_TOKEN(_hdr) \ |
69 | 69 | ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S)) |
70 | 70 | |
71 | +#define MC_PREP_OP(_ext, _param, _offset, _width, _type, _arg) \ | |
72 | + ((_ext)[_param] |= cpu_to_le64(mc_enc((_offset), (_width), _arg))) | |
73 | + | |
71 | 74 | #define MC_EXT_OP(_ext, _param, _offset, _width, _type, _arg) \ |
72 | - ((_ext)[_param] |= mc_enc((_offset), (_width), _arg)) | |
75 | + (_arg = (_type)mc_dec(cpu_to_le64(_ext[_param]), (_offset), (_width))) | |
73 | 76 | |
74 | 77 | #define MC_CMD_OP(_cmd, _param, _offset, _width, _type, _arg) \ |
75 | 78 | ((_cmd).params[_param] |= mc_enc((_offset), (_width), _arg)) |