drivers/tty/serial/amba-pl011.c
Source file repositories/reference/linux-study-clean/drivers/tty/serial/amba-pl011.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/amba-pl011.c- Extension
.c- Size
- 82300 bytes
- Lines
- 3224
- Domain
- Driver Families
- Bucket
- drivers/tty
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/ioport.hlinux/init.hlinux/console.hlinux/platform_device.hlinux/sysrq.hlinux/device.hlinux/tty.hlinux/tty_flip.hlinux/serial_core.hlinux/serial.hlinux/amba/bus.hlinux/amba/serial.hlinux/clk.hlinux/slab.hlinux/dmaengine.hlinux/dma-mapping.hlinux/scatterlist.hlinux/delay.hlinux/types.hlinux/of.hlinux/pinctrl/consumer.hlinux/sizes.hlinux/io.hlinux/acpi.h
Detected Declarations
struct vendor_datastruct pl011_dmabufstruct pl011_dmarx_datastruct pl011_dmatx_datastruct uart_amba_portenum pl011_rs485_tx_statefunction get_fifosize_armfunction get_fifosize_stfunction get_fifosize_nvidiafunction pl011_reg_to_offsetfunction pl011_readfunction pl011_writefunction pl011_fifo_to_ttyfunction pl011_dmabuf_initfunction pl011_dmabuf_freefunction pl011_dma_probefunction pl011_dma_removefunction pl011_dma_tx_callbackfunction reasonfunction pl011_dma_tx_refillfunction pl011_dma_tx_irqfunction transmitfunction pl011_dma_tx_startfunction pl011_dma_flush_bufferfunction pl011_dma_rx_trigger_dmafunction pl011_dma_rx_charsfunction pl011_dma_rx_irqfunction pl011_dma_rx_callbackfunction pl011_dma_rx_stopfunction pl011_dma_rx_pollfunction pl011_dma_startupfunction pl011_dma_shutdownfunction pl011_dma_rx_availablefunction pl011_dma_rx_runningfunction pl011_dma_removefunction pl011_dma_tx_stopfunction pl011_dma_rx_irqfunction pl011_dma_rx_availablefunction pl011_dma_rx_runningfunction pl011_rs485_tx_stopfunction pl011_stop_txfunction pl011_start_tx_piofunction pl011_rs485_tx_startfunction pl011_start_txfunction pl011_trigger_start_txfunction pl011_trigger_stop_txfunction pl011_stop_rxfunction pl011_throttle_rx
Annotated Snippet
struct vendor_data {
const u16 *reg_offset;
unsigned int ifls;
unsigned int fr_busy;
unsigned int fr_dsr;
unsigned int fr_cts;
unsigned int fr_ri;
unsigned int inv_fr;
bool access_32b;
bool oversampling;
bool dma_threshold;
bool cts_event_workaround;
bool always_enabled;
bool fixed_options;
bool skip_ibrd_fbrd;
bool set_uartclk_rate;
unsigned int (*get_fifosize)(struct amba_device *dev);
};
static unsigned int get_fifosize_arm(struct amba_device *dev)
{
return amba_rev(dev) < 3 ? 16 : 32;
}
static struct vendor_data vendor_arm = {
.reg_offset = pl011_std_offsets,
.ifls = UART011_IFLS_RX4_8 | UART011_IFLS_TX4_8,
.fr_busy = UART01x_FR_BUSY,
.fr_dsr = UART01x_FR_DSR,
.fr_cts = UART01x_FR_CTS,
.fr_ri = UART011_FR_RI,
.oversampling = false,
.dma_threshold = false,
.cts_event_workaround = false,
.always_enabled = false,
.fixed_options = false,
.get_fifosize = get_fifosize_arm,
};
static const struct vendor_data vendor_sbsa = {
.reg_offset = pl011_std_offsets,
.fr_busy = UART01x_FR_BUSY,
.fr_dsr = UART01x_FR_DSR,
.fr_cts = UART01x_FR_CTS,
.fr_ri = UART011_FR_RI,
.access_32b = true,
.oversampling = false,
.dma_threshold = false,
.cts_event_workaround = false,
.always_enabled = true,
.fixed_options = true,
};
#ifdef CONFIG_ACPI_SPCR_TABLE
static const struct vendor_data vendor_qdt_qdf2400_e44 = {
.reg_offset = pl011_std_offsets,
.fr_busy = UART011_FR_TXFE,
.fr_dsr = UART01x_FR_DSR,
.fr_cts = UART01x_FR_CTS,
.fr_ri = UART011_FR_RI,
.inv_fr = UART011_FR_TXFE,
.access_32b = true,
.oversampling = false,
.dma_threshold = false,
.cts_event_workaround = false,
.always_enabled = true,
.fixed_options = true,
};
#endif
static u16 pl011_st_offsets[REG_ARRAY_SIZE] = {
[REG_DR] = UART01x_DR,
[REG_ST_DMAWM] = ST_UART011_DMAWM,
[REG_ST_TIMEOUT] = ST_UART011_TIMEOUT,
[REG_FR] = UART01x_FR,
[REG_LCRH_RX] = ST_UART011_LCRH_RX,
[REG_LCRH_TX] = ST_UART011_LCRH_TX,
[REG_IBRD] = UART011_IBRD,
[REG_FBRD] = UART011_FBRD,
[REG_CR] = UART011_CR,
[REG_IFLS] = UART011_IFLS,
[REG_IMSC] = UART011_IMSC,
[REG_RIS] = UART011_RIS,
[REG_MIS] = UART011_MIS,
[REG_ICR] = UART011_ICR,
[REG_DMACR] = UART011_DMACR,
[REG_ST_XFCR] = ST_UART011_XFCR,
[REG_ST_XON1] = ST_UART011_XON1,
[REG_ST_XON2] = ST_UART011_XON2,
Annotation
- Immediate include surface: `linux/module.h`, `linux/ioport.h`, `linux/init.h`, `linux/console.h`, `linux/platform_device.h`, `linux/sysrq.h`, `linux/device.h`, `linux/tty.h`.
- Detected declarations: `struct vendor_data`, `struct pl011_dmabuf`, `struct pl011_dmarx_data`, `struct pl011_dmatx_data`, `struct uart_amba_port`, `enum pl011_rs485_tx_state`, `function get_fifosize_arm`, `function get_fifosize_st`, `function get_fifosize_nvidia`, `function pl011_reg_to_offset`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: integration 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.