xref: /freebsd/sys/dev/iavf/iavf_register.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
1*ca853deeSEric Joyner /* SPDX-License-Identifier: BSD-3-Clause */
2*ca853deeSEric Joyner /*  Copyright (c) 2021, Intel Corporation
3*ca853deeSEric Joyner  *  All rights reserved.
4*ca853deeSEric Joyner  *
5*ca853deeSEric Joyner  *  Redistribution and use in source and binary forms, with or without
6*ca853deeSEric Joyner  *  modification, are permitted provided that the following conditions are met:
7*ca853deeSEric Joyner  *
8*ca853deeSEric Joyner  *   1. Redistributions of source code must retain the above copyright notice,
9*ca853deeSEric Joyner  *      this list of conditions and the following disclaimer.
10*ca853deeSEric Joyner  *
11*ca853deeSEric Joyner  *   2. Redistributions in binary form must reproduce the above copyright
12*ca853deeSEric Joyner  *      notice, this list of conditions and the following disclaimer in the
13*ca853deeSEric Joyner  *      documentation and/or other materials provided with the distribution.
14*ca853deeSEric Joyner  *
15*ca853deeSEric Joyner  *   3. Neither the name of the Intel Corporation nor the names of its
16*ca853deeSEric Joyner  *      contributors may be used to endorse or promote products derived from
17*ca853deeSEric Joyner  *      this software without specific prior written permission.
18*ca853deeSEric Joyner  *
19*ca853deeSEric Joyner  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20*ca853deeSEric Joyner  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*ca853deeSEric Joyner  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*ca853deeSEric Joyner  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23*ca853deeSEric Joyner  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*ca853deeSEric Joyner  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*ca853deeSEric Joyner  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*ca853deeSEric Joyner  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*ca853deeSEric Joyner  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*ca853deeSEric Joyner  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*ca853deeSEric Joyner  *  POSSIBILITY OF SUCH DAMAGE.
30*ca853deeSEric Joyner  */
31*ca853deeSEric Joyner 
32*ca853deeSEric Joyner #ifndef _IAVF_REGISTER_H_
33*ca853deeSEric Joyner #define _IAVF_REGISTER_H_
34*ca853deeSEric Joyner 
35*ca853deeSEric Joyner #define IAVF_VF_ARQBAH1              0x00006000 /* Reset: EMPR */
36*ca853deeSEric Joyner #define IAVF_VF_ARQBAL1              0x00006C00 /* Reset: EMPR */
37*ca853deeSEric Joyner #define IAVF_VF_ARQH1            0x00007400 /* Reset: EMPR */
38*ca853deeSEric Joyner #define IAVF_VF_ARQH1_ARQH_SHIFT 0
39*ca853deeSEric Joyner #define IAVF_VF_ARQH1_ARQH_MASK  IAVF_MASK(0x3FF, IAVF_VF_ARQH1_ARQH_SHIFT)
40*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1                 0x00008000 /* Reset: EMPR */
41*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQVFE_SHIFT    28
42*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQVFE_MASK     IAVF_MASK(1UL, IAVF_VF_ARQLEN1_ARQVFE_SHIFT)
43*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQOVFL_SHIFT   29
44*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQOVFL_MASK    IAVF_MASK(1UL, IAVF_VF_ARQLEN1_ARQOVFL_SHIFT)
45*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQCRIT_SHIFT   30
46*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQCRIT_MASK    IAVF_MASK(1UL, IAVF_VF_ARQLEN1_ARQCRIT_SHIFT)
47*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQENABLE_SHIFT 31
48*ca853deeSEric Joyner #define IAVF_VF_ARQLEN1_ARQENABLE_MASK  IAVF_MASK(1UL, IAVF_VF_ARQLEN1_ARQENABLE_SHIFT)
49*ca853deeSEric Joyner #define IAVF_VF_ARQT1            0x00007000 /* Reset: EMPR */
50*ca853deeSEric Joyner #define IAVF_VF_ATQBAH1              0x00007800 /* Reset: EMPR */
51*ca853deeSEric Joyner #define IAVF_VF_ATQBAL1              0x00007C00 /* Reset: EMPR */
52*ca853deeSEric Joyner #define IAVF_VF_ATQH1            0x00006400 /* Reset: EMPR */
53*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1                 0x00006800 /* Reset: EMPR */
54*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQVFE_SHIFT    28
55*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQVFE_MASK     IAVF_MASK(1UL, IAVF_VF_ATQLEN1_ATQVFE_SHIFT)
56*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQOVFL_SHIFT   29
57*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQOVFL_MASK    IAVF_MASK(1UL, IAVF_VF_ATQLEN1_ATQOVFL_SHIFT)
58*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQCRIT_SHIFT   30
59*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQCRIT_MASK    IAVF_MASK(1UL, IAVF_VF_ATQLEN1_ATQCRIT_SHIFT)
60*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQENABLE_SHIFT 31
61*ca853deeSEric Joyner #define IAVF_VF_ATQLEN1_ATQENABLE_MASK  IAVF_MASK(1UL, IAVF_VF_ATQLEN1_ATQENABLE_SHIFT)
62*ca853deeSEric Joyner #define IAVF_VF_ATQT1            0x00008400 /* Reset: EMPR */
63*ca853deeSEric Joyner #define IAVF_VFGEN_RSTAT                 0x00008800 /* Reset: VFR */
64*ca853deeSEric Joyner #define IAVF_VFGEN_RSTAT_VFR_STATE_SHIFT 0
65*ca853deeSEric Joyner #define IAVF_VFGEN_RSTAT_VFR_STATE_MASK  IAVF_MASK(0x3, IAVF_VFGEN_RSTAT_VFR_STATE_SHIFT)
66*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01                       0x00005C00 /* Reset: VFR */
67*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_INTENA_SHIFT          0
68*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_INTENA_MASK           IAVF_MASK(1UL, IAVF_VFINT_DYN_CTL01_INTENA_SHIFT)
69*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_CLEARPBA_SHIFT        1
70*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_CLEARPBA_MASK         IAVF_MASK(1UL, IAVF_VFINT_DYN_CTL01_CLEARPBA_SHIFT)
71*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_SWINT_TRIG_SHIFT      2
72*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_SWINT_TRIG_MASK       IAVF_MASK(1UL, IAVF_VFINT_DYN_CTL01_SWINT_TRIG_SHIFT)
73*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_ITR_INDX_SHIFT        3
74*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_ITR_INDX_MASK         IAVF_MASK(0x3, IAVF_VFINT_DYN_CTL01_ITR_INDX_SHIFT)
75*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_INTERVAL_SHIFT        5
76*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_INTERVAL_MASK         IAVF_MASK(0xFFF, IAVF_VFINT_DYN_CTL01_INTERVAL_SHIFT)
77*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_SW_ITR_INDX_ENA_SHIFT 24
78*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_SW_ITR_INDX_ENA_MASK  IAVF_MASK(1UL, IAVF_VFINT_DYN_CTL01_SW_ITR_INDX_ENA_SHIFT)
79*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_SW_ITR_INDX_SHIFT     25
80*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTL01_SW_ITR_INDX_MASK      IAVF_MASK(0x3, IAVF_VFINT_DYN_CTL01_SW_ITR_INDX_SHIFT)
81*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1(_INTVF)               (0x00003800 + ((_INTVF) * 4)) /* _i=0...15 */ /* Reset: VFR */
82*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_INTENA_SHIFT          0
83*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_INTENA_MASK           IAVF_MASK(1UL, IAVF_VFINT_DYN_CTLN1_INTENA_SHIFT)
84*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_CLEARPBA_SHIFT        1
85*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_CLEARPBA_MASK         IAVF_MASK(1UL, IAVF_VFINT_DYN_CTLN1_CLEARPBA_SHIFT)
86*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_SHIFT      2
87*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK       IAVF_MASK(1UL, IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_SHIFT)
88*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_ITR_INDX_SHIFT        3
89*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK         IAVF_MASK(0x3, IAVF_VFINT_DYN_CTLN1_ITR_INDX_SHIFT)
90*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_INTERVAL_SHIFT        5
91*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_INTERVAL_MASK         IAVF_MASK(0xFFF, IAVF_VFINT_DYN_CTLN1_INTERVAL_SHIFT)
92*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_SHIFT 24
93*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK  IAVF_MASK(1UL, IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_SHIFT)
94*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_SHIFT     25
95*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_MASK      IAVF_MASK(0x3, IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_SHIFT)
96*ca853deeSEric Joyner #define IAVF_VFINT_ICR0_ENA1                        0x00005000 /* Reset: CORER */
97*ca853deeSEric Joyner #define IAVF_VFINT_ICR0_ENA1_ADMINQ_SHIFT           30
98*ca853deeSEric Joyner #define IAVF_VFINT_ICR0_ENA1_ADMINQ_MASK            IAVF_MASK(1UL, IAVF_VFINT_ICR0_ENA1_ADMINQ_SHIFT)
99*ca853deeSEric Joyner #define IAVF_VFINT_ICR0_ENA1_RSVD_SHIFT             31
100*ca853deeSEric Joyner #define IAVF_VFINT_ICR01                        0x00004800 /* Reset: CORER */
101*ca853deeSEric Joyner #define IAVF_VFINT_ICR01_QUEUE_0_SHIFT          1
102*ca853deeSEric Joyner #define IAVF_VFINT_ICR01_QUEUE_0_MASK           IAVF_MASK(1UL, IAVF_VFINT_ICR01_QUEUE_0_SHIFT)
103*ca853deeSEric Joyner #define IAVF_VFINT_ICR01_LINK_STAT_CHANGE_SHIFT 25
104*ca853deeSEric Joyner #define IAVF_VFINT_ICR01_LINK_STAT_CHANGE_MASK  IAVF_MASK(1UL, IAVF_VFINT_ICR01_LINK_STAT_CHANGE_SHIFT)
105*ca853deeSEric Joyner #define IAVF_VFINT_ICR01_ADMINQ_SHIFT           30
106*ca853deeSEric Joyner #define IAVF_VFINT_ICR01_ADMINQ_MASK            IAVF_MASK(1UL, IAVF_VFINT_ICR01_ADMINQ_SHIFT)
107*ca853deeSEric Joyner #define IAVF_VFINT_ITR01(_i)            (0x00004C00 + ((_i) * 4)) /* _i=0...2 */ /* Reset: VFR */
108*ca853deeSEric Joyner #define IAVF_VFINT_ITRN1(_i, _INTVF)     (0x00002800 + ((_i) * 64 + (_INTVF) * 4)) /* _i=0...2, _INTVF=0...15 */ /* Reset: VFR */
109*ca853deeSEric Joyner #define IAVF_VFINT_STAT_CTL01                      0x00005400 /* Reset: CORER */
110*ca853deeSEric Joyner #define IAVF_QRX_TAIL1(_Q)        (0x00002000 + ((_Q) * 4)) /* _i=0...15 */ /* Reset: CORER */
111*ca853deeSEric Joyner #define IAVF_QTX_TAIL1(_Q)        (0x00000000 + ((_Q) * 4)) /* _i=0...15 */ /* Reset: PFR */
112*ca853deeSEric Joyner #define IAVF_VFQF_HENA(_i)             (0x0000C400 + ((_i) * 4)) /* _i=0...1 */ /* Reset: CORER */
113*ca853deeSEric Joyner #define IAVF_VFQF_HKEY(_i)         (0x0000CC00 + ((_i) * 4)) /* _i=0...12 */ /* Reset: CORER */
114*ca853deeSEric Joyner #define IAVF_VFQF_HKEY_MAX_INDEX   12
115*ca853deeSEric Joyner #define IAVF_VFQF_HLUT(_i)        (0x0000D000 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
116*ca853deeSEric Joyner #define IAVF_VFQF_HLUT_MAX_INDEX  15
117*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_WB_ON_ITR_SHIFT       30
118*ca853deeSEric Joyner #define IAVF_VFINT_DYN_CTLN1_WB_ON_ITR_MASK        IAVF_MASK(1UL, IAVF_VFINT_DYN_CTLN1_WB_ON_ITR_SHIFT)
119*ca853deeSEric Joyner 
120*ca853deeSEric Joyner #endif /* _IAVF_REGISTER_H_ */
121