/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018 NXP
+ * Copyright 2018-2021 NXP
*/
#include <fsl_mc_sys.h>
cmd_params->num_queues = cfg->num_queues;
cmd_params->priorities[0] = cfg->priorities[0];
cmd_params->priorities[1] = cfg->priorities[1];
+ cmd_params->options = cpu_to_le32(cfg->adv.options);
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
attr->id = le32_to_cpu(rsp_params->id);
attr->num_of_priorities = rsp_params->num_of_priorities;
attr->num_of_queues = rsp_params->num_of_queues;
+ attr->options = le32_to_cpu(rsp_params->options);
return 0;
}
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018 NXP
+ * Copyright 2018-2021 NXP
*/
#ifndef __FSL_DPDMAI_H
uint32_t cmd_flags,
uint16_t token);
+/* DPDMAI options */
+
+/**
+ * Enable individual Congestion Groups usage per each priority queue
+ * If this option is not enabled then only one CG is used for all priority
+ * queues
+ * If this option is enabled then a separate specific CG is used for each
+ * individual priority queue.
+ * In this case the priority queue must be specified via congestion notification
+ * API
+ */
+#define DPDMAI_OPT_CG_PER_PRIORITY 0x00000001
+
/**
* struct dpdmai_cfg - Structure representing DPDMAI configuration
* @priorities: Priorities for the DMA hardware processing; valid priorities are
* configured with values 1-8; the entry following last valid entry
* should be configured with 0
+ * @options: dpdmai options
*/
struct dpdmai_cfg {
uint8_t num_queues;
uint8_t priorities[DPDMAI_PRIO_NUM];
+ struct {
+ uint32_t options;
+ } adv;
};
int dpdmai_create(struct fsl_mc_io *mc_io,
* struct dpdmai_attr - Structure representing DPDMAI attributes
* @id: DPDMAI object ID
* @num_of_priorities: number of priorities
+ * @options: dpdmai options
*/
struct dpdmai_attr {
int id;
uint8_t num_of_priorities;
uint8_t num_of_queues;
+ uint32_t options;
};
__rte_internal
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018 NXP
+ * Copyright 2017-2018, 2020-2021 NXP
*/
-
#ifndef _FSL_DPDMAI_CMD_H
#define _FSL_DPDMAI_CMD_H
/* DPDMAI Version */
#define DPDMAI_VER_MAJOR 3
-#define DPDMAI_VER_MINOR 3
+#define DPDMAI_VER_MINOR 4
/* Command versioning */
#define DPDMAI_CMD_BASE_VERSION 1
#define DPDMAI_CMD_VERSION_2 2
+#define DPDMAI_CMD_VERSION_3 3
#define DPDMAI_CMD_ID_OFFSET 4
#define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION)
#define DPDMAI_CMD_V2(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_2)
+#define DPDMAI_CMD_V3(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_3)
/* Command IDs */
#define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x800)
#define DPDMAI_CMDID_OPEN DPDMAI_CMD(0x80E)
-#define DPDMAI_CMDID_CREATE DPDMAI_CMD_V2(0x90E)
+#define DPDMAI_CMDID_CREATE DPDMAI_CMD_V3(0x90E)
#define DPDMAI_CMDID_DESTROY DPDMAI_CMD(0x98E)
#define DPDMAI_CMDID_GET_API_VERSION DPDMAI_CMD(0xa0E)
#define DPDMAI_CMDID_ENABLE DPDMAI_CMD(0x002)
#define DPDMAI_CMDID_DISABLE DPDMAI_CMD(0x003)
-#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD_V2(0x004)
+#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD_V3(0x004)
#define DPDMAI_CMDID_RESET DPDMAI_CMD(0x005)
#define DPDMAI_CMDID_IS_ENABLED DPDMAI_CMD(0x006)
struct dpdmai_cmd_create {
uint8_t num_queues;
uint8_t priorities[2];
+ uint8_t pad;
+ uint32_t options;
};
struct dpdmai_cmd_destroy {
uint32_t id;
uint8_t num_of_priorities;
uint8_t num_of_queues;
+ uint16_t pad;
+ uint32_t options;
};
#define DPDMAI_DEST_TYPE_SHIFT 0
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2015 Freescale Semiconductor Inc.
- * Copyright 2017-2019 NXP
+ * Copyright 2017-2021 NXP
*
*/
#ifndef __FSL_DPMNG_H
* Management Complex firmware version information
*/
#define MC_VER_MAJOR 10
-#define MC_VER_MINOR 18
+#define MC_VER_MINOR 28
/**
* struct mc_version
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2015 Freescale Semiconductor Inc.
- * Copyright 2018 NXP
+ * Copyright 2018-2021 NXP
*
*/
#ifndef __FSL_DPOPR_H_
* Retire an existing Order Point Record option
*/
#define OPR_OPT_RETIRE 0x2
-
+/**
+ * Assign an existing Order Point Record to a queue
+ */
+#define OPR_OPT_ASSIGN 0x4
/**
* struct opr_cfg - Structure representing OPR configuration
* @oprrws: Order point record (OPR) restoration window size (0 to 5)
ret = dpni_set_opr(dpni, CMD_PRI_LOW, eth_priv->token,
dpaa2_ethq->tc_index, flow_id,
- OPR_OPT_CREATE, &ocfg);
+ OPR_OPT_CREATE, &ocfg, 0);
if (ret) {
DPAA2_PMD_ERR("Error setting opr: ret: %d\n", ret);
return ret;
return mc_send_command(mc_io, &cmd);
}
+/**
+ * dpdmux_get_max_frame_length() - Return the maximum frame length for DPDMUX
+ * interface
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPDMUX object
+ * @if_id: Interface id
+ * @max_frame_length: maximum frame length
+ *
+ * When dpdmux object is in VEPA mode this function will ignore if_id parameter
+ * and will return maximum frame length for uplink interface (if_id==0).
+ *
+ * Return: '0' on Success; Error code otherwise.
+ */
+int dpdmux_get_max_frame_length(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint16_t if_id,
+ uint16_t *max_frame_length)
+{
+ struct mc_command cmd = { 0 };
+ struct dpdmux_cmd_get_max_frame_len *cmd_params;
+ struct dpdmux_rsp_get_max_frame_len *rsp_params;
+ int err = 0;
+
+ /* prepare command */
+ cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_GET_MAX_FRAME_LENGTH,
+ cmd_flags,
+ token);
+ cmd_params = (struct dpdmux_cmd_get_max_frame_len *)cmd.params;
+ cmd_params->if_id = cpu_to_le16(if_id);
+
+ err = mc_send_command(mc_io, &cmd);
+ if (err)
+ return err;
+
+ rsp_params = (struct dpdmux_rsp_get_max_frame_len *)cmd.params;
+ *max_frame_length = le16_to_cpu(rsp_params->max_len);
+
+ /* send command to mc*/
+ return err;
+}
+
/**
* dpdmux_ul_reset_counters() - Function resets the uplink counter
* @mc_io: Pointer to MC portal's I/O object
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2016-2020 NXP
+ * Copyright 2016-2021 NXP
*
*/
#include <fsl_mc_sys.h>
cmd_params->qos_entries = cfg->qos_entries;
cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries);
cmd_params->num_cgs = cfg->num_cgs;
+ cmd_params->num_opr = cfg->num_opr;
+ cmd_params->dist_key_size = cfg->dist_key_size;
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
cmd_params->options = cpu_to_le16(action->options);
cmd_params->flow_id = cpu_to_le16(action->flow_id);
cmd_params->flc = cpu_to_le64(action->flc);
+ cmd_params->redir_token = cpu_to_le16(action->redirect_obj_token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
/**
- * dpni_set_taildrop() - Set taildrop per queue or TC
+ * dpni_set_taildrop() - Set taildrop per congestion group
*
* Setting a per-TC taildrop (cg_point = DPNI_CP_GROUP) will reset any current
* congestion notification or early drop (WRED) configuration previously applied
* @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
- * @cg_point: Congestion point, DPNI_CP_QUEUE is only supported in
+ * @cg_point: Congestion group identifier DPNI_CP_QUEUE is only supported in
* combination with DPNI_QUEUE_RX.
* @q_type: Queue type, can be DPNI_QUEUE_RX or DPNI_QUEUE_TX.
* @tc: Traffic class to apply this taildrop to
- * @q_index: Index of the queue if the DPNI supports multiple queues for
+ * @index/cgid: Index of the queue if the DPNI supports multiple queues for
* traffic distribution.
- * Ignored if CONGESTION_POINT is not DPNI_CP_QUEUE.
+ * If CONGESTION_POINT is DPNI_CP_CONGESTION_GROUP then it
+ * represent the cgid of the congestion point
* @taildrop: Taildrop structure
*
* Return: '0' on Success; Error code otherwise.
uint8_t tc,
uint8_t index,
uint8_t options,
- struct opr_cfg *cfg)
+ struct opr_cfg *cfg,
+ uint8_t opr_id)
{
struct dpni_cmd_set_opr *cmd_params;
struct mc_command cmd = { 0 };
cmd_params->tc_id = tc;
cmd_params->index = index;
cmd_params->options = options;
+ cmd_params->opr_id = opr_id;
cmd_params->oloe = cfg->oloe;
cmd_params->oeane = cfg->oeane;
cmd_params->olws = cfg->olws;
uint8_t tc,
uint8_t index,
struct opr_cfg *cfg,
- struct opr_qry *qry)
+ struct opr_qry *qry,
+ uint8_t flags,
+ uint8_t opr_id)
{
struct dpni_rsp_get_opr *rsp_params;
struct dpni_cmd_get_opr *cmd_params;
cmd_params = (struct dpni_cmd_get_opr *)cmd.params;
cmd_params->index = index;
cmd_params->tc_id = tc;
+ cmd_params->flags = flags;
+ cmd_params->opr_id = opr_id;
/* send command to mc*/
err = mc_send_command(mc_io, &cmd);
* If the FS is already enabled with a previous call the classification
* key will be changed but all the table rules are kept. If the
* existing rules do not match the key the results will not be
- * predictable. It is the user responsibility to keep key integrity
+ * predictable. It is the user responsibility to keep keyintegrity.
* If cfg.enable is set to 1 the command will create a flow steering table
* and will classify packets according to this table. The packets
* that miss all the table rules will be classified according to
cmd_params = (struct dpni_cmd_set_rx_fs_dist *)cmd.params;
cmd_params->dist_size = cpu_to_le16(cfg->dist_size);
dpni_set_field(cmd_params->enable, RX_FS_DIST_ENABLE, cfg->enable);
- cmd_params->tc = cfg->tc;
+ cmd_params->tc = cfg->tc;
cmd_params->miss_flow_id = cpu_to_le16(cfg->fs_miss_flow_id);
cmd_params->key_cfg_iova = cpu_to_le64(cfg->key_cfg_iova);
* @token: Token of DPNI object
* @cfg: Distribution configuration
* If cfg.enable is set to 1 the packets will be classified using a hash
- * function based on the key received in cfg.key_cfg_iova parameter
+ * function based on the key received in cfg.key_cfg_iova parameter.
* If cfg.enable is set to 0 the packets will be sent to the queue configured in
- * dpni_set_rx_dist_default_queue() call
+ * dpni_set_rx_dist_default_queue() call
*/
int dpni_set_rx_hash_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
uint16_t token, const struct dpni_rx_dist_cfg *cfg)
}
/**
- * dpni_add_custom_tpid() - Configures a distinct Ethertype value
- * (or TPID value) to indicate VLAN tag in addition to the common
- * TPID values 0x8100 and 0x88A8
+ * dpni_add_custom_tpid() - Configures a distinct Ethertype value (or TPID
+ * value) to indicate VLAN tag in adition to the common TPID values
+ * 0x81000 and 0x88A8
* @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
*
* Only two custom values are accepted. If the function is called for the third
* time it will return error.
- * To replace an existing value use dpni_remove_custom_tpid() to remove
- * a previous TPID and after that use again the function.
+ * To replace an existing value use dpni_remove_custom_tpid() to remove a
+ * previous TPID and after that use again the function.
*
* Return: '0' on Success; Error code otherwise.
*/
/**
* dpni_remove_custom_tpid() - Removes a distinct Ethertype value added
- * previously with dpni_add_custom_tpid()
+ * previously with dpni_add_custom_tpid()
* @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
}
/**
- * dpni_get_custom_tpid() - Returns custom TPID (vlan tags) values configured
- * to detect 802.1q frames
+ * dpni_get_custom_tpid() - Returns custom TPID (vlan tags) values configured to
+ * detect 802.1q 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
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
- * Copyright 2019 NXP
+ * Copyright 2019-2021 NXP
*/
#include <fsl_mc_sys.h>
#include <fsl_mc_cmd.h>
return 0;
}
+
+/**
+ * dprtc_get_ext_trigger_timestamp - Retrieve the Ext trigger timestamp status
+ * (timestamp + flag for unread timestamp in FIFO).
+ *
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPRTC object
+ * @id: External trigger id.
+ * @status: Returned object's external trigger status
+ *
+ * Return: '0' on Success; Error code otherwise.
+ */
+int dprtc_get_ext_trigger_timestamp(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint8_t id,
+ struct dprtc_ext_trigger_status *status)
+{
+ struct dprtc_rsp_ext_trigger_timestamp *rsp_params;
+ struct dprtc_cmd_ext_trigger_timestamp *cmd_params;
+ struct mc_command cmd = { 0 };
+ int err;
+
+ /* prepare command */
+ cmd.header = mc_encode_cmd_header(DPRTC_CMDID_GET_EXT_TRIGGER_TIMESTAMP,
+ cmd_flags,
+ token);
+
+ cmd_params = (struct dprtc_cmd_ext_trigger_timestamp *)cmd.params;
+ cmd_params->id = id;
+ /* send command to mc*/
+ err = mc_send_command(mc_io, &cmd);
+ if (err)
+ return err;
+
+ /* retrieve response parameters */
+ rsp_params = (struct dprtc_rsp_ext_trigger_timestamp *)cmd.params;
+ status->timestamp = le64_to_cpu(rsp_params->timestamp);
+ status->unread_valid_timestamp = rsp_params->unread_valid_timestamp;
+
+ return 0;
+}
+
+/**
+ * dprtc_set_fiper_loopback() - Set the fiper pulse as source of interrupt for
+ * External Trigger stamps
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPRTC object
+ * @id: External trigger id.
+ * @fiper_as_input: Bit used to control interrupt signal source:
+ * 0 = Normal operation, interrupt external source
+ * 1 = Fiper pulse is looped back into Trigger input
+ *
+ * Return: '0' on Success; Error code otherwise.
+ */
+int dprtc_set_fiper_loopback(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint8_t id,
+ uint8_t fiper_as_input)
+{
+ struct dprtc_ext_trigger_cfg *cmd_params;
+ struct mc_command cmd = { 0 };
+
+ cmd.header = mc_encode_cmd_header(DPRTC_CMDID_SET_FIPER_LOOPBACK,
+ cmd_flags,
+ token);
+
+ cmd_params = (struct dprtc_ext_trigger_cfg *)cmd.params;
+ cmd_params->id = id;
+ cmd_params->fiper_as_input = fiper_as_input;
+
+ return mc_send_command(mc_io, &cmd);
+}
uint16_t token,
uint16_t max_frame_length);
+int dpdmux_get_max_frame_length(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint16_t if_id,
+ uint16_t *max_frame_length);
+
/**
* enum dpdmux_counter_type - Counter types
* @DPDMUX_CNT_ING_FRAME: Counts ingress frames
#define DPDMUX_CMDID_RESET DPDMUX_CMD(0x005)
#define DPDMUX_CMDID_IS_ENABLED DPDMUX_CMD(0x006)
#define DPDMUX_CMDID_SET_MAX_FRAME_LENGTH DPDMUX_CMD(0x0a1)
+#define DPDMUX_CMDID_GET_MAX_FRAME_LENGTH DPDMUX_CMD(0x0a2)
#define DPDMUX_CMDID_UL_RESET_COUNTERS DPDMUX_CMD(0x0a3)
uint16_t max_frame_length;
};
+struct dpdmux_cmd_get_max_frame_len {
+ uint16_t if_id;
+};
+
+struct dpdmux_rsp_get_max_frame_len {
+ uint16_t max_len;
+};
+
#define DPDMUX_ACCEPTED_FRAMES_TYPE_SHIFT 0
#define DPDMUX_ACCEPTED_FRAMES_TYPE_SIZE 4
#define DPDMUX_UNACCEPTED_FRAMES_ACTION_SHIFT 4
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
* Copyright 2013-2015 Freescale Semiconductor Inc.
- * Copyright 2016-2017 NXP
+ * Copyright 2016-2021 NXP
*
*/
#ifndef __FSL_DPKG_H_
/**
* Number of extractions per key profile
*/
-#define DPKG_MAX_NUM_OF_EXTRACTS 10
+#define DPKG_MAX_NUM_OF_EXTRACTS 20
/**
* enum dpkg_extract_from_hdr_type - Selecting extraction by header types
uint8_t num_extracts;
uint8_t pad[7];
/* words 1..25 */
- struct dpni_dist_extract extracts[10];
+ struct dpni_dist_extract extracts[DPKG_MAX_NUM_OF_EXTRACTS];
};
int dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg,
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2016-2020 NXP
+ * Copyright 2016-2021 NXP
*
*/
#ifndef __FSL_DPNI_H
/** General DPNI macros */
+/**
+ * Maximum size of a key
+ */
+#define DPNI_MAX_KEY_SIZE 56
+
/**
* Maximum number of traffic classes
*/
* Define a custom number of congestion groups
*/
#define DPNI_OPT_CUSTOM_CG 0x000200
-
-
+/**
+ * Define a custom number of order point records
+ */
+#define DPNI_OPT_CUSTOM_OPR 0x000400
+/**
+ * Hash key is shared between all traffic classes
+ */
+#define DPNI_OPT_SHARED_HASH_KEY 0x000800
+/**
+ * Flow steering table is shared between all traffic classes
+ */
+#define DPNI_OPT_SHARED_FS 0x001000
/**
* Software sequence maximum layout size
*/
uint8_t num_rx_tcs;
uint8_t qos_entries;
uint8_t num_cgs;
+ uint16_t num_opr;
+ uint8_t dist_key_size;
};
int dpni_create(struct fsl_mc_io *mc_io,
/**
* Extract out of frame header error
*/
-#define DPNI_ERROR_EOFHE 0x00020000
+#define DPNI_ERROR_MS 0x40000000
+#define DPNI_ERROR_PTP 0x08000000
+/* Ethernet multicast frame */
+#define DPNI_ERROR_MC 0x04000000
+/* Ethernet broadcast frame */
+#define DPNI_ERROR_BC 0x02000000
+#define DPNI_ERROR_KSE 0x00040000
+#define DPNI_ERROR_EOFHE 0x00020000
+#define DPNI_ERROR_MNLE 0x00010000
+#define DPNI_ERROR_TIDE 0x00008000
+#define DPNI_ERROR_PIEE 0x00004000
/**
* Frame length error
*/
-#define DPNI_ERROR_FLE 0x00002000
+#define DPNI_ERROR_FLE 0x00002000
/**
* Frame physical error
*/
-#define DPNI_ERROR_FPE 0x00001000
+#define DPNI_ERROR_FPE 0x00001000
+#define DPNI_ERROR_PTE 0x00000080
+#define DPNI_ERROR_ISP 0x00000040
/**
* Parsing header error
*/
-#define DPNI_ERROR_PHE 0x00000020
+#define DPNI_ERROR_PHE 0x00000020
+
+#define DPNI_ERROR_BLE 0x00000010
/**
* Parser L3 checksum error
*/
-#define DPNI_ERROR_L3CE 0x00000004
+#define DPNI_ERROR_L3CV 0x00000008
+
+#define DPNI_ERROR_L3CE 0x00000004
/**
- * Parser L3 checksum error
+ * Parser L4 checksum error
*/
-#define DPNI_ERROR_L4CE 0x00000001
+#define DPNI_ERROR_L4CV 0x00000002
+#define DPNI_ERROR_L4CE 0x00000001
/**
* enum dpni_error_action - Defines DPNI behavior for errors
* @DPNI_ERROR_ACTION_DISCARD: Discard the frame
* Select to modify the sw-opaque value setting
*/
#define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE 0x00000080
+/**
+ * Select to disable Scatter Gather and use single buffer
+ */
+#define DPNI_BUF_LAYOUT_OPT_NO_SG 0x00000100
/**
* struct dpni_buffer_layout - Structure representing DPNI buffer layout
/**
* struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration
- * @rate_limit: Rate in Mbps
+ * @rate_limit: Rate in Mbits/s
* @max_burst_size: Burst size in bytes (up to 64KB)
*/
struct dpni_tx_shaping_cfg {
uint16_t token,
uint8_t mac_addr[6]);
+/**
+ * Set mac addr queue action
+ */
+#define DPNI_MAC_SET_QUEUE_ACTION 1
+
int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
struct dpni_fs_action_cfg {
uint64_t flc;
uint16_t flow_id;
+ uint16_t redirect_obj_token;
uint16_t options;
};
uint8_t tc,
uint8_t index,
uint8_t options,
- struct opr_cfg *cfg);
+ struct opr_cfg *cfg,
+ uint8_t opr_id);
int dpni_get_opr(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint8_t tc,
uint8_t index,
struct opr_cfg *cfg,
- struct opr_qry *qry);
+ struct opr_qry *qry,
+ uint8_t flags,
+ uint8_t opr_id);
/**
* When used for queue_idx in function dpni_set_rx_dist_default_queue will
/**
* dpni_extract_sw_sequence_layout() - extract the software sequence layout
- * @layout: software sequence layout
- * @sw_sequence_layout_buf: Zeroed 264 bytes of memory before mapping it
- * to DMA
+ * @layout: software sequence layout
+ * @sw_sequence_layout_buf:Zeroed 264 bytes of memory before mapping it to DMA
*
* This function has to be called after dpni_get_sw_sequence_layout
- *
*/
void dpni_extract_sw_sequence_layout(struct dpni_sw_sequence_layout *layout,
const uint8_t *sw_sequence_layout_buf);
+/**
+ * struct dpni_ptp_cfg - configure single step PTP (IEEE 1588)
+ * @en: enable single step PTP. When enabled the PTPv1 functionality will
+ * not work. If the field is zero, offset and ch_update parameters
+ * will be ignored
+ * @offset: start offset from the beginning of the frame where timestamp
+ * field is found. The offset must respect all MAC headers, VLAN
+ * tags and other protocol headers
+ * @ch_update: when set UDP checksum will be updated inside packet
+ * @peer_delay: For peer-to-peer transparent clocks add this value to the
+ * correction field in addition to the transient time update. The
+ * value expresses nanoseconds.
+ */
+struct dpni_single_step_cfg {
+ uint8_t en;
+ uint8_t ch_update;
+ uint16_t offset;
+ uint32_t peer_delay;
+};
+
+int dpni_set_single_step_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+ uint16_t token, struct dpni_single_step_cfg *ptp_cfg);
+
+int dpni_get_single_step_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+ uint16_t token, struct dpni_single_step_cfg *ptp_cfg);
+
+/**
+ * loopback_en field is valid when calling function dpni_set_port_cfg
+ */
+#define DPNI_PORT_CFG_LOOPBACK 0x01
+
+/**
+ * struct dpni_port_cfg - custom configuration for dpni physical port
+ * @loopback_en: port loopback enabled
+ */
+struct dpni_port_cfg {
+ int loopback_en;
+};
+
+int dpni_set_port_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+ uint16_t token, uint32_t flags, struct dpni_port_cfg *port_cfg);
+
+int dpni_get_port_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+ uint16_t token, struct dpni_port_cfg *port_cfg);
+
#endif /* __FSL_DPNI_H */
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2016-2020 NXP
+ * Copyright 2016-2021 NXP
*
*/
#ifndef _FSL_DPNI_CMD_H
/* DPNI Version */
#define DPNI_VER_MAJOR 7
-#define DPNI_VER_MINOR 13
+#define DPNI_VER_MINOR 17
#define DPNI_CMD_BASE_VERSION 1
#define DPNI_CMD_VERSION_2 2
#define DPNI_CMD_VERSION_3 3
+#define DPNI_CMD_VERSION_4 4
+#define DPNI_CMD_VERSION_5 5
#define DPNI_CMD_ID_OFFSET 4
#define DPNI_CMD(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION)
#define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2)
#define DPNI_CMD_V3(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_3)
+#define DPNI_CMD_V4(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_4)
+#define DPNI_CMD_V5(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_5)
/* Command IDs */
#define DPNI_CMDID_OPEN DPNI_CMD(0x801)
#define DPNI_CMDID_CLOSE DPNI_CMD(0x800)
-#define DPNI_CMDID_CREATE DPNI_CMD_V3(0x901)
+#define DPNI_CMDID_CREATE DPNI_CMD_V5(0x901)
#define DPNI_CMDID_DESTROY DPNI_CMD(0x981)
#define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01)
#define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232)
#define DPNI_CMDID_CLR_VLAN_FILTERS DPNI_CMD(0x233)
-#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V3(0x235)
+#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V4(0x235)
#define DPNI_CMDID_SET_RX_TC_POLICING DPNI_CMD(0x23E)
#define DPNI_CMDID_ADD_QOS_ENT DPNI_CMD_V2(0x241)
#define DPNI_CMDID_REMOVE_QOS_ENT DPNI_CMD(0x242)
#define DPNI_CMDID_CLR_QOS_TBL DPNI_CMD(0x243)
-#define DPNI_CMDID_ADD_FS_ENT DPNI_CMD(0x244)
+#define DPNI_CMDID_ADD_FS_ENT DPNI_CMD_V2(0x244)
#define DPNI_CMDID_REMOVE_FS_ENT DPNI_CMD(0x245)
#define DPNI_CMDID_CLR_FS_ENT DPNI_CMD(0x246)
uint16_t fs_entries;
uint8_t num_rx_tcs;
uint8_t pad4;
- uint8_t num_cgs;
+ uint8_t num_cgs;
+ uint16_t num_opr;
+ uint8_t dist_key_size;
};
struct dpni_cmd_destroy {
uint8_t mac_addr[6];
};
-#define DPNI_MAC_SET_QUEUE_ACTION 1
-
struct dpni_cmd_add_mac_addr {
uint8_t flags;
uint8_t pad;
uint64_t key_iova;
uint64_t mask_iova;
uint64_t flc;
+ uint16_t redir_token;
};
struct dpni_cmd_remove_fs_entry {
};
struct dpni_cmd_set_opr {
- uint8_t pad0;
+ uint8_t opr_id;
uint8_t tc_id;
uint8_t index;
uint8_t options;
};
struct dpni_cmd_get_opr {
- uint8_t pad;
+ uint8_t flags;
uint8_t tc_id;
uint8_t index;
+ uint8_t opr_id;
};
#define DPNI_RIP_SHIFT 0
uint16_t pad;
};
+#define DPNI_PTP_ENABLE_SHIFT 0
+#define DPNI_PTP_ENABLE_SIZE 1
+#define DPNI_PTP_CH_UPDATE_SHIFT 1
+#define DPNI_PTP_CH_UPDATE_SIZE 1
+struct dpni_cmd_single_step_cfg {
+ uint16_t flags;
+ uint16_t offset;
+ uint32_t peer_delay;
+};
+
+struct dpni_rsp_single_step_cfg {
+ uint16_t flags;
+ uint16_t offset;
+ uint32_t peer_delay;
+};
+
+#define DPNI_PORT_LOOPBACK_EN_SHIFT 0
+#define DPNI_PORT_LOOPBACK_EN_SIZE 1
+
+struct dpni_cmd_set_port_cfg {
+ uint32_t flags;
+ uint32_t bit_params;
+};
+
+struct dpni_rsp_get_port_cfg {
+ uint32_t flags;
+ uint32_t bit_params;
+};
+
#pragma pack(pop)
#endif /* _FSL_DPNI_CMD_H */
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
- * Copyright 2019 NXP
+ * Copyright 2019-2021 NXP
*/
#ifndef __FSL_DPRTC_H
#define __FSL_DPRTC_H
uint16_t token,
uint64_t time);
+struct dprtc_ext_trigger_status {
+ uint64_t timestamp;
+ uint8_t unread_valid_timestamp;
+};
+
+int dprtc_get_ext_trigger_timestamp(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint8_t id,
+ struct dprtc_ext_trigger_status *status);
+
+int dprtc_set_fiper_loopback(struct fsl_mc_io *mc_io,
+ uint32_t cmd_flags,
+ uint16_t token,
+ uint8_t id,
+ uint8_t fiper_as_input);
+
/**
* struct dprtc_attr - Structure representing DPRTC attributes
* @id: DPRTC object ID
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
- * Copyright 2019 NXP
+ * Copyright 2019-2021 NXP
*/
#include <fsl_mc_sys.h>
#ifndef _FSL_DPRTC_CMD_H
/* DPRTC Version */
#define DPRTC_VER_MAJOR 2
-#define DPRTC_VER_MINOR 1
+#define DPRTC_VER_MINOR 3
/* Command versioning */
#define DPRTC_CMD_BASE_VERSION 1
+#define DPRTC_CMD_VERSION_2 2
#define DPRTC_CMD_ID_OFFSET 4
#define DPRTC_CMD(id) (((id) << DPRTC_CMD_ID_OFFSET) | DPRTC_CMD_BASE_VERSION)
+#define DPRTC_CMD_V2(id) (((id) << DPRTC_CMD_ID_OFFSET) | DPRTC_CMD_VERSION_2)
/* Command IDs */
#define DPRTC_CMDID_CLOSE DPRTC_CMD(0x800)
#define DPRTC_CMDID_SET_EXT_TRIGGER DPRTC_CMD(0x1d8)
#define DPRTC_CMDID_CLEAR_EXT_TRIGGER DPRTC_CMD(0x1d9)
#define DPRTC_CMDID_GET_EXT_TRIGGER_TIMESTAMP DPRTC_CMD(0x1dA)
+#define DPRTC_CMDID_SET_FIPER_LOOPBACK DPRTC_CMD(0x1dB)
/* Macros for accessing command fields smaller than 1byte */
#define DPRTC_MASK(field) \
uint16_t major;
uint16_t minor;
};
+
+struct dprtc_cmd_ext_trigger_timestamp {
+ uint32_t pad;
+ uint8_t id;
+};
+
+struct dprtc_rsp_ext_trigger_timestamp {
+ uint8_t unread_valid_timestamp;
+ uint8_t pad1;
+ uint16_t pad2;
+ uint32_t pad3;
+ uint64_t timestamp;
+};
+
+struct dprtc_ext_trigger_cfg {
+ uint8_t id;
+ uint8_t fiper_as_input;
+};
#pragma pack(pop)
#endif /* _FSL_DPRTC_CMD_H */