drivers/mailbox/ti-msgmgr.c
Source file repositories/reference/linux-study-clean/drivers/mailbox/ti-msgmgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mailbox/ti-msgmgr.c- Extension
.c- Size
- 26500 bytes
- Lines
- 933
- Domain
- Driver Families
- Bucket
- drivers/mailbox
- 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.
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/interrupt.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/mailbox_controller.hlinux/module.hlinux/of.hlinux/of_irq.hlinux/platform_device.hlinux/property.hlinux/soc/ti/ti-msgmgr.h
Detected Declarations
struct ti_msgmgr_valid_queue_descstruct ti_msgmgr_descstruct ti_queue_inststruct ti_msgmgr_instfunction ti_msgmgr_queue_get_num_messagesfunction ti_msgmgr_queue_is_errorfunction ti_msgmgr_queue_rx_datafunction ti_msgmgr_queue_rx_poll_timeoutfunction ti_msgmgr_queue_rx_interruptfunction ti_msgmgr_queue_peek_datafunction ti_msgmgr_last_tx_donefunction ti_msgmgr_chan_has_polled_queue_rxfunction ti_msgmgr_send_datafunction regfunction ti_msgmgr_queue_rx_irq_reqfunction ti_msgmgr_queue_startupfunction ti_msgmgr_queue_shutdownfunction ti_msgmgr_of_xlatefunction ti_msgmgr_queue_setupfunction ti_msgmgr_queue_rx_set_polled_modefunction ti_msgmgr_suspendfunction ti_msgmgr_resumefunction ti_msgmgr_probe
Annotated Snippet
struct ti_msgmgr_valid_queue_desc {
u8 queue_id;
u8 proxy_id;
bool is_tx;
};
/**
* struct ti_msgmgr_desc - Description of message manager integration
* @queue_count: Number of Queues
* @max_message_size: Message size in bytes
* @max_messages: Number of messages
* @data_first_reg: First data register for proxy data region
* @data_last_reg: Last data register for proxy data region
* @status_cnt_mask: Mask for getting the status value
* @status_err_mask: Mask for getting the error value, if applicable
* @tx_polled: Do I need to use polled mechanism for tx
* @tx_poll_timeout_ms: Timeout in ms if polled
* @valid_queues: List of Valid queues that the processor can access
* @data_region_name: Name of the proxy data region
* @status_region_name: Name of the proxy status region
* @ctrl_region_name: Name of the proxy control region
* @num_valid_queues: Number of valid queues
* @is_sproxy: Is this an Secure Proxy instance?
*
* This structure is used in of match data to describe how integration
* for a specific compatible SoC is done.
*/
struct ti_msgmgr_desc {
u8 queue_count;
u8 max_message_size;
u8 max_messages;
u8 data_first_reg;
u8 data_last_reg;
u32 status_cnt_mask;
u32 status_err_mask;
bool tx_polled;
int tx_poll_timeout_ms;
const struct ti_msgmgr_valid_queue_desc *valid_queues;
const char *data_region_name;
const char *status_region_name;
const char *ctrl_region_name;
int num_valid_queues;
bool is_sproxy;
};
/**
* struct ti_queue_inst - Description of a queue instance
* @name: Queue Name
* @queue_id: Queue Identifier as mapped on SoC
* @proxy_id: Proxy Identifier as mapped on SoC
* @irq: IRQ for Rx Queue
* @is_tx: 'true' if transmit queue, else, 'false'
* @queue_buff_start: First register of Data Buffer
* @queue_buff_end: Last (or confirmation) register of Data buffer
* @queue_state: Queue status register
* @queue_ctrl: Queue Control register
* @chan: Mailbox channel
* @rx_buff: Receive buffer pointer allocated at probe, max_message_size
* @polled_rx_mode: Use polling for rx instead of interrupts
*/
struct ti_queue_inst {
char name[30];
u8 queue_id;
u8 proxy_id;
int irq;
bool is_tx;
void __iomem *queue_buff_start;
void __iomem *queue_buff_end;
void __iomem *queue_state;
void __iomem *queue_ctrl;
struct mbox_chan *chan;
u32 *rx_buff;
bool polled_rx_mode;
};
/**
* struct ti_msgmgr_inst - Description of a Message Manager Instance
* @dev: device pointer corresponding to the Message Manager instance
* @desc: Description of the SoC integration
* @queue_proxy_region: Queue proxy region where queue buffers are located
* @queue_state_debug_region: Queue status register regions
* @queue_ctrl_region: Queue Control register regions
* @num_valid_queues: Number of valid queues defined for the processor
* Note: other queues are probably reserved for other processors
* in the SoC.
* @qinsts: Array of valid Queue Instances for the Processor
* @mbox: Mailbox Controller
* @chans: Array for channels corresponding to the Queue Instances.
*/
struct ti_msgmgr_inst {
Annotation
- Immediate include surface: `linux/device.h`, `linux/interrupt.h`, `linux/io.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/mailbox_controller.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct ti_msgmgr_valid_queue_desc`, `struct ti_msgmgr_desc`, `struct ti_queue_inst`, `struct ti_msgmgr_inst`, `function ti_msgmgr_queue_get_num_messages`, `function ti_msgmgr_queue_is_error`, `function ti_msgmgr_queue_rx_data`, `function ti_msgmgr_queue_rx_poll_timeout`, `function ti_msgmgr_queue_rx_interrupt`, `function ti_msgmgr_queue_peek_data`.
- Atlas domain: Driver Families / drivers/mailbox.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.