drivers/soc/ti/k3-ringacc.c
Source file repositories/reference/linux-study-clean/drivers/soc/ti/k3-ringacc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/ti/k3-ringacc.c- Extension
.c- Size
- 41904 bytes
- Lines
- 1578
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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.
- 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/dma-mapping.hlinux/io.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/string_choices.hlinux/sys_soc.hlinux/dma/ti-cppi5.hlinux/soc/ti/k3-ringacc.hlinux/soc/ti/ti_sci_protocol.hlinux/soc/ti/ti_sci_inta_msi.hlinux/of_irq.hlinux/irqdomain.h
Detected Declarations
struct k3_ring_rt_regsstruct k3_ring_fifo_regsstruct k3_ringacc_proxy_gcfg_regsstruct k3_ringacc_proxy_target_regsstruct k3_ring_opsstruct k3_ring_statestruct k3_ringstruct k3_ringacc_opsstruct k3_ringaccstruct k3_ringacc_soc_datastruct ringacc_match_dataenum k3_ringacc_proxy_access_modeenum k3_ringacc_access_modefunction k3_ringacc_ring_read_occfunction k3_ringacc_ring_update_occfunction k3_ringacc_ring_get_fifo_posfunction k3_ringacc_ring_dumpfunction k3_dmaring_request_dual_ringfunction k3_ringacc_request_rings_pairfunction k3_ringacc_ring_reset_scifunction k3_ringacc_ring_resetfunction k3_ringacc_ring_reconfig_qmode_scifunction k3_ringacc_ring_reset_dmafunction k3_ringacc_ring_free_scifunction k3_ringacc_ring_freefunction k3_ringacc_get_ring_idfunction k3_ringacc_get_tisci_dev_idfunction k3_ringacc_get_ring_irq_numfunction k3_ringacc_ring_cfg_scifunction k3_dmaring_cfgfunction k3_ringacc_ring_cfgfunction k3_ringacc_ring_get_sizefunction k3_ringacc_ring_get_freefunction k3_ringacc_ring_get_occfunction k3_ringacc_ring_is_fullfunction k3_ringacc_ring_cfg_proxyfunction k3_ringacc_ring_access_proxyfunction k3_ringacc_ring_push_head_proxyfunction k3_ringacc_ring_push_tail_proxyfunction k3_ringacc_ring_pop_head_proxyfunction k3_ringacc_ring_pop_tail_proxyfunction k3_ringacc_ring_access_iofunction k3_ringacc_ring_push_head_iofunction k3_ringacc_ring_push_iofunction k3_ringacc_ring_pop_iofunction k3_ringacc_ring_pop_tail_iofunction k3_dmaring_remove_asel_from_elemfunction k3_dmaring_fwd_pop
Annotated Snippet
struct k3_ring_rt_regs {
u32 resv_16[4];
u32 db;
u32 resv_4[1];
u32 occ;
u32 indx;
u32 hwocc;
u32 hwindx;
};
#define K3_RINGACC_RT_REGS_STEP 0x1000
#define K3_DMARING_RT_REGS_STEP 0x2000
#define K3_DMARING_RT_REGS_REVERSE_OFS 0x1000
#define K3_RINGACC_RT_OCC_MASK GENMASK(20, 0)
#define K3_DMARING_RT_OCC_TDOWN_COMPLETE BIT(31)
#define K3_DMARING_RT_DB_ENTRY_MASK GENMASK(7, 0)
#define K3_DMARING_RT_DB_TDOWN_ACK BIT(31)
/**
* struct k3_ring_fifo_regs - The Ring Accelerator Queues Registers region
*
* @head_data: Ring Head Entry Data Registers
* @tail_data: Ring Tail Entry Data Registers
* @peek_head_data: Ring Peek Head Entry Data Regs
* @peek_tail_data: Ring Peek Tail Entry Data Regs
*/
struct k3_ring_fifo_regs {
u32 head_data[128];
u32 tail_data[128];
u32 peek_head_data[128];
u32 peek_tail_data[128];
};
/**
* struct k3_ringacc_proxy_gcfg_regs - RA Proxy Global Config MMIO Region
*
* @revision: Revision Register
* @config: Config Register
*/
struct k3_ringacc_proxy_gcfg_regs {
u32 revision;
u32 config;
};
#define K3_RINGACC_PROXY_CFG_THREADS_MASK GENMASK(15, 0)
/**
* struct k3_ringacc_proxy_target_regs - Proxy Datapath MMIO Region
*
* @control: Proxy Control Register
* @status: Proxy Status Register
* @resv_512: Reserved
* @data: Proxy Data Register
*/
struct k3_ringacc_proxy_target_regs {
u32 control;
u32 status;
u8 resv_512[504];
u32 data[128];
};
#define K3_RINGACC_PROXY_TARGET_STEP 0x1000
#define K3_RINGACC_PROXY_NOT_USED (-1)
enum k3_ringacc_proxy_access_mode {
PROXY_ACCESS_MODE_HEAD = 0,
PROXY_ACCESS_MODE_TAIL = 1,
PROXY_ACCESS_MODE_PEEK_HEAD = 2,
PROXY_ACCESS_MODE_PEEK_TAIL = 3,
};
#define K3_RINGACC_FIFO_WINDOW_SIZE_BYTES (512U)
#define K3_RINGACC_FIFO_REGS_STEP 0x1000
#define K3_RINGACC_MAX_DB_RING_CNT (127U)
struct k3_ring_ops {
int (*push_tail)(struct k3_ring *ring, void *elm);
int (*push_head)(struct k3_ring *ring, void *elm);
int (*pop_tail)(struct k3_ring *ring, void *elm);
int (*pop_head)(struct k3_ring *ring, void *elm);
};
/**
* struct k3_ring_state - Internal state tracking structure
*
* @free: Number of free entries
* @occ: Occupancy
* @windex: Write index
* @rindex: Read index
* @tdown_complete: Tear down complete state
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/string_choices.h`, `linux/sys_soc.h`, `linux/dma/ti-cppi5.h`.
- Detected declarations: `struct k3_ring_rt_regs`, `struct k3_ring_fifo_regs`, `struct k3_ringacc_proxy_gcfg_regs`, `struct k3_ringacc_proxy_target_regs`, `struct k3_ring_ops`, `struct k3_ring_state`, `struct k3_ring`, `struct k3_ringacc_ops`, `struct k3_ringacc`, `struct k3_ringacc_soc_data`.
- Atlas domain: Driver Families / drivers/soc.
- Implementation status: integration 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.