Imported Upstream version 16.11
[deb_dpdk.git] / drivers / net / qede / base / ecore_hw_defs.h
1 /*
2  * Copyright (c) 2016 QLogic Corporation.
3  * All rights reserved.
4  * www.qlogic.com
5  *
6  * See LICENSE.qede_pmd for copyright and licensing details.
7  */
8
9 #ifndef _ECORE_IGU_DEF_H_
10 #define _ECORE_IGU_DEF_H_
11
12 /* Fields of IGU PF CONFIGRATION REGISTER */
13 /* function enable        */
14 #define IGU_PF_CONF_FUNC_EN       (0x1 << 0)
15 /* MSI/MSIX enable        */
16 #define IGU_PF_CONF_MSI_MSIX_EN   (0x1 << 1)
17 /* INT enable             */
18 #define IGU_PF_CONF_INT_LINE_EN   (0x1 << 2)
19 /* attention enable       */
20 #define IGU_PF_CONF_ATTN_BIT_EN   (0x1 << 3)
21 /* single ISR mode enable */
22 #define IGU_PF_CONF_SINGLE_ISR_EN (0x1 << 4)
23 /* simd all ones mode     */
24 #define IGU_PF_CONF_SIMD_MODE     (0x1 << 5)
25
26 /* Fields of IGU VF CONFIGRATION REGISTER */
27 /* function enable        */
28 #define IGU_VF_CONF_FUNC_EN        (0x1 << 0)
29 /* MSI/MSIX enable        */
30 #define IGU_VF_CONF_MSI_MSIX_EN    (0x1 << 1)
31 /* single ISR mode enable */
32 #define IGU_VF_CONF_SINGLE_ISR_EN  (0x1 << 4)
33 /* Parent PF              */
34 #define IGU_VF_CONF_PARENT_MASK    (0xF)
35 /* Parent PF              */
36 #define IGU_VF_CONF_PARENT_SHIFT   5
37
38 /* Igu control commands
39  */
40 enum igu_ctrl_cmd {
41         IGU_CTRL_CMD_TYPE_RD,
42         IGU_CTRL_CMD_TYPE_WR,
43         MAX_IGU_CTRL_CMD
44 };
45
46 /* Control register for the IGU command register
47  */
48 struct igu_ctrl_reg {
49         u32 ctrl_data;
50 #define IGU_CTRL_REG_FID_MASK           0xFFFF /* Opaque_FID     */
51 #define IGU_CTRL_REG_FID_SHIFT          0
52 #define IGU_CTRL_REG_PXP_ADDR_MASK      0xFFF /* Command address */
53 #define IGU_CTRL_REG_PXP_ADDR_SHIFT     16
54 #define IGU_CTRL_REG_RESERVED_MASK      0x1
55 #define IGU_CTRL_REG_RESERVED_SHIFT     28
56 #define IGU_CTRL_REG_TYPE_MASK          0x1 /* use enum igu_ctrl_cmd */
57 #define IGU_CTRL_REG_TYPE_SHIFT         31
58 };
59
60 #endif