drivers/edac/versalnet_edac.c
Source file repositories/reference/linux-study-clean/drivers/edac/versalnet_edac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/edac/versalnet_edac.c- Extension
.c- Size
- 25121 bytes
- Lines
- 979
- Domain
- Driver Families
- Bucket
- drivers/edac
- 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/cdx/edac_cdx_pcol.hlinux/edac.hlinux/module.hlinux/of_device.hlinux/ras.hlinux/remoteproc.hlinux/rpmsg.hlinux/sizes.hras/ras_event.hedac_module.h
Detected Declarations
struct ecc_statusstruct mc_privenum adec_infoenum reg_infofunction get_ddr_infofunction convert_to_physicalfunction handle_errorfunction mc_initfunction mcdi_rpc_timeoutfunction mcdi_requestfunction get_ddr_configfunction setup_mcdifunction rpmsg_cbfunction rpmsg_probefunction rpmsg_removefunction versal_edac_releasefunction remove_one_mcfunction init_one_mcfunction init_versalnetfunction remove_versalnetfunction mc_probefunction mc_remove
Annotated Snippet
struct ecc_status {
union ecc_error_info ceinfo[2];
union ecc_error_info ueinfo[2];
u8 channel;
u8 error_type;
};
/**
* struct mc_priv - DDR memory controller private instance data.
* @message: Buffer for framing the event specific info.
* @stat: ECC status information.
* @error_id: The error id.
* @error_level: The error level.
* @dwidth: Width of data bus excluding ECC bits.
* @part_len: The support of the message received.
* @regs: The registers sent on the rpmsg.
* @adec: Address decode registers.
* @mci: Memory controller interface.
* @ept: rpmsg endpoint.
* @mcdi: The mcdi handle.
*/
struct mc_priv {
char message[256];
struct ecc_status stat;
u32 error_id;
u32 error_level;
u32 dwidth;
u32 part_len;
u32 regs[REG_MAX];
u32 adec[ADEC_MAX];
struct mem_ctl_info *mci[NUM_CONTROLLERS];
struct rpmsg_endpoint *ept;
struct cdx_mcdi *mcdi;
};
/*
* Address decoder (ADEC) registers to match the order in which the register
* information is received from the firmware.
*/
enum adec_info {
CONF = 0,
ADEC0,
ADEC1,
ADEC2,
ADEC3,
ADEC4,
ADEC5,
ADEC6,
ADEC7,
ADEC8,
ADEC9,
ADEC10,
ADEC11,
ADEC12,
ADEC13,
ADEC14,
ADEC15,
ADEC16,
ADECILC,
};
enum reg_info {
ISR = 0,
IMR,
ECCR0_ERR_STATUS,
ECCR0_ADDR_LO,
ECCR0_ADDR_HI,
ECCR0_DATA_LO,
ECCR0_DATA_HI,
ECCR0_PAR,
ECCR1_ERR_STATUS,
ECCR1_ADDR_LO,
ECCR1_ADDR_HI,
ECCR1_DATA_LO,
ECCR1_DATA_HI,
ECCR1_PAR,
XMPU_ERR,
XMPU_ERR_ADDR_L0,
XMPU_ERR_ADDR_HI,
XMPU_ERR_AXI_ID,
ADEC_CHK_ERR_LOG,
};
static bool get_ddr_info(u32 *error_data, struct mc_priv *priv)
{
u32 reglo, reghi, parity, eccr0_val, eccr1_val, isr;
struct ecc_status *p;
isr = error_data[ISR];
Annotation
- Immediate include surface: `linux/cdx/edac_cdx_pcol.h`, `linux/edac.h`, `linux/module.h`, `linux/of_device.h`, `linux/ras.h`, `linux/remoteproc.h`, `linux/rpmsg.h`, `linux/sizes.h`.
- Detected declarations: `struct ecc_status`, `struct mc_priv`, `enum adec_info`, `enum reg_info`, `function get_ddr_info`, `function convert_to_physical`, `function handle_error`, `function mc_init`, `function mcdi_rpc_timeout`, `function mcdi_request`.
- Atlas domain: Driver Families / drivers/edac.
- 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.