New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / bus / fslmc / mc / fsl_dpci_cmd.h
index 73a551a..92b85a8 100644 (file)
@@ -1,47 +1,14 @@
-/*-
- * This file is provided under a dual BSD/GPLv2 license. When using or
- * redistributing this file, you may do so under either license.
- *
- *   BSD LICENSE
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the above-listed copyright holders nor the
- * names of any contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- *   GPL LICENSE SUMMARY
- *
- * ALTERNATIVELY, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") as published by the Free Software
- * Foundation, either version 2 of that License or (at your option) any
- * later version.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
  */
 #ifndef _FSL_DPCI_CMD_H
 #define _FSL_DPCI_CMD_H
 
 /* DPCI Version */
 #define DPCI_VER_MAJOR                 3
-#define DPCI_VER_MINOR                 3
+#define DPCI_VER_MINOR                 4
 
 #define DPCI_CMD_BASE_VERSION          1
 #define DPCI_CMD_BASE_VERSION_V2       2
@@ -68,6 +35,8 @@
 #define DPCI_CMDID_GET_PEER_ATTR       DPCI_CMD_V1(0x0e2)
 #define DPCI_CMDID_GET_RX_QUEUE                DPCI_CMD_V1(0x0e3)
 #define DPCI_CMDID_GET_TX_QUEUE                DPCI_CMD_V1(0x0e4)
+#define DPCI_CMDID_SET_OPR             DPCI_CMD_V1(0x0e5)
+#define DPCI_CMDID_GET_OPR             DPCI_CMD_V1(0x0e6)
 
 /* Macros for accessing command fields smaller than 1byte */
 #define DPCI_MASK(field)        \
@@ -123,6 +92,8 @@ struct dpci_rsp_get_link_state {
 
 #define DPCI_DEST_TYPE_SHIFT   0
 #define DPCI_DEST_TYPE_SIZE    4
+#define DPCI_ORDER_PRESERVATION_SHIFT  4
+#define DPCI_ORDER_PRESERVATION_SIZE   1
 
 struct dpci_cmd_set_rx_queue {
        uint32_t dest_id;
@@ -161,5 +132,61 @@ struct dpci_rsp_get_api_version {
        uint16_t minor;
 };
 
+struct dpci_cmd_set_opr {
+       uint16_t pad0;
+       uint8_t index;
+       uint8_t options;
+       uint8_t pad1[7];
+       uint8_t oloe;
+       uint8_t oeane;
+       uint8_t olws;
+       uint8_t oa;
+       uint8_t oprrws;
+};
+
+struct dpci_cmd_get_opr {
+       uint16_t pad;
+       uint8_t index;
+};
+
+#define DPCI_RIP_SHIFT         0
+#define DPCI_RIP_SIZE          1
+#define DPCI_OPR_ENABLE_SHIFT  1
+#define DPCI_OPR_ENABLE_SIZE   1
+#define DPCI_TSEQ_NLIS_SHIFT   0
+#define DPCI_TSEQ_NLIS_SIZE    1
+#define DPCI_HSEQ_NLIS_SHIFT   0
+#define DPCI_HSEQ_NLIS_SIZE    1
+
+struct dpci_rsp_get_opr {
+       uint64_t pad0;
+       /* from LSB: rip:1 enable:1 */
+       uint8_t flags;
+       uint16_t pad1;
+       uint8_t oloe;
+       uint8_t oeane;
+       uint8_t olws;
+       uint8_t oa;
+       uint8_t oprrws;
+       uint16_t nesn;
+       uint16_t pad8;
+       uint16_t ndsn;
+       uint16_t pad2;
+       uint16_t ea_tseq;
+       /* only the LSB */
+       uint8_t tseq_nlis;
+       uint8_t pad3;
+       uint16_t ea_hseq;
+       /* only the LSB */
+       uint8_t hseq_nlis;
+       uint8_t pad4;
+       uint16_t ea_hptr;
+       uint16_t pad5;
+       uint16_t ea_tptr;
+       uint16_t pad6;
+       uint16_t opr_vid;
+       uint16_t pad7;
+       uint16_t opr_id;
+};
 #pragma pack(pop)
 #endif /* _FSL_DPCI_CMD_H */