/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2016-2019 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_SET_QOS_TBL DPNI_CMD_V2(0x240)
#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)
+#define DPNI_CMDID_SET_TX_PRIORITIES DPNI_CMD_V2(0x250)
+#define DPNI_CMDID_GET_RX_TC_POLICING DPNI_CMD(0x251)
+
#define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V3(0x25D)
#define DPNI_CMDID_RESET_STATISTICS DPNI_CMD(0x25E)
#define DPNI_CMDID_GET_QUEUE DPNI_CMD_V2(0x25F)
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 {
uint64_t advertising;
};
+#define DPNI_COUPLED_SHIFT 0
+#define DPNI_COUPLED_SIZE 1
+
+struct dpni_cmd_set_tx_shaping {
+ uint16_t tx_cr_max_burst_size;
+ uint16_t tx_er_max_burst_size;
+ uint32_t pad;
+ uint32_t tx_cr_rate_limit;
+ uint32_t tx_er_rate_limit;
+ /* from LSB: coupled:1 */
+ uint8_t coupled;
+};
+
struct dpni_cmd_set_max_frame_length {
uint16_t max_frame_length;
};
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 {
uint8_t tc_id;
};
+#define DPNI_MODE_SHIFT 0
+#define DPNI_MODE_SIZE 4
+#define DPNI_COLOR_SHIFT 4
+#define DPNI_COLOR_SIZE 4
+#define DPNI_UNITS_SHIFT 0
+#define DPNI_UNITS_SIZE 4
+
+struct dpni_cmd_set_rx_tc_policing {
+ /* from LSB: mode:4 color:4 */
+ uint8_t mode_color;
+ /* from LSB: units: 4 */
+ uint8_t units;
+ uint8_t tc_id;
+ uint8_t pad;
+ uint32_t options;
+ uint32_t cir;
+ uint32_t cbs;
+ uint32_t eir;
+ uint32_t ebs;
+};
+
+struct dpni_cmd_get_rx_tc_policing {
+ uint16_t pad;
+ uint8_t tc_id;
+};
+
+struct dpni_rsp_get_rx_tc_policing {
+ /* from LSB: mode:4 color:4 */
+ uint8_t mode_color;
+ /* from LSB: units: 4 */
+ uint8_t units;
+ uint16_t pad;
+ uint32_t options;
+ uint32_t cir;
+ uint32_t cbs;
+ uint32_t eir;
+ uint32_t ebs;
+};
+
#define DPNI_DROP_ENABLE_SHIFT 0
#define DPNI_DROP_ENABLE_SIZE 1
#define DPNI_DROP_UNITS_SHIFT 2
};
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 */