drivers/net/ethernet/marvell/octeon_ep/octep_regs_cn9k_pf.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeon_ep/octep_regs_cn9k_pf.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/marvell/octeon_ep/octep_regs_cn9k_pf.h
Extension
.h
Size
18577 bytes
Lines
422
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/bitfield.h>

#ifndef _OCTEP_REGS_CN9K_PF_H_
#define _OCTEP_REGS_CN9K_PF_H_

/* ############################ RST ######################### */
#define    CN93_RST_BOOT               0x000087E006001600ULL
#define    CN93_RST_CORE_DOMAIN_W1S    0x000087E006001820ULL
#define    CN93_RST_CORE_DOMAIN_W1C    0x000087E006001828ULL

#define     CN93_CONFIG_XPANSION_BAR             0x38
#define     CN93_CONFIG_PCIE_CAP                 0x70
#define     CN93_CONFIG_PCIE_DEVCAP              0x74
#define     CN93_CONFIG_PCIE_DEVCTL              0x78
#define     CN93_CONFIG_PCIE_LINKCAP             0x7C
#define     CN93_CONFIG_PCIE_LINKCTL             0x80
#define     CN93_CONFIG_PCIE_SLOTCAP             0x84
#define     CN93_CONFIG_PCIE_SLOTCTL             0x88

#define     CN93_PCIE_SRIOV_FDL                  0x188      /* 0x98 */
#define     CN93_PCIE_SRIOV_FDL_BIT_POS          0x10
#define     CN93_PCIE_SRIOV_FDL_MASK             0xFF

#define     CN93_CONFIG_PCIE_FLTMSK              0x720

/* ################# Offsets of RING, EPF, MAC ######################### */
#define    CN93_RING_OFFSET                      (0x1ULL << 17)
#define    CN93_EPF_OFFSET                       (0x1ULL << 25)
#define    CN93_MAC_OFFSET                       (0x1ULL << 4)
#define    CN93_BIT_ARRAY_OFFSET                 (0x1ULL << 4)
#define    CN93_EPVF_RING_OFFSET                 (0x1ULL << 4)

/* ################# Scratch Registers ######################### */
#define    CN93_SDP_EPF_SCRATCH                  0x205E0

/* ################# Window Registers ######################### */
#define    CN93_SDP_WIN_WR_ADDR64                0x20000
#define    CN93_SDP_WIN_RD_ADDR64                0x20010
#define    CN93_SDP_WIN_WR_DATA64                0x20020
#define    CN93_SDP_WIN_WR_MASK_REG              0x20030
#define    CN93_SDP_WIN_RD_DATA64                0x20040

#define    CN93_SDP_MAC_NUMBER                   0x2C100

/* ################# Global Previliged registers ######################### */
#define    CN93_SDP_EPF_RINFO                    0x205F0

#define    CN93_SDP_EPF_RINFO_SRN(val)           ((val) & 0xFF)
#define    CN93_SDP_EPF_RINFO_RPVF(val)          (((val) >> 32) & 0xF)
#define    CN93_SDP_EPF_RINFO_NVFS(val)          (((val) >> 48) & 0xFF)

/* SDP Function select */
#define    CN93_SDP_FUNC_SEL_EPF_BIT_POS         8
#define    CN93_SDP_FUNC_SEL_FUNC_BIT_POS        0

/* ##### RING IN (Into device from PCI: Tx Ring) REGISTERS #### */
#define    CN93_SDP_R_IN_CONTROL_START           0x10000
#define    CN93_SDP_R_IN_ENABLE_START            0x10010
#define    CN93_SDP_R_IN_INSTR_BADDR_START       0x10020
#define    CN93_SDP_R_IN_INSTR_RSIZE_START       0x10030
#define    CN93_SDP_R_IN_INSTR_DBELL_START       0x10040
#define    CN93_SDP_R_IN_CNTS_START              0x10050
#define    CN93_SDP_R_IN_INT_LEVELS_START        0x10060
#define    CN93_SDP_R_IN_PKT_CNT_START           0x10080
#define    CN93_SDP_R_IN_BYTE_CNT_START          0x10090

#define    CN93_SDP_R_IN_CONTROL(ring)		\
	(CN93_SDP_R_IN_CONTROL_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_ENABLE(ring)		\
	(CN93_SDP_R_IN_ENABLE_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_INSTR_BADDR(ring)	\
	(CN93_SDP_R_IN_INSTR_BADDR_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_INSTR_RSIZE(ring)	\
	(CN93_SDP_R_IN_INSTR_RSIZE_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_INSTR_DBELL(ring)	\
	(CN93_SDP_R_IN_INSTR_DBELL_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_CNTS(ring)		\
	(CN93_SDP_R_IN_CNTS_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_INT_LEVELS(ring)	\
	(CN93_SDP_R_IN_INT_LEVELS_START + ((ring) * CN93_RING_OFFSET))

#define    CN93_SDP_R_IN_PKT_CNT(ring)		\
	(CN93_SDP_R_IN_PKT_CNT_START + ((ring) * CN93_RING_OFFSET))

Annotation

Implementation Notes