include/linux/mailbox/mtk-cmdq-mailbox.h

Source file repositories/reference/linux-study-clean/include/linux/mailbox/mtk-cmdq-mailbox.h

File Facts

System
Linux kernel
Corpus path
include/linux/mailbox/mtk-cmdq-mailbox.h
Extension
.h
Size
2849 bytes
Lines
112
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct cmdq_cb_data {
	int			sta;
	struct cmdq_pkt		*pkt;
};

struct cmdq_mbox_priv {
	u8 shift_pa;
	dma_addr_t mminfra_offset;
};

struct cmdq_pkt {
	void			*va_base;
	dma_addr_t		pa_base;
	size_t			cmd_buf_size; /* command occupied size */
	size_t			buf_size; /* real buffer size */
	struct cmdq_mbox_priv	priv; /* for generating instruction */
};

/**
 * cmdq_get_mbox_priv() - get the private data of mailbox channel
 * @chan: mailbox channel
 * @priv: pointer to store the private data of mailbox channel
 *
 * While generating the GCE instruction to command buffer, the private data
 * of GCE hardware may need to be referenced, such as the shift bits of
 * physical address.
 *
 * This function should be called before generating the GCE instruction.
 */
void cmdq_get_mbox_priv(struct mbox_chan *chan, struct cmdq_mbox_priv *priv);

/**
 * cmdq_get_shift_pa() - get the shift bits of physical address
 * @chan: mailbox channel
 *
 * GCE can only fetch the command buffer address from a 32-bit register.
 * Some SOCs support more than 32-bit command buffer address for GCE, which
 * requires some shift bits to make the address fit into the 32-bit register.
 *
 * Return: the shift bits of physical address
 */
u8 cmdq_get_shift_pa(struct mbox_chan *chan);

#endif /* __MTK_CMDQ_MAILBOX_H__ */

Annotation

Implementation Notes