drivers/firmware/tegra/bpmp-tegra210.c
Source file repositories/reference/linux-study-clean/drivers/firmware/tegra/bpmp-tegra210.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/tegra/bpmp-tegra210.c- Extension
.c- Size
- 5904 bytes
- Lines
- 238
- 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.
- 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/interrupt.hlinux/irq.hlinux/io.hlinux/of.hlinux/platform_device.hsoc/tegra/bpmp.hbpmp-private.h
Detected Declarations
struct tegra210_bpmpfunction bpmp_channel_statusfunction tegra210_bpmp_is_response_readyfunction tegra210_bpmp_is_request_readyfunction tegra210_bpmp_is_request_channel_freefunction tegra210_bpmp_is_response_channel_freefunction tegra210_bpmp_post_requestfunction tegra210_bpmp_post_responsefunction tegra210_bpmp_ack_responsefunction tegra210_bpmp_ack_requestfunction tegra210_bpmp_ring_doorbellfunction rx_irqfunction tegra210_bpmp_channel_initfunction tegra210_bpmp_init
Annotated Snippet
struct tegra210_bpmp {
void __iomem *atomics;
void __iomem *arb_sema;
struct irq_data *tx_irq_data;
};
static u32 bpmp_channel_status(struct tegra_bpmp *bpmp, unsigned int index)
{
struct tegra210_bpmp *priv = bpmp->priv;
return __raw_readl(priv->arb_sema + STA_OFFSET) & CH_MASK(index);
}
static bool tegra210_bpmp_is_response_ready(struct tegra_bpmp_channel *channel)
{
unsigned int index = channel->index;
return bpmp_channel_status(channel->bpmp, index) == MA_ACKD(index);
}
static bool tegra210_bpmp_is_request_ready(struct tegra_bpmp_channel *channel)
{
unsigned int index = channel->index;
return bpmp_channel_status(channel->bpmp, index) == SL_SIGL(index);
}
static bool
tegra210_bpmp_is_request_channel_free(struct tegra_bpmp_channel *channel)
{
unsigned int index = channel->index;
return bpmp_channel_status(channel->bpmp, index) == MA_FREE(index);
}
static bool
tegra210_bpmp_is_response_channel_free(struct tegra_bpmp_channel *channel)
{
unsigned int index = channel->index;
return bpmp_channel_status(channel->bpmp, index) == SL_QUED(index);
}
static int tegra210_bpmp_post_request(struct tegra_bpmp_channel *channel)
{
struct tegra210_bpmp *priv = channel->bpmp->priv;
__raw_writel(CH_MASK(channel->index), priv->arb_sema + CLR_OFFSET);
return 0;
}
static int tegra210_bpmp_post_response(struct tegra_bpmp_channel *channel)
{
struct tegra210_bpmp *priv = channel->bpmp->priv;
__raw_writel(MA_ACKD(channel->index), priv->arb_sema + SET_OFFSET);
return 0;
}
static int tegra210_bpmp_ack_response(struct tegra_bpmp_channel *channel)
{
struct tegra210_bpmp *priv = channel->bpmp->priv;
__raw_writel(MA_ACKD(channel->index) ^ MA_FREE(channel->index),
priv->arb_sema + CLR_OFFSET);
return 0;
}
static int tegra210_bpmp_ack_request(struct tegra_bpmp_channel *channel)
{
struct tegra210_bpmp *priv = channel->bpmp->priv;
__raw_writel(SL_QUED(channel->index), priv->arb_sema + SET_OFFSET);
return 0;
}
static int tegra210_bpmp_ring_doorbell(struct tegra_bpmp *bpmp)
{
struct tegra210_bpmp *priv = bpmp->priv;
struct irq_data *irq_data = priv->tx_irq_data;
/*
* Tegra Legacy Interrupt Controller (LIC) is used to notify BPMP of
* available messages
*/
if (irq_data->chip->irq_retrigger)
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/irq.h`, `linux/io.h`, `linux/of.h`, `linux/platform_device.h`, `soc/tegra/bpmp.h`, `bpmp-private.h`.
- Detected declarations: `struct tegra210_bpmp`, `function bpmp_channel_status`, `function tegra210_bpmp_is_response_ready`, `function tegra210_bpmp_is_request_ready`, `function tegra210_bpmp_is_request_channel_free`, `function tegra210_bpmp_is_response_channel_free`, `function tegra210_bpmp_post_request`, `function tegra210_bpmp_post_response`, `function tegra210_bpmp_ack_response`, `function tegra210_bpmp_ack_request`.
- Atlas domain: Driver Families / drivers/firmware.
- 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.