MC firmware is the core component of FSLMC bus and DPAA2 devices.
Prior to this patch, MC firmware supported 10.10.x version. This
patch bumps the min supported version to 10.14.x.
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
* Management Complex firmware version information
*/
#define MC_VER_MAJOR 10
-#define MC_VER_MINOR 10
+#define MC_VER_MINOR 14
/**
* struct mc_version
DPNI_CONG_OPT_WRITE_MEM_ON_ENTER |
DPNI_CONG_OPT_WRITE_MEM_ON_EXIT |
DPNI_CONG_OPT_COHERENT_WRITE;
+ cong_notif_cfg.cg_point = DPNI_CP_QUEUE;
ret = dpni_set_congestion_notification(dpni, CMD_PRI_LOW,
priv->token,
cmd_params->vlan_filter_entries = cfg->vlan_filter_entries;
cmd_params->qos_entries = cfg->qos_entries;
cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries);
+ cmd_params->num_cgs = cfg->num_cgs;
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
attr->qos_key_size = rsp_params->qos_key_size;
attr->fs_key_size = rsp_params->fs_key_size;
attr->wriop_version = le16_to_cpu(rsp_params->wriop_version);
+ attr->num_cgs = rsp_params->num_cgs;
return 0;
}
cmd_params = (struct dpni_cmd_set_congestion_notification *)cmd.params;
cmd_params->qtype = qtype;
cmd_params->tc = tc_id;
+ cmd_params->congestion_point = cfg->cg_point;
+ cmd_params->cgid = (uint8_t)cfg->cgid;
cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id);
cmd_params->notification_mode = cpu_to_le16(cfg->notification_mode);
cmd_params->dest_priority = cfg->dest_cfg.priority;
cmd_params = (struct dpni_cmd_get_congestion_notification *)cmd.params;
cmd_params->qtype = qtype;
cmd_params->tc = tc_id;
+ cmd_params->congestion_point = cfg->cg_point;
+ cmd_params->cgid = cfg->cgid;
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
queue->destination.hold_active);
cmd_params->flc = cpu_to_le64(queue->flc.value);
cmd_params->user_context = cpu_to_le64(queue->user_context);
+ cmd_params->cgid = queue->cgid;
/* send command to mc */
return mc_send_command(mc_io, &cmd);
queue->user_context = le64_to_cpu(rsp_params->user_context);
qid->fqid = le32_to_cpu(rsp_params->fqid);
qid->qdbin = le16_to_cpu(rsp_params->qdbin);
+ if (dpni_get_field(rsp_params->flags, CGID_VALID))
+ queue->cgid = rsp_params->cgid;
+ else
+ queue->cgid = -1;
return 0;
}
uint32_t cmd_flags,
uint16_t token,
uint8_t page,
- uint8_t param,
+ uint16_t param,
union dpni_statistics *stat)
{
struct mc_command cmd = { 0 };
* All Tx traffic classes will use a single sender (ignore num_queueus for tx)
*/
#define DPNI_OPT_SINGLE_SENDER 0x000100
+/**
+ * Define a custom number of congestion groups
+ */
+#define DPNI_OPT_CUSTOM_CG 0x000200
int dpni_open(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint8_t num_tcs;
uint8_t num_rx_tcs;
uint8_t qos_entries;
+ uint8_t num_cgs;
};
int dpni_create(struct fsl_mc_io *mc_io,
uint8_t qos_key_size;
uint8_t fs_key_size;
uint16_t wriop_version;
+ uint8_t num_cgs;
};
int dpni_get_attributes(struct fsl_mc_io *mc_io,
*/
#define DPNI_LINK_OPT_PFC_PAUSE 0x0000000000000010ULL
+/**
+ * Advertise 10MB full duplex
+ */
+#define DPNI_ADVERTISED_10BASET_FULL 0x0000000000000001ULL
+/**
+ * Advertise 100MB full duplex
+ */
+#define DPNI_ADVERTISED_100BASET_FULL 0x0000000000000002ULL
+/**
+ * Advertise 1GB full duplex
+ */
+#define DPNI_ADVERTISED_1000BASET_FULL 0x0000000000000004ULL
+/**
+ * Advertise auto-negotiation enable
+ */
+#define DPNI_ADVERTISED_AUTONEG 0x0000000000000008ULL
+/**
+ * Advertise 10GB full duplex
+ */
+#define DPNI_ADVERTISED_10000BASET_FULL 0x0000000000000010ULL
+/**
+ * Advertise 2.5GB full duplex
+ */
+#define DPNI_ADVERTISED_2500BASEX_FULL 0x0000000000000020ULL
+/**
+ * Advertise 5GB full duplex
+ */
+#define DPNI_ADVERTISED_5000BASET_FULL 0x0000000000000040ULL
+
+
/**
* struct - Structure representing DPNI link configuration
* @rate: Rate
uint32_t rate;
uint64_t options;
int up;
- int state_valid;
+ int state_valid;
uint64_t supported;
uint64_t advertising;
};
DPNI_CONGESTION_UNIT_FRAMES
};
-
/**
* enum dpni_dest - DPNI destination types
* @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and
*/
#define DPNI_CONG_OPT_FLOW_CONTROL 0x00000040
+/**
+ * enum dpni_congestion_point - Structure representing congestion point
+ * @DPNI_CP_QUEUE: Set congestion per queue, identified by QUEUE_TYPE, TC
+ * and QUEUE_INDEX
+ * @DPNI_CP_GROUP: Set congestion per queue group. Depending on options
+ * used to define the DPNI this can be either per
+ * TC (default) or per interface
+ * (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
+ * QUEUE_INDEX is ignored if this type is used.
+ * @DPNI_CP_CONGESTION_GROUP: Set per congestion group id. This will work
+ * only if the DPNI is created with DPNI_OPT_CUSTOM_CG option
+ */
+
+enum dpni_congestion_point {
+ DPNI_CP_QUEUE,
+ DPNI_CP_GROUP,
+ DPNI_CP_CONGESTION_GROUP,
+};
+
/**
* struct dpni_congestion_notification_cfg - congestion notification
* configuration
* contained in 'options'
* @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel
* @notification_mode: Mask of available options; use 'DPNI_CONG_OPT_<X>' values
+ * @cg_point: Congestion point settings
+ * @cgid: id of the congestion group. The index is relative to dpni.
*/
struct dpni_congestion_notification_cfg {
uint64_t message_iova;
struct dpni_dest_cfg dest_cfg;
uint16_t notification_mode;
+ enum dpni_congestion_point cg_point;
+ int cgid;
};
int dpni_set_congestion_notification(struct fsl_mc_io *mc_io,
* FD[OFFSET].
* For more details check the Frame Descriptor section in the
* hardware documentation.
+ *@cgid :indicate the cgid to set relative to dpni
*/
struct dpni_queue {
struct {
uint64_t value;
char stash_control;
} flc;
+ int cgid;
};
/**
*/
#define DPNI_QUEUE_OPT_HOLD_ACTIVE 0x00000008
+#define DPNI_QUEUE_OPT_SET_CGID 0x00000040
+#define DPNI_QUEUE_OPT_CLEAR_CGID 0x00000080
+
int dpni_set_queue(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
uint32_t cmd_flags,
uint16_t token,
uint8_t page,
- uint8_t param,
+ uint16_t param,
union dpni_statistics *stat);
int dpni_reset_statistics(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token);
-/**
- * enum dpni_congestion_point - Structure representing congestion point
- * @DPNI_CP_QUEUE: Set taildrop per queue, identified by QUEUE_TYPE, TC and
- * QUEUE_INDEX
- * @DPNI_CP_GROUP: Set taildrop per queue group. Depending on options used
- * to define the DPNI this can be either per
- * TC (default) or per interface
- * (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
- * QUEUE_INDEX is ignored if this type is used.
- */
-enum dpni_congestion_point {
- DPNI_CP_QUEUE,
- DPNI_CP_GROUP,
-};
-
/**
* struct dpni_taildrop - Structure representing the taildrop
* @enable: Indicates whether the taildrop is active or not.
/* DPNI Version */
#define DPNI_VER_MAJOR 7
-#define DPNI_VER_MINOR 8
+#define DPNI_VER_MINOR 9
#define DPNI_CMD_BASE_VERSION 1
#define DPNI_CMD_VERSION_2 2
/* Command IDs */
#define DPNI_CMDID_OPEN DPNI_CMD(0x801)
#define DPNI_CMDID_CLOSE DPNI_CMD(0x800)
-#define DPNI_CMDID_CREATE DPNI_CMD_V2(0x901)
+#define DPNI_CMDID_CREATE DPNI_CMD_V3(0x901)
#define DPNI_CMDID_DESTROY DPNI_CMD(0x981)
#define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01)
#define DPNI_CMDID_ENABLE DPNI_CMD(0x002)
#define DPNI_CMDID_DISABLE DPNI_CMD(0x003)
-#define DPNI_CMDID_GET_ATTR DPNI_CMD_V2(0x004)
+#define DPNI_CMDID_GET_ATTR DPNI_CMD_V3(0x004)
#define DPNI_CMDID_RESET DPNI_CMD(0x005)
#define DPNI_CMDID_IS_ENABLED DPNI_CMD(0x006)
#define DPNI_CMDID_REMOVE_FS_ENT DPNI_CMD(0x245)
#define DPNI_CMDID_CLR_FS_ENT DPNI_CMD(0x246)
-#define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V2(0x25D)
+#define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V3(0x25D)
#define DPNI_CMDID_RESET_STATISTICS DPNI_CMD(0x25E)
-#define DPNI_CMDID_GET_QUEUE DPNI_CMD(0x25F)
-#define DPNI_CMDID_SET_QUEUE DPNI_CMD(0x260)
+#define DPNI_CMDID_GET_QUEUE DPNI_CMD_V2(0x25F)
+#define DPNI_CMDID_SET_QUEUE DPNI_CMD_V2(0x260)
#define DPNI_CMDID_GET_TAILDROP DPNI_CMD_V2(0x261)
#define DPNI_CMDID_SET_TAILDROP DPNI_CMD_V2(0x262)
#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD_V2(0x264)
#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD_V2(0x265)
-#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD(0x267)
-#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD(0x268)
+#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD_V2(0x267)
+#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD_V2(0x268)
#define DPNI_CMDID_SET_EARLY_DROP DPNI_CMD_V2(0x269)
#define DPNI_CMDID_GET_EARLY_DROP DPNI_CMD_V2(0x26A)
#define DPNI_CMDID_GET_OFFLOAD DPNI_CMD(0x26B)
uint8_t pad3;
uint16_t fs_entries;
uint8_t num_rx_tcs;
+ uint8_t pad4;
+ uint8_t num_cgs;
};
struct dpni_cmd_destroy {
uint8_t qos_key_size;
uint8_t fs_key_size;
uint16_t wriop_version;
+ uint8_t num_cgs;
};
#define DPNI_ERROR_ACTION_SHIFT 0
struct dpni_cmd_get_statistics {
uint8_t page_number;
- uint8_t param;
+ uint16_t param;
};
struct dpni_rsp_get_statistics {
#define DPNI_DEST_TYPE_SHIFT 0
#define DPNI_DEST_TYPE_SIZE 4
+#define DPNI_CGID_VALID_SHIFT 5
+#define DPNI_CGID_VALID_SIZE 1
#define DPNI_STASH_CTRL_SHIFT 6
#define DPNI_STASH_CTRL_SIZE 1
#define DPNI_HOLD_ACTIVE_SHIFT 7
uint32_t dest_id;
uint16_t pad1;
uint8_t dest_prio;
- /* From LSB: dest_type:4, pad:2, flc_stash_ctrl:1, hold_active:1 */
+ /* From LSB:
+ * dest_type:4, pad:1, cgid_valid:1, flc_stash_ctrl:1, hold_active:1
+ */
uint8_t flags;
/* response word 2 */
uint64_t flc;
/* response word 4 */
uint32_t fqid;
uint16_t qdbin;
+ uint16_t pad2;
+ /* response word 5*/
+ uint8_t cgid;
};
struct dpni_cmd_set_queue {
uint64_t flc;
/* cmd word 3 */
uint64_t user_context;
+ /* cmd word 4 */
+ uint8_t cgid;
};
#define DPNI_DISCARD_ON_MISS_SHIFT 0
struct dpni_cmd_set_congestion_notification {
uint8_t qtype;
uint8_t tc;
- uint8_t pad[6];
+ uint8_t pad;
+ uint8_t congestion_point;
+ uint8_t cgid;
+ uint8_t pad2[3];
uint32_t dest_id;
uint16_t notification_mode;
uint8_t dest_priority;
struct dpni_cmd_get_congestion_notification {
uint8_t qtype;
uint8_t tc;
+ uint8_t pad;
+ uint8_t congestion_point;
+ uint8_t cgid;
};
struct dpni_rsp_get_congestion_notification {