drivers/mailbox/arm_mhuv2.c
Source file repositories/reference/linux-study-clean/drivers/mailbox/arm_mhuv2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mailbox/arm_mhuv2.c- Extension
.c- Size
- 30187 bytes
- Lines
- 1139
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/amba/bus.hlinux/interrupt.hlinux/mailbox_controller.hlinux/mailbox/arm_mhuv2_message.hlinux/module.hlinux/of_address.hlinux/spinlock.h
Detected Declarations
struct mhu_cfg_tstruct int_st_tstruct int_clr_tstruct int_en_tstruct iidr_tstruct aidr_tstruct mhu2_send_ch_wn_regstruct mhu2_send_frame_regstruct mhu2_recv_ch_wn_regstruct mhu2_recv_frame_regstruct mhuv2struct mhuv2_protocol_opsstruct mhuv2_mbox_chan_privenum mhuv2_transport_protocolenum mhuv2_framefunction mhuv2_doorbell_rx_startupfunction mhuv2_doorbell_rx_shutdownfunction mhuv2_doorbell_last_tx_donefunction mhuv2_doorbell_send_datafunction mhuv2_data_transfer_rx_startupfunction mhuv2_data_transfer_rx_shutdownfunction mhuv2_data_transfer_tx_startupfunction mhuv2_data_transfer_tx_shutdownfunction mhuv2_data_transfer_last_tx_donefunction mhuv2_data_transfer_send_datafunction mhuv2_sender_interruptfunction mhuv2_receiver_interruptfunction mhuv2_sender_last_tx_donefunction mhuv2_sender_send_datafunction mhuv2_sender_startupfunction mhuv2_sender_shutdownfunction mhuv2_receiver_startupfunction mhuv2_receiver_shutdownfunction mhuv2_receiver_send_datafunction mhuv2_receiver_last_tx_donefunction mhuv2_verify_protocolfunction mhuv2_allocate_channelsfunction mhuv2_parse_channelsfunction mhuv2_tx_initfunction mhuv2_rx_initfunction mhuv2_probefunction mhuv2_remove
Annotated Snippet
struct mhu_cfg_t {
u32 num_ch : 7;
u32 pad : 25;
} __packed;
/* register Interrupt Status fields */
struct int_st_t {
u32 nr2r : 1;
u32 r2nr : 1;
u32 pad : 30;
} __packed;
/* Register Interrupt Clear fields */
struct int_clr_t {
u32 nr2r : 1;
u32 r2nr : 1;
u32 pad : 30;
} __packed;
/* Register Interrupt Enable fields */
struct int_en_t {
u32 r2nr : 1;
u32 nr2r : 1;
u32 chcomb : 1;
u32 pad : 29;
} __packed;
/* Register Implementer Identification fields */
struct iidr_t {
u32 implementer : 12;
u32 revision : 4;
u32 variant : 4;
u32 product_id : 12;
} __packed;
/* Register Architecture Identification Register fields */
struct aidr_t {
u32 arch_minor_rev : 4;
u32 arch_major_rev : 4;
u32 pad : 24;
} __packed;
/* Sender Channel Window fields */
struct mhu2_send_ch_wn_reg {
u32 stat;
u8 pad1[0x0C - 0x04];
u32 stat_set;
u32 int_st;
u32 int_clr;
u32 int_en;
u8 pad2[0x20 - 0x1C];
} __packed;
/* Sender frame register fields */
struct mhu2_send_frame_reg {
struct mhu2_send_ch_wn_reg ch_wn[MHUV2_CH_WN_MAX];
struct mhu_cfg_t mhu_cfg;
u32 resp_cfg;
u32 access_request;
u32 access_ready;
struct int_st_t int_st;
struct int_clr_t int_clr;
struct int_en_t int_en;
u32 reserved0;
u32 chcomb_int_st[MHUV2_CMB_INT_ST_REG_CNT];
u8 pad[0xFC8 - 0xFB0];
struct iidr_t iidr;
struct aidr_t aidr;
} __packed;
/* Receiver Channel Window fields */
struct mhu2_recv_ch_wn_reg {
u32 stat;
u32 stat_masked;
u32 stat_clear;
u8 reserved0[0x10 - 0x0C];
u32 mask;
u32 mask_set;
u32 mask_clear;
u8 pad[0x20 - 0x1C];
} __packed;
/* Receiver frame register fields */
struct mhu2_recv_frame_reg {
struct mhu2_recv_ch_wn_reg ch_wn[MHUV2_CH_WN_MAX];
struct mhu_cfg_t mhu_cfg;
u8 reserved0[0xF90 - 0xF84];
struct int_st_t int_st;
struct int_clr_t int_clr;
struct int_en_t int_en;
Annotation
- Immediate include surface: `linux/amba/bus.h`, `linux/interrupt.h`, `linux/mailbox_controller.h`, `linux/mailbox/arm_mhuv2_message.h`, `linux/module.h`, `linux/of_address.h`, `linux/spinlock.h`.
- Detected declarations: `struct mhu_cfg_t`, `struct int_st_t`, `struct int_clr_t`, `struct int_en_t`, `struct iidr_t`, `struct aidr_t`, `struct mhu2_send_ch_wn_reg`, `struct mhu2_send_frame_reg`, `struct mhu2_recv_ch_wn_reg`, `struct mhu2_recv_frame_reg`.
- Atlas domain: Driver Families / drivers/mailbox.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.