#include <fsl-mc/fsl_mc_cmd.h>
#include <fsl-mc/fsl_dpbp.h>
-int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token)
+int dpbp_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int dpbp_id,
+ uint16_t *token)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPBP_CMDID_OPEN,
- MC_CMD_PRI_LOW, 0);
+ cmd_flags,
+ 0);
DPBP_CMD_OPEN(cmd, dpbp_id);
/* send command to mc*/
return err;
}
-int dpbp_close(struct fsl_mc_io *mc_io, uint16_t token)
+int dpbp_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
- cmd.header = mc_encode_cmd_header(DPBP_CMDID_CLOSE, MC_CMD_PRI_HIGH,
+ cmd.header = mc_encode_cmd_header(DPBP_CMDID_CLOSE, cmd_flags,
token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpbp_enable(struct fsl_mc_io *mc_io, uint16_t token)
+int dpbp_enable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
- cmd.header = mc_encode_cmd_header(DPBP_CMDID_ENABLE, MC_CMD_PRI_LOW,
+ cmd.header = mc_encode_cmd_header(DPBP_CMDID_ENABLE, cmd_flags,
token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpbp_disable(struct fsl_mc_io *mc_io, uint16_t token)
+int dpbp_disable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPBP_CMDID_DISABLE,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpbp_reset(struct fsl_mc_io *mc_io, uint16_t token)
+int dpbp_reset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPBP_CMDID_RESET,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
int dpbp_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpbp_attr *attr)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_ATTR,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
#include <fsl-mc/fsl_mc_cmd.h>
#include <fsl-mc/fsl_dpio.h>
-int dpio_open(struct fsl_mc_io *mc_io, int dpio_id, uint16_t *token)
+int dpio_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int dpio_id,
+ uint16_t *token)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_OPEN,
- MC_CMD_PRI_LOW, 0);
+ cmd_flags,
+ 0);
DPIO_CMD_OPEN(cmd, dpio_id);
/* send command to mc*/
return 0;
}
-int dpio_close(struct fsl_mc_io *mc_io, uint16_t token)
+int dpio_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_CLOSE,
- MC_CMD_PRI_HIGH, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpio_enable(struct fsl_mc_io *mc_io, uint16_t token)
+int dpio_enable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_ENABLE,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpio_disable(struct fsl_mc_io *mc_io, uint16_t token)
+int dpio_disable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_DISABLE,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpio_reset(struct fsl_mc_io *mc_io, uint16_t token)
+int dpio_reset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_RESET,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
int dpio_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpio_attr *attr)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_GET_ATTR,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
/* send command to mc*/
#include <fsl-mc/fsl_dpmng.h>
#include "fsl_dpmng_cmd.h"
-int mc_get_version(struct fsl_mc_io *mc_io, struct mc_version *mc_ver_info)
+int mc_get_version(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ struct mc_version *mc_ver_info)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION,
- MC_CMD_PRI_LOW, 0);
+ cmd_flags,
+ 0);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
#include <fsl-mc/fsl_mc_cmd.h>
#include <fsl-mc/fsl_dpni.h>
-int dpni_open(struct fsl_mc_io *mc_io, int dpni_id, uint16_t *token)
+int dpni_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int dpni_id,
+ uint16_t *token)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_OPEN,
- MC_CMD_PRI_LOW, 0);
+ cmd_flags,
+ 0);
DPNI_CMD_OPEN(cmd, dpni_id);
/* send command to mc*/
return 0;
}
-int dpni_close(struct fsl_mc_io *mc_io, uint16_t token)
+int dpni_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_CLOSE,
- MC_CMD_PRI_HIGH, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
int dpni_set_pools(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_pools_cfg *cfg)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_POOLS,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
DPNI_CMD_SET_POOLS(cmd, cfg);
return mc_send_command(mc_io, &cmd);
}
-int dpni_enable(struct fsl_mc_io *mc_io, uint16_t token)
+int dpni_enable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_ENABLE,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpni_disable(struct fsl_mc_io *mc_io, uint16_t token)
+int dpni_disable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_DISABLE,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpni_reset(struct fsl_mc_io *mc_io, uint16_t token)
+int dpni_reset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_RESET,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
int dpni_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_attr *attr)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_ATTR,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
/* send command to mc*/
}
int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_buffer_layout *layout)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_RX_BUFFER_LAYOUT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
}
int dpni_set_rx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_buffer_layout *layout)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_RX_BUFFER_LAYOUT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_RX_BUFFER_LAYOUT(cmd, layout);
/* send command to mc*/
}
int dpni_get_tx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_buffer_layout *layout)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_BUFFER_LAYOUT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
}
int dpni_set_tx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_buffer_layout *layout)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_BUFFER_LAYOUT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_TX_BUFFER_LAYOUT(cmd, layout);
/* send command to mc*/
}
int dpni_get_tx_conf_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_buffer_layout *layout)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_CONF_BUFFER_LAYOUT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
}
int dpni_set_tx_conf_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_buffer_layout *layout)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_CONF_BUFFER_LAYOUT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_TX_CONF_BUFFER_LAYOUT(cmd, layout);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
-int dpni_get_qdid(struct fsl_mc_io *mc_io, uint16_t token, uint16_t *qdid)
+int dpni_get_qdid(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint16_t *qdid)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QDID,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
/* send command to mc*/
}
int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint16_t *data_offset)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_DATA_OFFSET,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
}
int dpni_get_counter(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
enum dpni_counter counter,
uint64_t *value)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_COUNTER,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_GET_COUNTER(cmd, counter);
/* send command to mc*/
}
int dpni_set_counter(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
enum dpni_counter counter,
uint64_t value)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_COUNTER,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_COUNTER(cmd, counter, value);
/* send command to mc*/
}
int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
- const struct dpni_link_cfg *cfg)
+ const struct dpni_link_cfg *cfg)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_LINK_CFG,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_LINK_CFG(cmd, cfg);
/* send command to mc*/
}
int dpni_get_link_state(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_link_state *state)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_LINK_STATE,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const uint8_t mac_addr[6])
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_PRIM_MAC,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr);
/* send command to mc*/
}
int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint8_t mac_addr[6])
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_PRIM_MAC,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
}
int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const uint8_t mac_addr[6])
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_ADD_MAC_ADDR,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_ADD_MAC_ADDR(cmd, mac_addr);
/* send command to mc*/
}
int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const uint8_t mac_addr[6])
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_REMOVE_MAC_ADDR,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_REMOVE_MAC_ADDR(cmd, mac_addr);
/* send command to mc*/
}
int dpni_set_tx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint16_t *flow_id,
const struct dpni_tx_flow_cfg *cfg)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_FLOW,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_TX_FLOW(cmd, *flow_id, cfg);
/* send command to mc*/
}
int dpni_get_tx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint16_t flow_id,
struct dpni_tx_flow_attr *attr)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_FLOW,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_GET_TX_FLOW(cmd, flow_id);
/* send command to mc*/
}
int dpni_set_rx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint8_t tc_id,
uint16_t flow_id,
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_RX_FLOW,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_SET_RX_FLOW(cmd, tc_id, flow_id, cfg);
/* send command to mc*/
}
int dpni_get_rx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint8_t tc_id,
uint16_t flow_id,
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_RX_FLOW,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPNI_CMD_GET_RX_FLOW(cmd, tc_id, flow_id);
/* send command to mc*/
#include <fsl-mc/fsl_mc_cmd.h>
#include <fsl-mc/fsl_dprc.h>
-int dprc_get_container_id(struct fsl_mc_io *mc_io, int *container_id)
+int dprc_get_container_id(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int *container_id)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_CONT_ID,
- MC_CMD_PRI_LOW, 0);
+ cmd_flags,
+ 0);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
return 0;
}
-int dprc_open(struct fsl_mc_io *mc_io, int container_id, uint16_t *token)
+int dprc_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int container_id,
+ uint16_t *token)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
- cmd.header = mc_encode_cmd_header(DPRC_CMDID_OPEN, MC_CMD_PRI_LOW,
+ cmd.header = mc_encode_cmd_header(DPRC_CMDID_OPEN, cmd_flags,
0);
DPRC_CMD_OPEN(cmd, container_id);
return 0;
}
-int dprc_close(struct fsl_mc_io *mc_io, uint16_t token)
+int dprc_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token)
{
struct mc_command cmd = { 0 };
/* prepare command */
- cmd.header = mc_encode_cmd_header(DPRC_CMDID_CLOSE, MC_CMD_PRI_HIGH,
+ cmd.header = mc_encode_cmd_header(DPRC_CMDID_CLOSE, cmd_flags,
token);
/* send command to mc*/
}
int dprc_reset_container(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
int child_container_id)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_RESET_CONT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPRC_CMD_RESET_CONTAINER(cmd, child_container_id);
/* send command to mc*/
}
int dprc_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dprc_attributes *attr)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_ATTR,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
/* send command to mc*/
return 0;
}
-int dprc_get_obj_count(struct fsl_mc_io *mc_io, uint16_t token, int *obj_count)
+int dprc_get_obj_count(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ int *obj_count)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_OBJ_COUNT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
}
int dprc_get_obj(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
int obj_index,
struct dprc_obj_desc *obj_desc)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_OBJ,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
DPRC_CMD_GET_OBJ(cmd, obj_index);
}
int dprc_get_res_count(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
char *type,
int *res_count)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_RES_COUNT,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPRC_CMD_GET_RES_COUNT(cmd, type);
/* send command to mc*/
}
int dprc_get_res_ids(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
char *type,
struct dprc_res_ids_range_desc *range_desc)
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_RES_IDS,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPRC_CMD_GET_RES_IDS(cmd, range_desc, type);
/* send command to mc*/
}
int dprc_get_obj_region(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
char *obj_type,
int obj_id,
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_OBJ_REG,
- MC_CMD_PRI_LOW, token);
+ cmd_flags,
+ token);
DPRC_CMD_GET_OBJ_REGION(cmd, obj_type, obj_id, region_index);
/* send command to mc*/
}
int dprc_connect(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dprc_endpoint *endpoint1,
- const struct dprc_endpoint *endpoint2)
+ const struct dprc_endpoint *endpoint2,
+ const struct dprc_connection_cfg *cfg)
{
struct mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_CONNECT,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
- DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2);
+ DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2, cfg);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
int dprc_disconnect(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dprc_endpoint *endpoint)
{
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_DISCONNECT,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
DPRC_CMD_DISCONNECT(cmd, endpoint);
}
int dprc_get_connection(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
- const struct dprc_endpoint *endpoint1,
- struct dprc_endpoint *endpoint2,
- int *state)
+ const struct dprc_endpoint *endpoint1,
+ struct dprc_endpoint *endpoint2,
+ int *state)
{
struct mc_command cmd = { 0 };
int err;
/* prepare command */
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_CONNECTION,
- MC_CMD_PRI_LOW,
+ cmd_flags,
token);
DPRC_CMD_GET_CONNECTION(cmd, endpoint1);
debug("Checking access to MC portal of root DPRC container (portal_id %d, portal physical addr %p)\n",
portal_id, dflt_mc_io->mmio_regs);
- error = mc_get_version(dflt_mc_io, &mc_ver_info);
+ error = mc_get_version(dflt_mc_io, MC_CMD_NO_FLAGS, &mc_ver_info);
if (error != 0) {
printf("fsl-mc: ERROR: Firmware version check failed (error: %d)\n",
error);
dflt_dpio->dpio_id = obj_desc.id;
- err = dpio_open(dflt_mc_io, obj_desc.id, &dflt_dpio_handle);
+ err = dpio_open(dflt_mc_io, MC_CMD_NO_FLAGS, obj_desc.id,
+ &dflt_dpio_handle);
if (err) {
printf("dpio_open() failed\n");
goto err_open;
}
- err = dpio_get_attributes(dflt_mc_io, dflt_dpio_handle, &attr);
+ err = dpio_get_attributes(dflt_mc_io, MC_CMD_NO_FLAGS,
+ dflt_dpio_handle, &attr);
if (err) {
printf("dpio_get_attributes() failed %d\n", err);
goto err_get_attr;
}
- err = dpio_enable(dflt_mc_io, dflt_dpio_handle);
+ err = dpio_enable(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio_handle);
if (err) {
printf("dpio_enable() failed %d\n", err);
goto err_get_enable;
err_get_swp_init:
err_get_enable:
- dpio_disable(dflt_mc_io, dflt_dpio_handle);
+ dpio_disable(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio_handle);
err_get_attr:
- dpio_close(dflt_mc_io, dflt_dpio_handle);
+ dpio_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio_handle);
err_open:
free(dflt_dpio);
return err;
} else if (!strcmp(obj_desc.type, "dpni")) {
strcpy(dpni_endpoint.type, obj_desc.type);
dpni_endpoint.id = obj_desc.id;
- error = dprc_get_connection(dflt_mc_io, dprc_handle,
- &dpni_endpoint, &dpmac_endpoint, &state);
+ error = dprc_get_connection(dflt_mc_io, MC_CMD_NO_FLAGS,
+ dprc_handle, &dpni_endpoint,
+ &dpmac_endpoint, &state);
if (!strcmp(dpmac_endpoint.type, "dpmac"))
error = ldpaa_eth_init(obj_desc);
if (error < 0)
memset((void *)&obj_desc, 0x00, sizeof(struct dprc_obj_desc));
- error = dprc_get_obj(dflt_mc_io, dprc_handle,
+ error = dprc_get_obj(dflt_mc_io, MC_CMD_NO_FLAGS, dprc_handle,
i, &obj_desc);
if (error < 0) {
printf("dprc_get_obj(i=%d) failed: %d\n",
if (error < 0)
goto error;
- error = dprc_get_container_id(dflt_mc_io, &container_id);
+ error = dprc_get_container_id(dflt_mc_io, MC_CMD_NO_FLAGS,
+ &container_id);
if (error < 0) {
printf("dprc_get_container_id() failed: %d\n", error);
goto error;
debug("fsl-mc: Container id=0x%x\n", container_id);
- error = dprc_open(dflt_mc_io, container_id, &dflt_dprc_handle);
+ error = dprc_open(dflt_mc_io, MC_CMD_NO_FLAGS, container_id,
+ &dflt_dprc_handle);
if (error < 0) {
printf("dprc_open() failed: %d\n", error);
goto error;
dprc_opened = true;
error = dprc_get_obj_count(dflt_mc_io,
- dflt_dprc_handle,
+ MC_CMD_NO_FLAGS, dflt_dprc_handle,
&num_child_objects);
if (error < 0) {
printf("dprc_get_obj_count() failed: %d\n", error);
}
error:
if (dprc_opened)
- dprc_close(dflt_mc_io, dflt_dprc_handle);
+ dprc_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dprc_handle);
return error;
}
int err;
if (get_mc_boot_status() == 0) {
- err = dpio_disable(dflt_mc_io, dflt_dpio_handle);
+ err = dpio_disable(dflt_mc_io, MC_CMD_NO_FLAGS,
+ dflt_dpio_handle);
if (err < 0) {
printf("dpio_disable() failed: %d\n", err);
return;
}
- err = dpio_reset(dflt_mc_io, dflt_dpio_handle);
+ err = dpio_reset(dflt_mc_io, MC_CMD_NO_FLAGS,
+ dflt_dpio_handle);
if (err < 0) {
printf("dpio_reset() failed: %d\n", err);
return;
}
- err = dpio_close(dflt_mc_io, dflt_dpio_handle);
+ err = dpio_close(dflt_mc_io, MC_CMD_NO_FLAGS,
+ dflt_dpio_handle);
if (err < 0) {
printf("dpio_close() failed: %d\n", err);
return;
#include <asm/io.h>
#define MC_CMD_HDR_READ_CMDID(_hdr) \
- ((uint16_t)u64_dec((_hdr), MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S))
+ ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S))
/**
* mc_send_command - Send MC command and wait for response
if (err)
goto err_bind;
- err = dpni_get_primary_mac_addr(dflt_mc_io, priv->dpni_handle,
- mac_addr);
+ err = dpni_get_primary_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, mac_addr);
if (err) {
printf("dpni_get_primary_mac_addr() failed\n");
return err;
priv->phydev->duplex = DUPLEX_FULL;
#endif
- err = dpni_enable(dflt_mc_io, priv->dpni_handle);
+ err = dpni_enable(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
if (err < 0) {
printf("dpni_enable() failed\n");
return err;
}
/* TODO: support multiple Rx flows */
- err = dpni_get_rx_flow(dflt_mc_io, priv->dpni_handle, 0, 0,
- &rx_queue_attr);
+ err = dpni_get_rx_flow(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle,
+ 0, 0, &rx_queue_attr);
if (err) {
printf("dpni_get_rx_flow() failed\n");
goto err_rx_flow;
priv->rx_dflt_fqid = rx_queue_attr.fqid;
- err = dpni_get_qdid(dflt_mc_io, priv->dpni_handle, &priv->tx_qdid);
+ err = dpni_get_qdid(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle,
+ &priv->tx_qdid);
if (err) {
printf("dpni_get_qdid() failed\n");
goto err_qdid;
err_qdid:
err_rx_flow:
- dpni_disable(dflt_mc_io, priv->dpni_handle);
+ dpni_disable(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
err_bind:
ldpaa_dpbp_free();
err_dpbp_setup:
- dpni_close(dflt_mc_io, priv->dpni_handle);
+ dpni_close(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
err_dpni_setup:
return err;
}
(net_dev->state == ETH_STATE_INIT))
return;
/* Stop Tx and Rx traffic */
- err = dpni_disable(dflt_mc_io, priv->dpni_handle);
+ err = dpni_disable(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
if (err < 0)
printf("dpni_disable() failed\n");
#endif
ldpaa_dpbp_free();
- dpni_reset(dflt_mc_io, priv->dpni_handle);
- dpni_close(dflt_mc_io, priv->dpni_handle);
+ dpni_reset(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
+ dpni_close(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
}
static void ldpaa_dpbp_drain_cnt(int count)
{
int err;
- err = dpbp_open(dflt_mc_io, dflt_dpbp->dpbp_attr.id,
+ err = dpbp_open(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_attr.id,
&dflt_dpbp->dpbp_handle);
if (err) {
printf("dpbp_open() failed\n");
goto err_open;
}
- err = dpbp_enable(dflt_mc_io, dflt_dpbp->dpbp_handle);
+ err = dpbp_enable(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle);
if (err) {
printf("dpbp_enable() failed\n");
goto err_enable;
}
- err = dpbp_get_attributes(dflt_mc_io, dflt_dpbp->dpbp_handle,
+ err = dpbp_get_attributes(dflt_mc_io, MC_CMD_NO_FLAGS,
+ dflt_dpbp->dpbp_handle,
&dflt_dpbp->dpbp_attr);
if (err) {
printf("dpbp_get_attributes() failed\n");
err_seed:
err_get_attr:
- dpbp_disable(dflt_mc_io, dflt_dpbp->dpbp_handle);
+ dpbp_disable(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle);
err_enable:
- dpbp_close(dflt_mc_io, dflt_dpbp->dpbp_handle);
+ dpbp_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle);
err_open:
return err;
}
static void ldpaa_dpbp_free(void)
{
ldpaa_dpbp_drain();
- dpbp_disable(dflt_mc_io, dflt_dpbp->dpbp_handle);
- dpbp_reset(dflt_mc_io, dflt_dpbp->dpbp_handle);
- dpbp_close(dflt_mc_io, dflt_dpbp->dpbp_handle);
+ dpbp_disable(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle);
+ dpbp_reset(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle);
+ dpbp_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle);
}
static int ldpaa_dpni_setup(struct ldpaa_eth_priv *priv)
int err;
/* and get a handle for the DPNI this interface is associate with */
- err = dpni_open(dflt_mc_io, priv->dpni_id, &priv->dpni_handle);
+ err = dpni_open(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_id,
+ &priv->dpni_handle);
if (err) {
printf("dpni_open() failed\n");
goto err_open;
}
- err = dpni_get_attributes(dflt_mc_io, priv->dpni_handle,
- &priv->dpni_attrs);
+ err = dpni_get_attributes(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, &priv->dpni_attrs);
if (err) {
printf("dpni_get_attributes() failed (err=%d)\n", err);
goto err_get_attr;
priv->buf_layout.pass_frame_status = true;
priv->buf_layout.private_data_size = LDPAA_ETH_SWA_SIZE;
/* ...rx, ... */
- err = dpni_set_rx_buffer_layout(dflt_mc_io, priv->dpni_handle,
- &priv->buf_layout);
+ err = dpni_set_rx_buffer_layout(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, &priv->buf_layout);
if (err) {
printf("dpni_set_rx_buffer_layout() failed");
goto err_buf_layout;
/* ... tx, ... */
priv->buf_layout.options &= ~DPNI_BUF_LAYOUT_OPT_PARSER_RESULT;
- err = dpni_set_tx_buffer_layout(dflt_mc_io, priv->dpni_handle,
- &priv->buf_layout);
+ err = dpni_set_tx_buffer_layout(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, &priv->buf_layout);
if (err) {
printf("dpni_set_tx_buffer_layout() failed");
goto err_buf_layout;
/* ... tx-confirm. */
priv->buf_layout.options &= ~DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE;
- err = dpni_set_tx_conf_buffer_layout(dflt_mc_io, priv->dpni_handle,
+ err = dpni_set_tx_conf_buffer_layout(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle,
&priv->buf_layout);
if (err) {
printf("dpni_set_tx_conf_buffer_layout() failed");
/* Now that we've set our tx buffer layout, retrieve the minimum
* required tx data offset.
*/
- err = dpni_get_tx_data_offset(dflt_mc_io, priv->dpni_handle,
- &priv->tx_data_offset);
+ err = dpni_get_tx_data_offset(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, &priv->tx_data_offset);
if (err) {
printf("dpni_get_tx_data_offset() failed\n");
goto err_data_offset;
err_data_offset:
err_buf_layout:
err_get_attr:
- dpni_close(dflt_mc_io, priv->dpni_handle);
+ dpni_close(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle);
err_open:
return err;
}
pools_params.num_dpbp = 1;
pools_params.pools[0].dpbp_id = (uint16_t)dflt_dpbp->dpbp_attr.id;
pools_params.pools[0].buffer_size = LDPAA_ETH_RX_BUFFER_SIZE;
- err = dpni_set_pools(dflt_mc_io, priv->dpni_handle, &pools_params);
+ err = dpni_set_pools(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle,
+ &pools_params);
if (err) {
printf("dpni_set_pools() failed\n");
return err;
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;
- err = dpni_set_tx_flow(dflt_mc_io, priv->dpni_handle,
+ err = dpni_set_tx_flow(dflt_mc_io, MC_CMD_NO_FLAGS, priv->dpni_handle,
&priv->tx_flow_id, &dflt_tx_flow);
if (err) {
printf("dpni_set_tx_flow() failed\n");
/* DPBP Version */
#define DPBP_VER_MAJOR 2
-#define DPBP_VER_MINOR 0
+#define DPBP_VER_MINOR 1
/* Command IDs */
#define DPBP_CMDID_CLOSE 0x800
#define DPBP_CMD_OPEN(cmd, dpbp_id) \
MC_CMD_OP(cmd, 0, 0, 32, int, dpbp_id)
-/* cmd, param, offset, width, type, arg_name */
+/* cmd, param, offset, width, type, arg_name */
#define DPBP_RSP_GET_ATTRIBUTES(cmd, attr) \
do { \
MC_RSP_OP(cmd, 0, 16, 16, uint16_t, attr->bpid); \
/**
* dpbp_open() - Open a control session for the specified object.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @dpbp_id: DPBP unique ID
* @token: Returned token; use in subsequent API calls
*
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token);
+int dpbp_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int dpbp_id,
+ uint16_t *token);
/**
* dpbp_close() - Close the control session of the object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPBP object
*
* After this function is called, no further operations are
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpbp_close(struct fsl_mc_io *mc_io, uint16_t token);
+int dpbp_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* dpbp_enable() - Enable the DPBP.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPBP object
*
* Return: '0' on Success; Error code otherwise.
*/
-
-int dpbp_enable(struct fsl_mc_io *mc_io, uint16_t token);
+int dpbp_enable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* dpbp_disable() - Disable the DPBP.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPBP object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpbp_disable(struct fsl_mc_io *mc_io, uint16_t token);
+int dpbp_disable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
+
+/**
+ * dpbp_is_enabled() - Check if the DPBP is enabled.
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPBP object
+ * @en: Returns '1' if object is enabled; '0' otherwise
+ *
+ * Return: '0' on Success; Error code otherwise.
+ */
+int dpbp_is_enabled(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ int *en);
/**
* dpbp_reset() - Reset the DPBP, returns the object to initial state.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPBP object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpbp_reset(struct fsl_mc_io *mc_io, uint16_t token);
+int dpbp_reset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
+
/**
* struct dpbp_attr - Structure representing DPBP attributes
uint16_t bpid;
};
-
/**
* dpbp_get_attributes - Retrieve DPBP attributes.
*
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPBP object
* @attr: Returned object's attributes
*
* Return: '0' on Success; Error code otherwise.
*/
int dpbp_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpbp_attr *attr);
/* DPIO Version */
#define DPIO_VER_MAJOR 3
-#define DPIO_VER_MINOR 0
+#define DPIO_VER_MINOR 1
/* Command IDs */
#define DPIO_CMDID_CLOSE 0x800
/**
* dpio_open() - Open a control session for the specified object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @dpio_id: DPIO unique ID
* @token: Returned token; use in subsequent API calls
*
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpio_open(struct fsl_mc_io *mc_io, int dpio_id, uint16_t *token);
+int dpio_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int dpio_id,
+ uint16_t *token);
/**
* dpio_close() - Close the control session of the object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPIO object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpio_close(struct fsl_mc_io *mc_io, uint16_t token);
+int dpio_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* enum dpio_channel_mode - DPIO notification channel mode
/**
* dpio_enable() - Enable the DPIO, allow I/O portal operations.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPIO object
*
* Return: '0' on Success; Error code otherwise
*/
-int dpio_enable(struct fsl_mc_io *mc_io, uint16_t token);
+int dpio_enable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* dpio_disable() - Disable the DPIO, stop any I/O portal operation.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPIO object
*
* Return: '0' on Success; Error code otherwise
*/
-int dpio_disable(struct fsl_mc_io *mc_io, uint16_t token);
+int dpio_disable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* dpio_reset() - Reset the DPIO, returns the object to initial state.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPIO object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpio_reset(struct fsl_mc_io *mc_io, uint16_t token);
+int dpio_reset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* struct dpio_attr - Structure representing DPIO attributes
/**
* dpio_get_attributes() - Retrieve DPIO attributes
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPIO object
* @attr: Returned object's attributes
*
* Return: '0' on Success; Error code otherwise
*/
int dpio_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpio_attr *attr);
/**
* Management Complex firmware version information
*/
-#define MC_VER_MAJOR 7
+#define MC_VER_MAJOR 8
#define MC_VER_MINOR 0
/**
* mc_get_version() - Retrieves the Management Complex firmware
* version information
* @mc_io: Pointer to opaque I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @mc_ver_info: Returned version information structure
*
* Return: '0' on Success; Error code otherwise.
*/
-int mc_get_version(struct fsl_mc_io *mc_io, struct mc_version *mc_ver_info);
+int mc_get_version(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ struct mc_version *mc_ver_info);
#endif /* __FSL_DPMNG_H */
/* DPNI Version */
#define DPNI_VER_MAJOR 5
-#define DPNI_VER_MINOR 0
+#define DPNI_VER_MINOR 1
/* Command IDs */
#define DPNI_CMDID_OPEN 0x801
MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dest_cfg.dest_id); \
MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->dest_cfg.priority);\
MC_CMD_OP(cmd, 0, 40, 2, enum dpni_dest, cfg->dest_cfg.dest_type);\
+ MC_CMD_OP(cmd, 0, 42, 1, int, cfg->order_preservation_en);\
MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id); \
MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx); \
MC_CMD_OP(cmd, 2, 16, 8, uint8_t, tc_id); \
MC_RSP_OP(cmd, 0, 0, 32, int, attr->dest_cfg.dest_id); \
MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->dest_cfg.priority);\
MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, attr->dest_cfg.dest_type); \
+ MC_CMD_OP(cmd, 0, 42, 1, int, attr->order_preservation_en);\
MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->user_ctx); \
MC_RSP_OP(cmd, 2, 32, 32, uint32_t, attr->fqid); \
MC_RSP_OP(cmd, 3, 0, 4, enum dpni_flc_type, attr->flc_cfg.flc_type); \
/**
* dpni_open() - Open a control session for the specified object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @dpni_id: DPNI unique ID
* @token: Returned token; use in subsequent API calls
*
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_open(struct fsl_mc_io *mc_io, int dpni_id, uint16_t *token);
+int dpni_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int dpni_id,
+ uint16_t *token);
/**
* dpni_close() - Close the control session of the object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
*
* After this function is called, no further operations are
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_close(struct fsl_mc_io *mc_io, uint16_t token);
+int dpni_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* struct dpni_ipr_cfg - Structure representing IP reassembly configuration
* struct pools - Buffer pools parameters
* @dpbp_id: DPBP object ID
* @buffer_size: Buffer size
+ * @backup_pool: Backup pool
*/
struct {
- int dpbp_id;
- uint16_t buffer_size;
+ int dpbp_id;
+ uint16_t buffer_size;
+ int backup_pool;
} pools[DPNI_MAX_DPBP];
};
/**
* dpni_set_pools() - Set buffer pools configuration
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @cfg: Buffer pools configuration
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_set_pools(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_pools_cfg *cfg);
/**
* dpni_enable() - Enable the DPNI, allow sending and receiving frames.
- * @mc_io: Pointer to MC portal's I/O object
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_enable(struct fsl_mc_io *mc_io, uint16_t token);
+int dpni_enable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* dpni_disable() - Disable the DPNI, stop sending and receiving frames.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_disable(struct fsl_mc_io *mc_io, uint16_t token);
+int dpni_disable(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
- * @dpni_reset() - Reset the DPNI, returns the object to initial state.
+ * dpni_reset() - Reset the DPNI, returns the object to initial state.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_reset(struct fsl_mc_io *mc_io, uint16_t token);
+int dpni_reset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* struct dpni_attr - Structure representing DPNI attributes
/**
* dpni_get_attributes() - Retrieve DPNI attributes.
- * @mc_io: Pointer to MC portal's I/O objec
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @attr: Returned object's attributes
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_attr *attr);
/**
* dpni_get_rx_buffer_layout() - Retrieve Rx buffer layout attributes.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @layout: Returns buffer layout attributes
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_buffer_layout *layout);
/**
* dpni_set_rx_buffer_layout() - Set Rx buffer layout configuration.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @layout: Buffer layout configuration
*
* @warning Allowed only when DPNI is disabled
*/
int dpni_set_rx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_buffer_layout *layout);
/**
* dpni_get_tx_buffer_layout() - Retrieve Tx buffer layout attributes.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @layout: Returns buffer layout attributes
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_tx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_buffer_layout *layout);
/**
* dpni_set_tx_buffer_layout() - Set Tx buffer layout configuration.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @layout: Buffer layout configuration
*
* @warning Allowed only when DPNI is disabled
*/
int dpni_set_tx_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_buffer_layout *layout);
* dpni_get_tx_conf_buffer_layout() - Retrieve Tx confirmation buffer layout
* attributes.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @layout: Returns buffer layout attributes
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_tx_conf_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dpni_buffer_layout *layout);
* dpni_set_tx_conf_buffer_layout() - Set Tx confirmation buffer layout
* configuration.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @layout: Buffer layout configuration
*
* @warning Allowed only when DPNI is disabled
*/
int dpni_set_tx_conf_buffer_layout(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dpni_buffer_layout *layout);
* dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used
* for enqueue operations
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @qdid: Returned virtual QDID value that should be used as an argument
* in all enqueue operations
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_get_qdid(struct fsl_mc_io *mc_io, uint16_t token, uint16_t *qdid);
+int dpni_get_qdid(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint16_t *qdid);
/**
* dpni_get_tx_data_offset() - Get the Tx data offset (from start of buffer)
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @data_offset: Tx data offset (from start of buffer)
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint16_t *data_offset);
/**
* dpni_get_counter() - Read a specific DPNI counter
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @counter: The requested counter
* @value: Returned counter's current value
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_counter(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
enum dpni_counter counter,
uint64_t *value);
/**
* dpni_set_counter() - Set (or clear) a specific DPNI counter
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @counter: The requested counter
* @value: New counter value; typically pass '0' for resetting
* Return: '0' on Success; Error code otherwise.
*/
int dpni_set_counter(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
enum dpni_counter counter,
uint64_t value);
/**
* dpni_set_link_cfg() - set the link configuration.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @cfg: Link configuration
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
- uint16_t token,
- const struct dpni_link_cfg *cfg);
+int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ const struct dpni_link_cfg *cfg);
/**
* struct dpni_link_state - Structure representing DPNI link state
/**
* dpni_get_link_state() - Return the link state (either up or down)
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @state: Returned link state;
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_get_link_state(struct fsl_mc_io *mc_io,
- uint16_t token,
- struct dpni_link_state *state);
+int dpni_get_link_state(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ struct dpni_link_state *state);
/**
* dpni_set_primary_mac_addr() - Set the primary MAC address
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @mac_addr: MAC address to set as primary address
*
* Return: '0' on Success; Error code otherwise.
*/
-int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
+int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const uint8_t mac_addr[6]);
/**
* dpni_get_primary_mac_addr() - Get the primary MAC address
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @mac_addr: Returned MAC address
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint8_t mac_addr[6]);
/**
* dpni_add_mac_addr() - Add MAC address filter
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @mac_addr: MAC address to add
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const uint8_t mac_addr[6]);
/**
* dpni_remove_mac_addr() - Remove MAC address filter
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @mac_addr: MAC address to remove
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const uint8_t mac_addr[6]);
* not applicable for Tx-conf/Err queues as the FD comes from the user
*/
#define DPNI_QUEUE_OPT_FLC 0x00000004
-
+/* Select to modify the queue's order preservation */
+#define DPNI_QUEUE_OPT_ORDER_PRESERVATION 0x00000008
/**
* struct dpni_queue_cfg - Structure representing queue configuration
* in the case of FS (flow-steering) the flow's FLC settings
* are used.
* valid only if 'DPNI_QUEUE_OPT_FLC' is contained in 'options'
+ * @order_preservation_en: enable/disable order preservation;
+ * valid only if 'DPNI_QUEUE_OPT_ORDER_PRESERVATION' is contained
+ * in 'options'
*/
struct dpni_queue_cfg {
uint32_t options;
uint64_t user_ctx;
struct dpni_dest_cfg dest_cfg;
struct dpni_flc_cfg flc_cfg;
+ int order_preservation_en;
};
/**
* dequeued frame
* @dest_cfg: Queue destination configuration
* @flc_cfg: Flow context configuration
+ * @order_preservation_en: enable/disable order preservation
* @fqid: Virtual fqid value to be used for dequeue operations
*/
struct dpni_queue_attr {
uint64_t user_ctx;
struct dpni_dest_cfg dest_cfg;
struct dpni_flc_cfg flc_cfg;
+ int order_preservation_en;
uint32_t fqid;
};
/**
* dpni_set_tx_flow() - Set Tx flow configuration
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @flow_id: Provides (or returns) the sender's flow ID;
* for each new sender set (*flow_id) to
* Return: '0' on Success; Error code otherwise.
*/
int dpni_set_tx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint16_t *flow_id,
const struct dpni_tx_flow_cfg *cfg);
/**
* dpni_get_tx_flow() - Get Tx flow attributes
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @flow_id: The sender's flow ID, as returned by the
* dpni_set_tx_flow() function
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_tx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint16_t flow_id,
struct dpni_tx_flow_attr *attr);
/**
* dpni_set_rx_flow() - Set Rx flow configuration
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @tc_id: Traffic class selection (0-7);
* use 'DPNI_ALL_TCS' to set all TCs and all flows
- * @flow_id Rx flow id within the traffic class; use
+ * @flow_id: Rx flow id within the traffic class; use
* 'DPNI_ALL_TC_FLOWS' to set all flows within
* this tc_id; ignored if tc_id is set to
* 'DPNI_ALL_TCS';
* Return: '0' on Success; Error code otherwise.
*/
int dpni_set_rx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint8_t tc_id,
uint16_t flow_id,
/**
* dpni_get_rx_flow() - Get Rx flow attributes
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @tc_id: Traffic class selection (0-7)
* @flow_id: Rx flow id within the traffic class
* Return: '0' on Success; Error code otherwise.
*/
int dpni_get_rx_flow(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
uint8_t tc_id,
uint16_t flow_id,
#define _FSL_DPRC_H
/* DPRC Version */
-#define DPRC_VER_MAJOR 4
+#define DPRC_VER_MAJOR 5
#define DPRC_VER_MINOR 0
/* Command IDs */
/* param, offset, width, type, arg_name */
#define DPRC_RSP_GET_OBJ_REGION(cmd, region_desc) \
do { \
- MC_RSP_OP(cmd, 1, 0, 64, uint64_t, region_desc->base_offset);\
+ MC_RSP_OP(cmd, 1, 0, 32, uint32_t, region_desc->base_offset);\
MC_RSP_OP(cmd, 2, 0, 32, uint32_t, region_desc->size); \
+ MC_RSP_OP(cmd, 2, 32, 4, enum dprc_region_type, region_desc->type);\
+ MC_RSP_OP(cmd, 3, 0, 32, uint32_t, region_desc->flags);\
} while (0)
/* cmd, param, offset, width, type, arg_name */
-#define DPRC_CMD_SET_OBJ_LABEL(cmd, obj_index, label) \
+#define DPRC_CMD_SET_OBJ_LABEL(cmd, obj_type, obj_id, label) \
do { \
- MC_CMD_OP(cmd, 0, 0, 32, int, obj_index); \
+ MC_CMD_OP(cmd, 0, 0, 32, int, obj_id); \
MC_CMD_OP(cmd, 1, 0, 8, char, label[0]);\
MC_CMD_OP(cmd, 1, 8, 8, char, label[1]);\
MC_CMD_OP(cmd, 1, 16, 8, char, label[2]);\
MC_CMD_OP(cmd, 2, 40, 8, char, label[13]);\
MC_CMD_OP(cmd, 2, 48, 8, char, label[14]);\
MC_CMD_OP(cmd, 2, 56, 8, char, label[15]);\
+ MC_CMD_OP(cmd, 3, 0, 8, char, obj_type[0]);\
+ MC_CMD_OP(cmd, 3, 8, 8, char, obj_type[1]);\
+ MC_CMD_OP(cmd, 3, 16, 8, char, obj_type[2]);\
+ MC_CMD_OP(cmd, 3, 24, 8, char, obj_type[3]);\
+ MC_CMD_OP(cmd, 3, 32, 8, char, obj_type[4]);\
+ MC_CMD_OP(cmd, 3, 40, 8, char, obj_type[5]);\
+ MC_CMD_OP(cmd, 3, 48, 8, char, obj_type[6]);\
+ MC_CMD_OP(cmd, 3, 56, 8, char, obj_type[7]);\
+ MC_CMD_OP(cmd, 4, 0, 8, char, obj_type[8]);\
+ MC_CMD_OP(cmd, 4, 8, 8, char, obj_type[9]);\
+ MC_CMD_OP(cmd, 4, 16, 8, char, obj_type[10]);\
+ MC_CMD_OP(cmd, 4, 24, 8, char, obj_type[11]);\
+ MC_CMD_OP(cmd, 4, 32, 8, char, obj_type[12]);\
+ MC_CMD_OP(cmd, 4, 40, 8, char, obj_type[13]);\
+ MC_CMD_OP(cmd, 4, 48, 8, char, obj_type[14]);\
+ MC_CMD_OP(cmd, 4, 56, 8, char, obj_type[15]);\
} while (0)
/* cmd, param, offset, width, type, arg_name */
-#define DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2) \
+#define DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2, cfg) \
do { \
MC_CMD_OP(cmd, 0, 0, 32, int, endpoint1->id); \
- MC_CMD_OP(cmd, 0, 32, 32, int, endpoint1->interface_id); \
+ MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint1->if_id); \
MC_CMD_OP(cmd, 1, 0, 32, int, endpoint2->id); \
- MC_CMD_OP(cmd, 1, 32, 32, int, endpoint2->interface_id); \
+ MC_CMD_OP(cmd, 1, 32, 16, uint16_t, endpoint2->if_id); \
MC_CMD_OP(cmd, 2, 0, 8, char, endpoint1->type[0]); \
MC_CMD_OP(cmd, 2, 8, 8, char, endpoint1->type[1]); \
MC_CMD_OP(cmd, 2, 16, 8, char, endpoint1->type[2]); \
MC_CMD_OP(cmd, 3, 40, 8, char, endpoint1->type[13]); \
MC_CMD_OP(cmd, 3, 48, 8, char, endpoint1->type[14]); \
MC_CMD_OP(cmd, 3, 56, 8, char, endpoint1->type[15]); \
+ MC_CMD_OP(cmd, 4, 0, 32, uint32_t, cfg->max_rate); \
+ MC_CMD_OP(cmd, 4, 32, 32, uint32_t, cfg->committed_rate); \
MC_CMD_OP(cmd, 5, 0, 8, char, endpoint2->type[0]); \
MC_CMD_OP(cmd, 5, 8, 8, char, endpoint2->type[1]); \
MC_CMD_OP(cmd, 5, 16, 8, char, endpoint2->type[2]); \
#define DPRC_CMD_DISCONNECT(cmd, endpoint) \
do { \
MC_CMD_OP(cmd, 0, 0, 32, int, endpoint->id); \
- MC_CMD_OP(cmd, 0, 32, 32, int, endpoint->interface_id); \
+ MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint->if_id); \
MC_CMD_OP(cmd, 1, 0, 8, char, endpoint->type[0]); \
MC_CMD_OP(cmd, 1, 8, 8, char, endpoint->type[1]); \
MC_CMD_OP(cmd, 1, 16, 8, char, endpoint->type[2]); \
#define DPRC_CMD_GET_CONNECTION(cmd, endpoint1) \
do { \
MC_CMD_OP(cmd, 0, 0, 32, int, endpoint1->id); \
- MC_CMD_OP(cmd, 0, 32, 32, int, endpoint1->interface_id); \
+ MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint1->if_id); \
MC_CMD_OP(cmd, 1, 0, 8, char, endpoint1->type[0]); \
MC_CMD_OP(cmd, 1, 8, 8, char, endpoint1->type[1]); \
MC_CMD_OP(cmd, 1, 16, 8, char, endpoint1->type[2]); \
MC_CMD_OP(cmd, 2, 56, 8, char, endpoint1->type[15]); \
} while (0)
-
/* cmd, param, offset, width, type, arg_name */
#define DPRC_RSP_GET_CONNECTION(cmd, endpoint2, state) \
do { \
MC_RSP_OP(cmd, 3, 0, 32, int, endpoint2->id); \
- MC_RSP_OP(cmd, 3, 32, 32, int, endpoint2->interface_id); \
+ MC_RSP_OP(cmd, 3, 32, 16, uint16_t, endpoint2->if_id); \
MC_RSP_OP(cmd, 4, 0, 8, char, endpoint2->type[0]); \
MC_RSP_OP(cmd, 4, 8, 8, char, endpoint2->type[1]); \
MC_RSP_OP(cmd, 4, 16, 8, char, endpoint2->type[2]); \
/**
* dprc_get_container_id() - Get container ID associated with a given portal.
- * @mc_io: Pointer to MC portal's I/O object
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @container_id: Requested container ID
*
* Return: '0' on Success; Error code otherwise.
*/
-int dprc_get_container_id(struct fsl_mc_io *mc_io, int *container_id);
+int dprc_get_container_id(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int *container_id);
/**
* dprc_open() - Open DPRC object for use
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @container_id: Container ID to open
* @token: Returned token of DPRC object
*
*
* @warning Required before any operation on the object.
*/
-int dprc_open(struct fsl_mc_io *mc_io, int container_id, uint16_t *token);
+int dprc_open(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ int container_id,
+ uint16_t *token);
/**
* dprc_close() - Close the control session of the object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
*
* After this function is called, no further operations are
*
* Return: '0' on Success; Error code otherwise.
*/
-int dprc_close(struct fsl_mc_io *mc_io, uint16_t token);
+int dprc_close(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token);
/**
* Container general options
/**
* dprc_reset_container - Reset child container.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @child_container_id: ID of the container to reset
*
*
* Return: '0' on Success; Error code otherwise.
*/
-int dprc_reset_container(struct fsl_mc_io *mc_io,
- uint16_t token,
- int child_container_id);
+int dprc_reset_container(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ int child_container_id);
/**
* struct dprc_attributes - Container attributes
/**
* dprc_get_attributes() - Obtains container attributes
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
- * @attributes Returned container attributes
+ * @attributes: Returned container attributes
*
* Return: '0' on Success; Error code otherwise.
*/
int dprc_get_attributes(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
struct dprc_attributes *attributes);
/**
* dprc_get_obj_count() - Obtains the number of objects in the DPRC
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @obj_count: Number of objects assigned to the DPRC
*
* Return: '0' on Success; Error code otherwise.
*/
-int dprc_get_obj_count(struct fsl_mc_io *mc_io, uint16_t token, int *obj_count);
+int dprc_get_obj_count(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ int *obj_count);
/* Objects Attributes Flags */
/**
* dprc_get_obj() - Get general information on an object
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @obj_index: Index of the object to be queried (< obj_count)
* @obj_desc: Returns the requested object descriptor
* Return: '0' on Success; Error code otherwise.
*/
int dprc_get_obj(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
int obj_index,
struct dprc_obj_desc *obj_desc);
* dprc_get_res_count() - Obtains the number of free resources that are
* assigned to this container, by pool type
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @type: pool type
* @res_count: Returned number of free resources of the given
*
* Return: '0' on Success; Error code otherwise.
*/
-int dprc_get_res_count(struct fsl_mc_io *mc_io,
+int dprc_get_res_count(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
char *type,
int *res_count);
/**
* dprc_get_res_ids() - Obtains IDs of free resources in the container
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @type: pool type
* @range_desc: range descriptor
* Return: '0' on Success; Error code otherwise.
*/
int dprc_get_res_ids(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
char *type,
struct dprc_res_ids_range_desc *range_desc);
+/* Region flags */
+/* Cacheable - Indicates that region should be mapped as cacheable */
+#define DPRC_REGION_CACHEABLE 0x00000001
+
+/**
+ * enum dprc_region_type - Region type
+ * @DPRC_REGION_TYPE_MC_PORTAL: MC portal region
+ * @DPRC_REGION_TYPE_QBMAN_PORTAL: Qbman portal region
+ */
+enum dprc_region_type {
+ DPRC_REGION_TYPE_MC_PORTAL,
+ DPRC_REGION_TYPE_QBMAN_PORTAL
+};
+
/**
* struct dprc_region_desc - Mappable region descriptor
* @base_offset: Region offset from region's base address.
* base address; For DPIO, region base is offset from SoC QMan portals
* base address
* @size: Region size (in bytes)
+ * @flags: Region attributes
+ * @type: Portal region type
*/
struct dprc_region_desc {
- uint64_t base_offset;
+ uint32_t base_offset;
uint32_t size;
+ uint32_t flags;
+ enum dprc_region_type type;
};
/**
* dprc_get_obj_region() - Get region information for a specified object.
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
- * @obj_type; Object type as returned in dprc_get_obj()
+ * @obj_type: Object type as returned in dprc_get_obj()
* @obj_id: Unique object instance as returned in dprc_get_obj()
* @region_index: The specific region to query
* @region_desc: Returns the requested region descriptor
* Return: '0' on Success; Error code otherwise.
*/
int dprc_get_obj_region(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
char *obj_type,
int obj_id,
* operations
* @type: Endpoint object type: NULL terminated string
* @id: Endpoint object ID
- * @interface_id: Interface ID; should be set for endpoints with multiple
+ * @if_id: Interface ID; should be set for endpoints with multiple
* interfaces ("dpsw", "dpdmux"); for others, always set to 0
*/
struct dprc_endpoint {
- char type[16];
- int id;
- int interface_id;
+ char type[16];
+ int id;
+ uint16_t if_id;
+};
+
+/**
+ * struct dprc_connection_cfg - Connection configuration.
+ * Used for virtual connections only
+ * @committed_rate: Committed rate (Mbits/s)
+ * @max_rate: Maximum rate (Mbits/s)
+ */
+struct dprc_connection_cfg {
+ uint32_t committed_rate;
+ uint32_t max_rate;
};
/**
* dprc_connect() - Connect two endpoints to create a network link between them
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @endpoint1: Endpoint 1 configuration parameters
* @endpoint2: Endpoint 2 configuration parameters
+ * @cfg: Connection configuration. The connection configuration is ignored for
+ * connections made to DPMAC objects, where rate is retrieved from the
+ * MAC configuration.
*
* Return: '0' on Success; Error code otherwise.
*/
-int dprc_connect(struct fsl_mc_io *mc_io,
- uint16_t token,
- const struct dprc_endpoint *endpoint1,
- const struct dprc_endpoint *endpoint2);
+int dprc_connect(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ const struct dprc_endpoint *endpoint1,
+ const struct dprc_endpoint *endpoint2,
+ const struct dprc_connection_cfg *cfg);
/**
* dprc_disconnect() - Disconnect one endpoint to remove its network connection
* @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPRC object
* @endpoint: Endpoint configuration parameters
*
* Return: '0' on Success; Error code otherwise.
*/
int dprc_disconnect(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dprc_endpoint *endpoint);
/**
* dprc_get_connection() - Get connected endpoint and link status if connection
* exists.
-* @mc_io Pointer to MC portal's I/O object
-* @token Token of DPRC object
-* @endpoint1 Endpoint 1 configuration parameters
-* @endpoint2 Returned endpoint 2 configuration parameters
+* @mc_io: Pointer to MC portal's I/O object
+* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+* @token: Token of DPRC object
+* @endpoint1: Endpoint 1 configuration parameters
+* @endpoint2: Returned endpoint 2 configuration parameters
* @state: Returned link state: 1 - link is up, 0 - link is down
*
* Return: '0' on Success; -ENAVAIL if connection does not exist.
*/
int dprc_get_connection(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
uint16_t token,
const struct dprc_endpoint *endpoint1,
struct dprc_endpoint *endpoint2,
#define MAKE_UMASK64(_width) \
((uint64_t)((_width) < 64 ? ((uint64_t)1 << (_width)) - 1 : -1))
-static inline uint64_t u64_enc(int lsoffset, int width, uint64_t val)
+static inline uint64_t mc_enc(int lsoffset, int width, uint64_t val)
{
return (uint64_t)(((uint64_t)val & MAKE_UMASK64(width)) << lsoffset);
}
-static inline uint64_t u64_dec(uint64_t val, int lsoffset, int width)
+static inline uint64_t mc_dec(uint64_t val, int lsoffset, int width)
{
return (uint64_t)((val >> lsoffset) & MAKE_UMASK64(width));
}
MC_CMD_STATUS_INVALID_STATE = 0xC /*!< Invalid state */
};
+/*
+ * MC command flags
+ */
+
+/* High priority flag */
+#define MC_CMD_FLAG_PRI 0x00008000
+/* No flags */
+#define MC_CMD_NO_FLAGS 0x00000000
+/* Command completion flag */
+#define MC_CMD_FLAG_INTR_DIS 0x01000000
+
+
#define MC_CMD_HDR_CMDID_O 52 /* Command ID field offset */
#define MC_CMD_HDR_CMDID_S 12 /* Command ID field size */
#define MC_CMD_HDR_STATUS_O 16 /* Status field offset */
#define MC_CMD_HDR_TOKEN_O 38 /* Token field offset */
#define MC_CMD_HDR_TOKEN_S 10 /* Token field size */
#define MC_CMD_HDR_STATUS_S 8 /* Status field size*/
-#define MC_CMD_HDR_PRI_O 15 /* Priority field offset */
-#define MC_CMD_HDR_PRI_S 1 /* Priority field size */
+#define MC_CMD_HDR_FLAGS_O 0 /* Flags field offset */
+#define MC_CMD_HDR_FLAGS_S 32 /* Flags field size*/
+#define MC_CMD_HDR_FLAGS_MASK 0xFF00FF00 /* Command flags mask */
#define MC_CMD_HDR_READ_STATUS(_hdr) \
- ((enum mc_cmd_status)u64_dec((_hdr), \
+ ((enum mc_cmd_status)mc_dec((_hdr), \
MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S))
#define MC_CMD_HDR_READ_TOKEN(_hdr) \
- ((uint16_t)u64_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S))
-
-#define MC_CMD_PRI_LOW 0 /*!< Low Priority command indication */
-#define MC_CMD_PRI_HIGH 1 /*!< High Priority command indication */
+ ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S))
#define MC_EXT_OP(_ext, _param, _offset, _width, _type, _arg) \
- ((_ext)[_param] |= u64_enc((_offset), (_width), _arg))
+ ((_ext)[_param] |= mc_enc((_offset), (_width), _arg))
#define MC_CMD_OP(_cmd, _param, _offset, _width, _type, _arg) \
- ((_cmd).params[_param] |= u64_enc((_offset), (_width), _arg))
+ ((_cmd).params[_param] |= mc_enc((_offset), (_width), _arg))
#define MC_RSP_OP(_cmd, _param, _offset, _width, _type, _arg) \
- (_arg = (_type)u64_dec(_cmd.params[_param], (_offset), (_width)))
+ (_arg = (_type)mc_dec(_cmd.params[_param], (_offset), (_width)))
static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id,
- uint8_t priority,
+ uint32_t cmd_flags,
uint16_t token)
{
uint64_t hdr;
- hdr = u64_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id);
- hdr |= u64_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token);
- hdr |= u64_enc(MC_CMD_HDR_PRI_O, MC_CMD_HDR_PRI_S, priority);
- hdr |= u64_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S,
+ hdr = mc_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id);
+ hdr |= mc_enc(MC_CMD_HDR_FLAGS_O, MC_CMD_HDR_FLAGS_S,
+ (cmd_flags & MC_CMD_HDR_FLAGS_MASK));
+ hdr |= mc_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token);
+ hdr |= mc_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S,
MC_CMD_STATUS_READY);
return hdr;
return status;
}
-int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd);
-
#endif /* __FSL_MC_CMD_H */