drivers/firmware/tegra/bpmp-tegra186.c
Source file repositories/reference/linux-study-clean/drivers/firmware/tegra/bpmp-tegra186.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/tegra/bpmp-tegra186.c- Extension
.c- Size
- 8954 bytes
- Lines
- 388
- Domain
- Driver Families
- Bucket
- drivers/firmware
- 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.
- 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/genalloc.hlinux/io.hlinux/mailbox_client.hlinux/of_reserved_mem.hlinux/platform_device.hsoc/tegra/bpmp.hsoc/tegra/bpmp-abi.hsoc/tegra/ivc.hbpmp-private.h
Detected Declarations
struct tegra186_bpmpfunction mbox_client_to_bpmpfunction tegra186_bpmp_is_message_readyfunction tegra186_bpmp_is_channel_freefunction tegra186_bpmp_ack_messagefunction tegra186_bpmp_post_messagefunction tegra186_bpmp_ring_doorbellfunction tegra186_bpmp_ivc_notifyfunction tegra186_bpmp_channel_initfunction tegra186_bpmp_channel_resetfunction tegra186_bpmp_channel_cleanupfunction mbox_handle_rxfunction tegra186_bpmp_teardown_channelsfunction tegra186_bpmp_dram_initfunction tegra186_bpmp_sram_initfunction tegra186_bpmp_setup_channelsfunction tegra186_bpmp_reset_channelsfunction tegra186_bpmp_initfunction tegra186_bpmp_deinitfunction tegra186_bpmp_resume
Annotated Snippet
struct tegra186_bpmp {
struct tegra_bpmp *parent;
struct {
struct gen_pool *pool;
union {
void __iomem *sram;
void *dram;
};
dma_addr_t phys;
} tx, rx;
struct {
struct mbox_client client;
struct mbox_chan *channel;
} mbox;
};
static inline struct tegra_bpmp *
mbox_client_to_bpmp(struct mbox_client *client)
{
struct tegra186_bpmp *priv;
priv = container_of(client, struct tegra186_bpmp, mbox.client);
return priv->parent;
}
static bool tegra186_bpmp_is_message_ready(struct tegra_bpmp_channel *channel)
{
int err;
err = tegra_ivc_read_get_next_frame(channel->ivc, &channel->ib);
if (err) {
iosys_map_clear(&channel->ib);
return false;
}
return true;
}
static bool tegra186_bpmp_is_channel_free(struct tegra_bpmp_channel *channel)
{
int err;
err = tegra_ivc_write_get_next_frame(channel->ivc, &channel->ob);
if (err) {
iosys_map_clear(&channel->ob);
return false;
}
return true;
}
static int tegra186_bpmp_ack_message(struct tegra_bpmp_channel *channel)
{
return tegra_ivc_read_advance(channel->ivc);
}
static int tegra186_bpmp_post_message(struct tegra_bpmp_channel *channel)
{
return tegra_ivc_write_advance(channel->ivc);
}
static int tegra186_bpmp_ring_doorbell(struct tegra_bpmp *bpmp)
{
struct tegra186_bpmp *priv = bpmp->priv;
int err;
err = mbox_send_message(priv->mbox.channel, NULL);
if (err < 0)
return err;
mbox_client_txdone(priv->mbox.channel, 0);
return 0;
}
static void tegra186_bpmp_ivc_notify(struct tegra_ivc *ivc, void *data)
{
struct tegra_bpmp *bpmp = data;
struct tegra186_bpmp *priv = bpmp->priv;
if (WARN_ON(priv->mbox.channel == NULL))
return;
tegra186_bpmp_ring_doorbell(bpmp);
}
static int tegra186_bpmp_channel_init(struct tegra_bpmp_channel *channel,
Annotation
- Immediate include surface: `linux/genalloc.h`, `linux/io.h`, `linux/mailbox_client.h`, `linux/of_reserved_mem.h`, `linux/platform_device.h`, `soc/tegra/bpmp.h`, `soc/tegra/bpmp-abi.h`, `soc/tegra/ivc.h`.
- Detected declarations: `struct tegra186_bpmp`, `function mbox_client_to_bpmp`, `function tegra186_bpmp_is_message_ready`, `function tegra186_bpmp_is_channel_free`, `function tegra186_bpmp_ack_message`, `function tegra186_bpmp_post_message`, `function tegra186_bpmp_ring_doorbell`, `function tegra186_bpmp_ivc_notify`, `function tegra186_bpmp_channel_init`, `function tegra186_bpmp_channel_reset`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: source implementation candidate.
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.