xref: /dpdk/drivers/net/octeontx/base/octeontx_pkovf.h (revision 445371e8ba060ccf482015de9e3b68c934ae8dd8)
1*445371e8SJerin Jacob /*
2*445371e8SJerin Jacob  *   BSD LICENSE
3*445371e8SJerin Jacob  *
4*445371e8SJerin Jacob  *   Copyright (C) Cavium Inc. 2017. All rights reserved.
5*445371e8SJerin Jacob  *
6*445371e8SJerin Jacob  *   Redistribution and use in source and binary forms, with or without
7*445371e8SJerin Jacob  *   modification, are permitted provided that the following conditions
8*445371e8SJerin Jacob  *   are met:
9*445371e8SJerin Jacob  *
10*445371e8SJerin Jacob  *     * Redistributions of source code must retain the above copyright
11*445371e8SJerin Jacob  *       notice, this list of conditions and the following disclaimer.
12*445371e8SJerin Jacob  *     * Redistributions in binary form must reproduce the above copyright
13*445371e8SJerin Jacob  *       notice, this list of conditions and the following disclaimer in
14*445371e8SJerin Jacob  *       the documentation and/or other materials provided with the
15*445371e8SJerin Jacob  *       distribution.
16*445371e8SJerin Jacob  *     * Neither the name of Cavium networks nor the names of its
17*445371e8SJerin Jacob  *       contributors may be used to endorse or promote products derived
18*445371e8SJerin Jacob  *       from this software without specific prior written permission.
19*445371e8SJerin Jacob  *
20*445371e8SJerin Jacob  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21*445371e8SJerin Jacob  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*445371e8SJerin Jacob  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23*445371e8SJerin Jacob  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24*445371e8SJerin Jacob  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25*445371e8SJerin Jacob  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26*445371e8SJerin Jacob  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27*445371e8SJerin Jacob  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28*445371e8SJerin Jacob  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29*445371e8SJerin Jacob  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30*445371e8SJerin Jacob  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*445371e8SJerin Jacob  */
32*445371e8SJerin Jacob 
33*445371e8SJerin Jacob #ifndef	__OCTEONTX_PKO_H__
34*445371e8SJerin Jacob #define	__OCTEONTX_PKO_H__
35*445371e8SJerin Jacob 
36*445371e8SJerin Jacob /* PKO maximum constants */
37*445371e8SJerin Jacob #define	PKO_VF_MAX			(32)
38*445371e8SJerin Jacob #define	PKO_VF_NUM_DQ			(8)
39*445371e8SJerin Jacob #define PKO_MAX_NUM_DQ			(8)
40*445371e8SJerin Jacob #define	PKO_DQ_DRAIN_TO			(1000)
41*445371e8SJerin Jacob 
42*445371e8SJerin Jacob #define PKO_DQ_FC_SKID			(4)
43*445371e8SJerin Jacob #define PKO_DQ_FC_DEPTH_PAGES		(2048)
44*445371e8SJerin Jacob #define PKO_DQ_FC_STRIDE_16		(16)
45*445371e8SJerin Jacob #define PKO_DQ_FC_STRIDE_128		(128)
46*445371e8SJerin Jacob #define PKO_DQ_FC_STRIDE		PKO_DQ_FC_STRIDE_16
47*445371e8SJerin Jacob 
48*445371e8SJerin Jacob #define PKO_DQ_KIND_BIT			49
49*445371e8SJerin Jacob #define PKO_DQ_STATUS_BIT		60
50*445371e8SJerin Jacob #define PKO_DQ_OP_BIT			48
51*445371e8SJerin Jacob 
52*445371e8SJerin Jacob /* PKO VF register offsets from VF_BAR0 */
53*445371e8SJerin Jacob #define	PKO_VF_DQ_SW_XOFF(gdq)		(0x000100 | (gdq) << 17)
54*445371e8SJerin Jacob #define	PKO_VF_DQ_WM_CTL(gdq)		(0x000130 | (gdq) << 17)
55*445371e8SJerin Jacob #define	PKO_VF_DQ_WM_CNT(gdq)		(0x000150 | (gdq) << 17)
56*445371e8SJerin Jacob #define	PKO_VF_DQ_FC_CONFIG		(0x000160)
57*445371e8SJerin Jacob #define	PKO_VF_DQ_FC_STATUS(gdq)	(0x000168 | (gdq) << 17)
58*445371e8SJerin Jacob #define	PKO_VF_DQ_OP_SEND(gdq, op)	(0x001000 | (gdq) << 17 | (op) << 3)
59*445371e8SJerin Jacob #define	PKO_VF_DQ_OP_OPEN(gdq)		(0x001100 | (gdq) << 17)
60*445371e8SJerin Jacob #define	PKO_VF_DQ_OP_CLOSE(gdq)		(0x001200 | (gdq) << 17)
61*445371e8SJerin Jacob #define	PKO_VF_DQ_OP_QUERY(gdq)		(0x001300 | (gdq) << 17)
62*445371e8SJerin Jacob 
63*445371e8SJerin Jacob #endif /* __OCTEONTX_PKO_H__ */
64