drivers/accel/habanalabs/include/gaudi2/gaudi2_packets.h

Source file repositories/reference/linux-study-clean/drivers/accel/habanalabs/include/gaudi2/gaudi2_packets.h

File Facts

System
Linux kernel
Corpus path
drivers/accel/habanalabs/include/gaudi2/gaudi2_packets.h
Extension
.h
Size
4309 bytes
Lines
198
Domain
Driver Families
Bucket
drivers/accel
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

struct gaudi2_packet {
	__le64 header;
	/* The rest of the packet data follows. Use the corresponding
	 * packet_XXX struct to deference the data, based on packet type
	 */
	u8 contents[];
};

struct packet_nop {
	__le32 reserved;
	__le32 ctl;
};

struct packet_stop {
	__le32 reserved;
	__le32 ctl;
};

struct packet_wreg32 {
	__le32 value;
	__le32 ctl;
};

struct packet_wreg_bulk {
	__le32 size64;
	__le32 ctl;
	__le64 values[]; /* data starts here */
};

struct packet_msg_long {
	__le32 value;
	__le32 ctl;
	__le64 addr;
};

#define GAUDI2_PKT_SHORT_VAL_SOB_SYNC_VAL_SHIFT	0
#define GAUDI2_PKT_SHORT_VAL_SOB_SYNC_VAL_MASK	0x00007FFF

#define GAUDI2_PKT_SHORT_VAL_SOB_MOD_SHIFT	31
#define GAUDI2_PKT_SHORT_VAL_SOB_MOD_MASK	0x80000000

#define GAUDI2_PKT_SHORT_VAL_MON_SYNC_GID_SHIFT	0
#define GAUDI2_PKT_SHORT_VAL_MON_SYNC_GID_MASK	0x000000FF

#define GAUDI2_PKT_SHORT_VAL_MON_MASK_SHIFT	8
#define GAUDI2_PKT_SHORT_VAL_MON_MASK_MASK	0x0000FF00

#define GAUDI2_PKT_SHORT_VAL_MON_MODE_SHIFT	16
#define GAUDI2_PKT_SHORT_VAL_MON_MODE_MASK	0x00010000

#define GAUDI2_PKT_SHORT_VAL_MON_SYNC_VAL_SHIFT	17
#define GAUDI2_PKT_SHORT_VAL_MON_SYNC_VAL_MASK	0xFFFE0000

#define GAUDI2_PKT_SHORT_CTL_ADDR_SHIFT		0
#define GAUDI2_PKT_SHORT_CTL_ADDR_MASK		0x0000FFFF

#define GAUDI2_PKT_SHORT_CTL_BASE_SHIFT		22
#define GAUDI2_PKT_SHORT_CTL_BASE_MASK		0x00C00000

struct packet_msg_short {
	__le32 value;
	__le32 ctl;
};

struct packet_msg_prot {
	__le32 value;
	__le32 ctl;
	__le64 addr;
};

#define GAUDI2_PKT_FENCE_CFG_DEC_VAL_SHIFT	0
#define GAUDI2_PKT_FENCE_CFG_DEC_VAL_MASK	0x0000000F

#define GAUDI2_PKT_FENCE_CFG_TARGET_VAL_SHIFT	16
#define GAUDI2_PKT_FENCE_CFG_TARGET_VAL_MASK	0x00FF0000

#define GAUDI2_PKT_FENCE_CFG_ID_SHIFT		30
#define GAUDI2_PKT_FENCE_CFG_ID_MASK		0xC0000000

#define GAUDI2_PKT_FENCE_CTL_PRED_SHIFT		0
#define GAUDI2_PKT_FENCE_CTL_PRED_MASK		0x0000001F

struct packet_fence {
	__le32 cfg;
	__le32 ctl;
};

#define GAUDI2_PKT_LIN_DMA_CTL_WRCOMP_SHIFT	0
#define GAUDI2_PKT_LIN_DMA_CTL_WRCOMP_MASK	0x00000001

Annotation

Implementation Notes