162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */
262306a36Sopenharmony_ci/* Copyright (c) 2017 - 2021 Intel Corporation */
362306a36Sopenharmony_ci#ifndef ICRDMA_HW_H
462306a36Sopenharmony_ci#define ICRDMA_HW_H
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#include "irdma.h"
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#define VFPE_CQPTAIL1		0x0000a000
962306a36Sopenharmony_ci#define VFPE_CQPDB1		0x0000bc00
1062306a36Sopenharmony_ci#define VFPE_CCQPSTATUS1	0x0000b800
1162306a36Sopenharmony_ci#define VFPE_CCQPHIGH1		0x00009800
1262306a36Sopenharmony_ci#define VFPE_CCQPLOW1		0x0000ac00
1362306a36Sopenharmony_ci#define VFPE_CQARM1		0x0000b400
1462306a36Sopenharmony_ci#define VFPE_CQARM1		0x0000b400
1562306a36Sopenharmony_ci#define VFPE_CQACK1		0x0000b000
1662306a36Sopenharmony_ci#define VFPE_AEQALLOC1		0x0000a400
1762306a36Sopenharmony_ci#define VFPE_CQPERRCODES1	0x00009c00
1862306a36Sopenharmony_ci#define VFPE_WQEALLOC1		0x0000c000
1962306a36Sopenharmony_ci#define VFINT_DYN_CTLN(_i)	(0x00003800 + ((_i) * 4)) /* _i=0...63 */
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#define PFPE_CQPTAIL		0x00500880
2262306a36Sopenharmony_ci#define PFPE_CQPDB		0x00500800
2362306a36Sopenharmony_ci#define PFPE_CCQPSTATUS		0x0050a000
2462306a36Sopenharmony_ci#define PFPE_CCQPHIGH		0x0050a100
2562306a36Sopenharmony_ci#define PFPE_CCQPLOW		0x0050a080
2662306a36Sopenharmony_ci#define PFPE_CQARM		0x00502c00
2762306a36Sopenharmony_ci#define PFPE_CQACK		0x00502c80
2862306a36Sopenharmony_ci#define PFPE_AEQALLOC		0x00502d00
2962306a36Sopenharmony_ci#define GLINT_DYN_CTL(_INT)	(0x00160000 + ((_INT) * 4)) /* _i=0...2047 */
3062306a36Sopenharmony_ci#define GLPCI_LBARCTRL		0x0009de74
3162306a36Sopenharmony_ci#define GLPE_CPUSTATUS0		0x0050ba5c
3262306a36Sopenharmony_ci#define GLPE_CPUSTATUS1		0x0050ba60
3362306a36Sopenharmony_ci#define GLPE_CPUSTATUS2		0x0050ba64
3462306a36Sopenharmony_ci#define PFINT_AEQCTL		0x0016cb00
3562306a36Sopenharmony_ci#define PFPE_CQPERRCODES	0x0050a200
3662306a36Sopenharmony_ci#define PFPE_WQEALLOC		0x00504400
3762306a36Sopenharmony_ci#define GLINT_CEQCTL(_INT)	(0x0015c000 + ((_INT) * 4)) /* _i=0...2047 */
3862306a36Sopenharmony_ci#define VSIQF_PE_CTL1(_VSI)	(0x00414000 + ((_VSI) * 4)) /* _i=0...767 */
3962306a36Sopenharmony_ci#define PFHMC_PDINV		0x00520300
4062306a36Sopenharmony_ci#define GLHMC_VFPDINV(_i)	(0x00528300 + ((_i) * 4)) /* _i=0...31 */
4162306a36Sopenharmony_ci#define GLPE_CRITERR		0x00534000
4262306a36Sopenharmony_ci#define GLINT_RATE(_INT)	(0x0015A000 + ((_INT) * 4)) /* _i=0...2047 */ /* Reset Source: CORER */
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#define ICRDMA_DB_ADDR_OFFSET		(8 * 1024 * 1024 - 64 * 1024)
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#define ICRDMA_VF_DB_ADDR_OFFSET	(64 * 1024)
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/* shifts/masks for FLD_[LS/RS]_64 macros used in device table */
4962306a36Sopenharmony_ci#define ICRDMA_CCQPSTATUS_CCQP_DONE_S 0
5062306a36Sopenharmony_ci#define ICRDMA_CCQPSTATUS_CCQP_DONE BIT_ULL(0)
5162306a36Sopenharmony_ci#define ICRDMA_CCQPSTATUS_CCQP_ERR_S 31
5262306a36Sopenharmony_ci#define ICRDMA_CCQPSTATUS_CCQP_ERR BIT_ULL(31)
5362306a36Sopenharmony_ci#define ICRDMA_CQPSQ_STAG_PDID_S 46
5462306a36Sopenharmony_ci#define ICRDMA_CQPSQ_STAG_PDID GENMASK_ULL(63, 46)
5562306a36Sopenharmony_ci#define ICRDMA_CQPSQ_CQ_CEQID_S 22
5662306a36Sopenharmony_ci#define ICRDMA_CQPSQ_CQ_CEQID GENMASK_ULL(31, 22)
5762306a36Sopenharmony_ci#define ICRDMA_CQPSQ_CQ_CQID_S 0
5862306a36Sopenharmony_ci#define ICRDMA_CQPSQ_CQ_CQID GENMASK_ULL(18, 0)
5962306a36Sopenharmony_ci#define ICRDMA_COMMIT_FPM_CQCNT_S 0
6062306a36Sopenharmony_ci#define ICRDMA_COMMIT_FPM_CQCNT GENMASK_ULL(19, 0)
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_cienum icrdma_device_caps_const {
6362306a36Sopenharmony_ci	ICRDMA_MAX_STATS_COUNT = 128,
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci	ICRDMA_MAX_IRD_SIZE			= 127,
6662306a36Sopenharmony_ci	ICRDMA_MAX_ORD_SIZE			= 255,
6762306a36Sopenharmony_ci	ICRDMA_MIN_WQ_SIZE                      = 8 /* WQEs */,
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci};
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_civoid icrdma_init_hw(struct irdma_sc_dev *dev);
7262306a36Sopenharmony_ci#endif /* ICRDMA_HW_H*/
73