drivers/remoteproc/xlnx_r5_remoteproc.c
Source file repositories/reference/linux-study-clean/drivers/remoteproc/xlnx_r5_remoteproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/remoteproc/xlnx_r5_remoteproc.c- Extension
.c- Size
- 42980 bytes
- Lines
- 1616
- Domain
- Driver Families
- Bucket
- drivers/remoteproc
- 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/dma-mapping.hlinux/firmware/xlnx-zynqmp.hlinux/kernel.hlinux/mailbox_client.hlinux/mailbox/zynqmp-ipi-message.hlinux/module.hlinux/of_address.hlinux/of_platform.hlinux/of_reserved_mem.hlinux/platform_device.hlinux/remoteproc.hremoteproc_internal.h
Detected Declarations
struct mem_bank_datastruct zynqmp_sram_bankstruct mbox_infostruct rsc_tbl_datastruct zynqmp_r5_corestruct zynqmp_r5_clusterenum zynqmp_r5_cluster_modefunction event_notified_idr_cbfunction handle_event_notifiedfunction zynqmp_r5_mb_rx_cbfunction zynqmp_r5_setup_mboxfunction zynqmp_r5_free_mboxfunction zynqmp_r5_core_kickfunction zynqmp_r5_rproc_startfunction zynqmp_r5_rproc_stopfunction zynqmp_r5_mem_region_mapfunction zynqmp_r5_mem_region_unmapfunction add_mem_regions_carveoutfunction add_sram_carveoutsfunction tcm_mem_unmapfunction tcm_mem_mapfunction add_tcm_banksfunction zynqmp_r5_parse_fwfunction zynqmp_r5_rproc_preparefunction zynqmp_r5_rproc_unpreparefunction zynqmp_r5_get_rsc_table_vafunction zynqmp_r5_attachfunction zynqmp_r5_detachfunction zynqmp_r5_alloc_rproc_corefunction zynqmp_r5_get_sram_banksfunction zynqmp_r5_get_tcm_node_from_dtfunction zynqmp_r5_get_tcm_nodefunction zynqmp_r5_core_initfunction zynqmp_r5_cluster_initfunction zynqmp_r5_cluster_exitfunction zynqmp_r5_remoteproc_shutdownfunction zynqmp_r5_remoteproc_probe
Annotated Snippet
struct mem_bank_data {
phys_addr_t addr;
u32 da;
size_t size;
u32 pm_domain_id;
char *bank_name;
};
/**
* struct zynqmp_sram_bank - sram bank description
*
* @sram_res: sram address region information
* @da: device address of sram
*/
struct zynqmp_sram_bank {
struct resource sram_res;
u32 da;
};
/**
* struct mbox_info - mailbox channel data
*
* @rx_mc_buf: to copy data from mailbox rx channel
* @tx_mc_buf: to copy data to mailbox tx channel
* @r5_core: this mailbox's corresponding r5_core pointer
* @mbox_work: schedule work after receiving data from mailbox
* @mbox_cl: mailbox client
* @tx_chan: mailbox tx channel
* @rx_chan: mailbox rx channel
*/
struct mbox_info {
unsigned char rx_mc_buf[MBOX_CLIENT_BUF_MAX];
unsigned char tx_mc_buf[MBOX_CLIENT_BUF_MAX];
struct zynqmp_r5_core *r5_core;
struct work_struct mbox_work;
struct mbox_client mbox_cl;
struct mbox_chan *tx_chan;
struct mbox_chan *rx_chan;
};
/**
* struct rsc_tbl_data - resource table metadata
*
* Platform specific data structure used to sync resource table address.
* It's important to maintain order and size of each field on remote side.
*
* @version: version of data structure
* @magic_num: 32-bit magic number.
* @comp_magic_num: complement of above magic number
* @rsc_tbl_size: resource table size
* @rsc_tbl: resource table address
*/
struct rsc_tbl_data {
const int version;
const u32 magic_num;
const u32 comp_magic_num;
const u32 rsc_tbl_size;
const uintptr_t rsc_tbl;
} __packed;
/*
* Hardcoded TCM bank values. This will stay in driver to maintain backward
* compatibility with device-tree that does not have TCM information.
*/
static const struct mem_bank_data zynqmp_tcm_banks_split[] = {
{0xffe00000UL, 0x0, 0x10000UL, PD_R5_0_ATCM, "atcm0"}, /* TCM 64KB each */
{0xffe20000UL, 0x20000, 0x10000UL, PD_R5_0_BTCM, "btcm0"},
{0xffe90000UL, 0x0, 0x10000UL, PD_R5_1_ATCM, "atcm1"},
{0xffeb0000UL, 0x20000, 0x10000UL, PD_R5_1_BTCM, "btcm1"},
};
/* In lockstep mode cluster uses each 64KB TCM from second core as well */
static const struct mem_bank_data zynqmp_tcm_banks_lockstep[] = {
{0xffe00000UL, 0x0, 0x10000UL, PD_R5_0_ATCM, "atcm0"}, /* TCM 64KB each */
{0xffe20000UL, 0x20000, 0x10000UL, PD_R5_0_BTCM, "btcm0"},
{0xffe10000UL, 0x10000, 0x10000UL, PD_R5_1_ATCM, "atcm1"},
{0xffe30000UL, 0x30000, 0x10000UL, PD_R5_1_BTCM, "btcm1"},
};
/**
* struct zynqmp_r5_core - remoteproc core's internal data
*
* @rsc_tbl_va: resource table virtual address
* @sram: Array of sram memories assigned to this core
* @num_sram: number of sram for this core
* @dev: device of RPU instance
* @np: device node of RPU instance
* @tcm_bank_count: number TCM banks accessible to this RPU
* @tcm_banks: array of each TCM bank data
* @rproc: rproc handle
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `linux/firmware/xlnx-zynqmp.h`, `linux/kernel.h`, `linux/mailbox_client.h`, `linux/mailbox/zynqmp-ipi-message.h`, `linux/module.h`, `linux/of_address.h`, `linux/of_platform.h`.
- Detected declarations: `struct mem_bank_data`, `struct zynqmp_sram_bank`, `struct mbox_info`, `struct rsc_tbl_data`, `struct zynqmp_r5_core`, `struct zynqmp_r5_cluster`, `enum zynqmp_r5_cluster_mode`, `function event_notified_idr_cb`, `function handle_event_notified`, `function zynqmp_r5_mb_rx_cb`.
- Atlas domain: Driver Families / drivers/remoteproc.
- 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.