mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
Enable ring functionality by registering RX, AGG, TX, CMPL, and NQ rings with the firmware. Initialise the doorbells associated with the rings. Signed-off-by: Bhargava Marreddy <bhargava.marreddy@broadcom.com> Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com> Reviewed-by: Rajashekar Hudumula <rajashekar.hudumula@broadcom.com> Link: https://patch.msgid.link/20250919174742.24969-9-bhargava.marreddy@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
35 lines
927 B
C
35 lines
927 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (c) 2025 Broadcom */
|
|
|
|
#ifndef _BNGE_DB_H_
|
|
#define _BNGE_DB_H_
|
|
|
|
/* 64-bit doorbell */
|
|
#define DBR_EPOCH_SFT 24
|
|
#define DBR_TOGGLE_SFT 25
|
|
#define DBR_XID_SFT 32
|
|
#define DBR_PATH_L2 (0x1ULL << 56)
|
|
#define DBR_VALID (0x1ULL << 58)
|
|
#define DBR_TYPE_SQ (0x0ULL << 60)
|
|
#define DBR_TYPE_SRQ (0x2ULL << 60)
|
|
#define DBR_TYPE_CQ (0x4ULL << 60)
|
|
#define DBR_TYPE_CQ_ARMALL (0x6ULL << 60)
|
|
#define DBR_TYPE_NQ (0xaULL << 60)
|
|
#define DBR_TYPE_NQ_ARM (0xbULL << 60)
|
|
#define DBR_TYPE_NQ_MASK (0xeULL << 60)
|
|
|
|
struct bnge_db_info {
|
|
void __iomem *doorbell;
|
|
u64 db_key64;
|
|
u32 db_ring_mask;
|
|
u32 db_epoch_mask;
|
|
u8 db_epoch_shift;
|
|
};
|
|
|
|
#define DB_EPOCH(db, idx) (((idx) & (db)->db_epoch_mask) << \
|
|
((db)->db_epoch_shift))
|
|
#define DB_RING_IDX(db, idx) (((idx) & (db)->db_ring_mask) | \
|
|
DB_EPOCH(db, idx))
|
|
|
|
#endif /* _BNGE_DB_H_ */
|