driver: net: fsl-mc: flib changes for MC FW 9.0.0
PATCH 2/7 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 <[email protected]>
--- drivers/net/fsl-mc/dpni.c | 81 ++++++ drivers/net/ldpaa_eth/ldpaa_eth.c | 4 +- include/fsl-mc/fsl_dpbp.h | 2 +- include/fsl-mc/fsl_dpio.h | 5 +- include/fsl-mc/fsl_dpmac.h | 2 +- include/fsl-mc/fsl_dpmng.h | 2 +- include/fsl-mc/fsl_dpni.h | 539 +++++++++++++++++++++++++++----------- include/fsl-mc/fsl_dprc.h | 94 ++++++- include/fsl-mc/fsl_mc_cmd.h | 5 +- 9 files changed, 565 insertions(+), 169 deletions(-)
drivers/net/fsl-mc/dpni.c +81 -0
@@ -8,6 +8,26 @@#include <fsl-mc/fsl_mc_cmd.h> #include <fsl-mc/fsl_dpni.h> +int dpni_prepare_extended_cfg (const struct dpni_extended_cfg *cfg, +uint8_t *ext_cfg_buf) +{ +uint64_t *ext_params = (uint64_t *)ext_cfg_buf; + +DPNI_PREP_EXTENDED_CFG (ext_params, cfg); + +return 0 ; +} + +int dpni_extract_extended_cfg (struct dpni_extended_cfg *cfg, +const uint8_t *ext_cfg_buf) +{ +uint64_t *ext_params = (uint64_t *)ext_cfg_buf; + +DPNI_EXT_EXTENDED_CFG (ext_params, cfg); + +return 0 ; +} + int dpni_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpni_id,
@@ -162,6 +182,7 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io, cmd.header =mc_encode_cmd_header (DPNI_CMDID_GET_ATTR , cmd_flags, token); +DPNI_CMD_GET_ATTR (cmd, attr);/* send command to mc*/ err =mc_send_command (mc_io, &cmd);
@@ -174,6 +195,23 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io,return 0 ; } +int dpni_set_errors_behavior (struct fsl_mc_io *mc_io, +uint32_t cmd_flags, +uint16_t token, +struct dpni_error_cfg *cfg) +{ +struct mc_command cmd = {0 }; + +/* prepare command */ + cmd.header =mc_encode_cmd_header (DPNI_CMDID_SET_ERRORS_BEHAVIOR , + cmd_flags, + token); +DPNI_CMD_SET_ERRORS_BEHAVIOR (cmd, cfg); + +/* send command to mc*/ +return mc_send_command (mc_io, &cmd); +} + int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token,
@@ -602,3 +640,46 @@ int dpni_get_rx_flow(struct fsl_mc_io *mc_io,return 0 ; } + +int dpni_set_tx_conf (struct fsl_mc_io *mc_io, +uint32_t cmd_flags, +uint16_t token, +uint16_t flow_id, +const struct dpni_tx_conf_cfg *cfg) +{ +struct mc_command cmd = {0 }; + +/* prepare command */ + cmd.header =mc_encode_cmd_header (DPNI_CMDID_SET_TX_CONF , + cmd_flags, + token); +DPNI_CMD_SET_TX_CONF (cmd, flow_id, cfg); + +/* send command to mc*/ +return mc_send_command (mc_io, &cmd); +} + +int dpni_get_tx_conf (struct fsl_mc_io *mc_io, +uint32_t cmd_flags, +uint16_t token, +uint16_t flow_id, +struct dpni_tx_conf_attr *attr) +{ +struct mc_command cmd = {0 }; +int err; + +/* prepare command */ + cmd.header =mc_encode_cmd_header (DPNI_CMDID_GET_TX_CONF , + cmd_flags, + token); +DPNI_CMD_GET_TX_CONF (cmd, flow_id); + +/* send command to mc*/ + err =mc_send_command (mc_io, &cmd); +if (err) +return err; + +DPNI_RSP_GET_TX_CONF (cmd, attr); + +return 0 ; +}
drivers/net/ldpaa_eth/ldpaa_eth.c +1 -3
@@ -798,9 +798,7 @@ static int ldpaa_dpni_bind(struct ldpaa_eth_priv *priv) priv->tx_flow_id =DPNI_NEW_FLOW_ID ;memset (&dflt_tx_flow,0 ,sizeof (dflt_tx_flow)); - dflt_tx_flow.options =DPNI_TX_FLOW_OPT_ONLY_TX_ERROR ; - dflt_tx_flow.conf_err_cfg.use_default_queue =0 ; - dflt_tx_flow.conf_err_cfg.errors_only =1 ; + dflt_tx_flow.use_common_tx_conf_queue =0 ; err =dpni_set_tx_flow (dflt_mc_io,MC_CMD_NO_FLAGS , dflt_dpni->dpni_handle, &priv->tx_flow_id, &dflt_tx_flow);
include/fsl-mc/fsl_dpbp.h +1 -1
@@ -15,7 +15,7 @@/* DPBP Version */ #define DPBP_VER_MAJOR 2 -#define DPBP_VER_MINOR 1 +#define DPBP_VER_MINOR 2/* Command IDs */ #define DPBP_CMDID_CLOSE 0x800
include/fsl-mc/fsl_dpio.h +4 -1
@@ -9,7 +9,7 @@/* DPIO Version */ #define DPIO_VER_MAJOR 3 -#define DPIO_VER_MINOR 1 +#define DPIO_VER_MINOR 2/* Command IDs */ #define DPIO_CMDID_CLOSE 0x800
@@ -45,6 +45,7 @@ do { \MC_RSP_OP (cmd,2 ,0 ,64 , uint64_t, attr->qbman_portal_ci_offset);\MC_RSP_OP (cmd,3 ,0 ,16 , uint16_t, attr->version.major);\MC_RSP_OP (cmd,3 ,16 ,16 , uint16_t, attr->version.minor);\ +MC_RSP_OP (cmd,3 ,32 ,32 , uint32_t, attr->qbman_version);\ }while (0 )/* Data Path I/O Portal API
@@ -195,6 +196,7 @@ int dpio_reset(struct fsl_mc_io *mc_io,* @channel_mode: Notification channel mode * @num_priorities: Number of priorities for the notification channel (1-8); * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL' +* @qbman_version: QBMAN version */ struct dpio_attr {int id;
@@ -212,6 +214,7 @@ struct dpio_attr {uint16_t qbman_portal_id;enum dpio_channel_mode channel_mode;uint8_t num_priorities; +uint32_t qbman_version; };/**
include/fsl-mc/fsl_dpmac.h +1 -1
@@ -12,7 +12,7 @@/* DPMAC Version */ #define DPMAC_VER_MAJOR 3 -#define DPMAC_VER_MINOR 1 +#define DPMAC_VER_MINOR 2/* Command IDs */ #define DPMAC_CMDID_CLOSE 0x800
include/fsl-mc/fsl_dpmng.h +1 -1
@@ -14,7 +14,7 @@ struct fsl_mc_io;/** * Management Complex firmware version information */ -#define MC_VER_MAJOR 8 +#define MC_VER_MAJOR 9#define MC_VER_MINOR 0/**
include/fsl-mc/fsl_dpni.h +385 -154
786 lines not on this page · raw message
include/fsl-mc/fsl_dprc.h +87 -7
139 lines not on this page · raw message
include/fsl-mc/fsl_mc_cmd.h +4 -1
@@ -68,8 +68,11 @@ enum mc_cmd_status {#define MC_CMD_HDR_READ_TOKEN (_hdr) \ ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S)) +#define MC_PREP_OP (_ext, _param, _offset, _width, _type, _arg) \ + ((_ext)[_param] |= cpu_to_le64(mc_enc((_offset), (_width), _arg))) +#define MC_EXT_OP (_ext, _param, _offset, _width, _type, _arg) \ - ((_ext)[_param] |= mc_enc((_offset), (_width), _arg)) + (_arg = (_type)mc_dec(cpu_to_le64(_ext[_param]), (_offset), (_width)))#define MC_CMD_OP (_cmd, _param, _offset, _width, _type, _arg) \ ((_cmd).params[_param] |= mc_enc((_offset), (_width), _arg))
Signature · 1 line
1.9.1
PATCH 2/7 driver: net: fsl-mc: flib changes for MC FW 9.0.0
Quoted 9 lines · Prabhakar Kushwaha
MC firmware version 9.0.0 contains
- Support of new APIs
- Update in existing APIs
- Change in Major and minor version of DPAA2 objectsThis patch contains modifications in FLIB files to support new MC firmware version.
Signed-off-by Prabhakar Kushwaha <[email protected]>
Quoted 12 lines
--- drivers/net/fsl-mc/dpni.c | 81 ++++++ drivers/net/ldpaa_eth/ldpaa_eth.c | 4 +- include/fsl-mc/fsl_dpbp.h | 2 +- include/fsl-mc/fsl_dpio.h | 5 +- include/fsl-mc/fsl_dpmac.h | 2 +- include/fsl-mc/fsl_dpmng.h | 2 +- include/fsl-mc/fsl_dpni.h | 539 +++++++++++++++++++++++++++----------- include/fsl-mc/fsl_dprc.h | 94 ++++++- include/fsl-mc/fsl_mc_cmd.h | 5 +- 9 files changed, 565 insertions(+), 169 deletions(-)
Slightly reformat commit message.
Applied to u-boot-fsl-qoriq master. Awaiting upstream.
Thanks.
York